@auth.requires_membership('VIP')
@cache("Ertrag", time_expire=86400, cache_model=cache.disk)
def Ertrag():
Liste=getvaluesfromDB(db)
Liste=Sortvalues(Liste)
return response.render(Liste=Liste)| web2py™ | Version 2.4.7-stable+timestamp.2013.05.24.17.48.47 |
|---|---|
| Python | Python 2.7.4: C:\Python27\python.exe (prefix: C:\Python27) |
1. | Traceback (most recent call last): |
<type 'exceptions.RuntimeError'>(unable to
create/re-create cache file
F:\Website\web2py\applications\Prolog\cache\cache.shelve)
| args | (r'unable to create/re-create cache file F:\Website\web2py\applications\Prolog\cache\cache.shelve',) |
|---|---|
| __setattr__ | <method-wrapper '__setattr__' of exceptions.RuntimeError object> |
| __reduce_ex__ | <built-in method __reduce_ex__ of exceptions.RuntimeError object> |
| __getslice__ | <method-wrapper '__getslice__' of exceptions.RuntimeError object> |
| __getitem__ | <method-wrapper '__getitem__' of exceptions.RuntimeError object> |
| __setstate__ | <built-in method __setstate__ of exceptions.RuntimeError object> |
| __getattribute__ | <method-wrapper '__getattribute__' of exceptions.RuntimeError object> |
| __str__ | <method-wrapper '__str__' of exceptions.RuntimeError object> |
| __format__ | <built-in method __format__ of exceptions.RuntimeError object> |
| __reduce__ | <built-in method __reduce__ of exceptions.RuntimeError object> |
| __class__ | <type 'exceptions.RuntimeError'> |
| __dict__ | {} |
| __delattr__ | <method-wrapper '__delattr__' of exceptions.RuntimeError object> |
| __subclasshook__ | <built-in method __subclasshook__ of type object> |
| __repr__ | <method-wrapper '__repr__' of exceptions.RuntimeError object> |
| __init__ | <method-wrapper '__init__' of exceptions.RuntimeError object> |
| __hash__ | <method-wrapper '__hash__' of exceptions.RuntimeError object> |
| __sizeof__ | <built-in method __sizeof__ of exceptions.RuntimeError object> |
| __doc__ | 'Unspecified run-time error.' |
| __unicode__ | <built-in method __unicode__ of exceptions.RuntimeError object> |
| __new__ | <built-in method __new__ of type object> ...default.py http://..../[app]/default/data/update/[table]/[id] |
I just changet it from cache.disk to cache.ram and it works but I would prefer to put it on the disk and not to the ram.
created cache.shelve has no owner and so it is not readable/writeable by the current sys user. When I create an empty cache.shelve by myself it seems to work.I can confirm the exception, on my local developement system thecreated cache.shelve has no owner and so it is not readable/writeable by the current sys user. When I create an empty cache.shelve by myself it seems to work.
On Wednesday, May 29, 2013 12:28:35 PM UTC+2, BlueShadow wrote:
--
---
You received this message because you are subscribed to a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/1MlmDm8II3k/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
My local development system is windows 7 width the build in rocket server, my test server is a IIS 7 running with isapi_wsgi.
On both, the cache.shelve created by web2py has no owner.
On Thursday, May 30, 2013 12:41:12 PM UTC+2, LightDot wrote:
--
The source of the problem is in the gluon/cache.py
def _open_shelf_with_lock(self):
"""Open and return a shelf object, obtaining an exclusive lock
on self.locker first. Replaces the close method of the
returned shelf instance with one that releases the lock upon
closing."""
def _close(self):
try:
shelve.Shelf.close(self)
finally:
portalocker.unlock(self.locker)
self.locker.close()
storage, locker, locker_locked = None, None, False
try:
locker = open(self.locker_name, 'a')
portalocker.lock(locker, portalocker.LOCK_EX)
locker_locked = True
storage = shelve.open(self.shelve_name)
storage.close = _close.__get__(storage, shelve.Shelf)
storage.locker = locker
except Exception:
logger.error('corrupted cache file %s, will try to delete and recreate it!' % (self.shelve_name))
if storage:
storage.close()
storage = None
try:
os.unlink(self.shelve_name)
storage = shelve.open(self.shelve_name)
storage.close = _close.__get__(storage, shelve.Shelf)
storage.locker = locker
if not CacheAbstract.cache_stats_name in storage.keys():
storage[CacheAbstract.cache_stats_name] = {
'hit_total': 0,
'misses': 0,
}
storage.sync()
except (IOError, OSError):
logger.warn('unable to delete and recreate cache file %s' % self.shelve_name)
if storage:
storage.close()
storage = None
if locker_locked:
portalocker.unlock(locker)
if locker:
locker.close()
return storage