Hi all,
    unfortunately I have some issues with a web2py instance (1.99.4)
only in production: I can't reproduce the problem, but maybe this is
an easy fix.

Traceback:
Traceback (most recent call last):
  File "/home/niphlod/production/web2py/gluon/main.py", line 493, in
wsgibase
    serve_controller(request, response, session)
  File "/home/niphlod/production/web2py/gluon/main.py", line 187, in
serve_controller
    environment = build_environment(request, response, session)
  File "/home/niphlod/production/web2py/gluon/compileapp.py", line
339, in build_environment
    c = environment['cache'] = Cache(request)
  File "/home/niphlod/production/web2py/gluon/cache.py", line 376, in
__init__
    self.disk = CacheOnDisk(request)
  File "/home/niphlod/production/web2py/gluon/cache.py", line 261, in
__init__
    os.unlink(self.shelve_name)
OSError: [Errno 2] No such file or directory: '/home/niphlod/
production/web2py/applications/plaza/cache/cache.shelve'

Looking closely to gluon/cache.py, it seems that it can be fixed ...
here's an excerpt from line 255 and on...

            except ImportError:
                pass # no module _bsddb, ignoring exception now so it
makes a ticket only if used
            except:
                logger.error('corrupted file %s, will try delete it!'
\
                                 % self.shelve_name)
                try:
                    os.unlink(self.shelve_name)
                except IOError:
                    logger.warn('unable to delete file %s' %
self.shelve_name)
            if locker_locked:
                portalocker.unlock(locker)
            if locker:
                locker.close()

I don't know why it happens, but adding an OSError exception to the
IOError on line 262 will fix it.

BTW: I'm sure I don't call cache on disk within my application: why is
this happening ? Some of  the core web2py functions require to cache
on disk ?

Reply via email to