Forums

Import error for web2py

I cannot access my website due to an import error. The error is from gluon import recfile, which is the web2py code. I do not know how to fix this since it is within web2py itself, which did not have this issue last week.

Any help?

Your site doesn't seem to be throwing that error anymore. DId you work out what the problem was?

Yes, I ended up deleting the entire site and then reuploading it. Not sure how but seems web2py got corrupted somehow.

I am having the same problem today 17 Mar 2015. It was working fine last night and no changes were made since then. Although I've already zipped up the application directory for download, I don't really want to delete the entire site and start over.

Can anyone on the staff find out what is wrong?

Error code: Unhandled Exception

ERROR LOG:

  • 2015-03-17 17:08:09,640 :Traceback (most recent call last):
  • 2015-03-17 17:08:09,640 : File "/bin/user_wsgi_wrapper.py", line 130, in call
  • 2015-03-17 17:08:09,640 :
    self.error_log_file.logger.exception("Error running WSGI application")
  • 2015-03-17 17:08:09,640 : File "/usr/lib/python2.7/logging/init.py", line 1185, in exception
  • 2015-03-17 17:08:09,641 : self.error(msg, args, *kwargs)
  • 2015-03-17 17:08:09,641 : File "/usr/lib/python2.7/logging/init.py", line 1178, in error
  • 2015-03-17 17:08:09,641 : self._log(ERROR, msg, args, **kwargs)
  • 2015-03-17 17:08:09,641 : File "/usr/lib/python2.7/logging/init.py", line 1270, in _log
  • 2015-03-17 17:08:09,642 : record = self.makeRecord(self.name, level, fn, lno, msg, args, exc_info, func, extra)
  • 2015-03-17 17:08:09,642 : File "/usr/lib/python2.7/logging/init.py", line 1244, in makeRecord
  • 2015-03-17 17:08:09,642 : rv = LogRecord(name, level, fn, lno, msg, args, exc_info, func)
  • 2015-03-17 17:08:09,642 : File "/usr/lib/python2.7/logging/init.py", line 284, in init
  • 2015-03-17 17:08:09,642 : self.threadName = threading.current_thread().name
  • 2015-03-17 17:08:09,642 : File "/usr/lib/python2.7/threading.py", line 1160, in currentThread
  • 2015-03-17 17:08:09,642 : return _active[_get_ident()]
  • 2015-03-17 17:08:09,642 : File "/bin/user_wsgi_wrapper.py", line 122, in call
  • 2015-03-17 17:08:09,643 : app_iterator = self.app(environ, start_response)
  • 2015-03-17 17:08:09,643 : File "/bin/user_wsgi_wrapper.py", line 136, in import_error_application
  • 2015-03-17 17:08:09,643 : raise e
  • 2015-03-17 17:08:09,643 :ImportError: cannot import name recfile

Did you update web2py or anything like that sometime over the last month? If you update web2py and it doesn't complete properly (sometimes they have broken upgrades that do that) then sometimes your site will carry on working until it is reloaded. Normally we only reload sites if you explicitly tell the system to using the "Reload" button on the "Web" tab, but when we update the system (like we did this morning) it essentially reloads every web app we have running. So that would explain the situation and why it went wrong today.

Yes, I did update web2py last week to fix a different problem -- and that seemed to work. Since there was no error message (or I missed it), I suppose I should reload the app myself after the next update -- and rebuild, if necessary. In any case, thanks for the quick turnaround.

No problem. Right, it's definitely a good idea to reload the web app right after updating web2py -- at least then you discover problems early rather than at some awkward time of day when the system has auto-reloaded them because of maintenance.