ERROR on clear cash fron admin DB

39 views
Skip to first unread message

Dmitry Ermolaev

unread,
Apr 6, 2015, 12:59:13 AM4/6/15
to web...@googlegroups.com
I store in cash connection:
# покажем если был вызов а не из кэша
def conn_1(curr, xcurr):
   
print 'try connect to ',curr.abbrev
   
# def __init__(self, service_url, service_name=None, timeout=HTTP_TIMEOUT, connection=None):
    cn
= ServiceProxy(xcurr.connect_url, None, 40)
   
#print cn
    blk
= cn.getblockcount()
   
print 'connected on block:', blk
   
return cn

# тут если удача то надолго запомним
def conn_0(curr, xcurr):
   
try:
        cn
= cache.ram(curr.abbrev, lambda: conn_1(curr, xcurr), time_expire = 36000)
   
except Exception as e:
       
print curr.abbrev + ' conn except: %s' % str(e).decode('cp1251','replace')
        cn
= None
   
if not cn:
        cache
.ram.clear(curr.abbrev)
   
return cn

# если нет связи то тоже запомним на небольшое время
def conn(curr, xcurr, cn=None):
   
# пока не подключимся - пробуем
    cn
= cache.ram(curr.abbrev + '_0', lambda: conn_0(curr, xcurr), time_expire = 10)
   
return cn



Traceback (most recent call last):
File "C:\web2py-m\gluon\restricted.py", line 224, in restricted
exec ccode in environment
File "C:/web2py-m/applications/shop/controllers/appadmin.py", line 636, in <module>
File "C:\web2py-m\gluon\globals.py", line 393, in <lambda>
self._caller = lambda f: f()
File "C:/web2py-m/applications/shop/controllers/appadmin.py", line 371, in ccache
cache.disk.clear()
File "C:\web2py-m\gluon\cache.py", line 427, in clear
storage.clear()
File "C:\web2py-m\gluon\cache.py", line 364, in clear
for key in self:
File "C:\web2py-m\gluon\cache.py", line 349, in __iter__
yield self.key_filter_out(filename)
File "C:\web2py-m\gluon\cache.py", line 307, in key_filter_out_windows
return base64.b32decode(key)
File "C:\Python27\lib\base64.py", line 198, in b32decode
raise TypeError('Incorrect padding')
TypeError: Incorrect padding

Leonel Câmara

unread,
Apr 6, 2015, 8:50:14 AM4/6/15
to web...@googlegroups.com
Did you upgrade recently? What's in your application's cache folder?

Kiran Subbaraman

unread,
Jun 17, 2015, 9:51:58 AM6/17/15
to web...@googlegroups.com
The appadmin.py may have changed between web2py releases (release1 being the one which you used to create your application initially, and release2 being the one that you want to run your application in now.)
By default this appadmin.py is contained within your application.

So, can you try to copy the appadmin.py from the default "welcome app" of release2, and copy it into your application's controller directory.
See if this sorts out the issue.
Reply all
Reply to author
Forward
0 new messages