UnpickleableError: Cannot pickle <type 'thread.lock'> objects
I'm having some ZODB troubles. I'm getting the following error. The problem is I'm not using locks in the objects that are being changed. I do have a lock being used with the Schedule object which is in the acquisition path. but this lock was a module variable rather than a attribute so that shouldn't matter should it? I've also taken the lock code out altogeather now and I'm still getting the same error. Any ideas? 2005-06-14T17:33:39 ERROR(200) SiteError http://localhost:8080/iv/scheduler/noti fyOne Traceback (most recent call last): File "C:\Program Files\Zope-2.7.5-final\lib\python\ZPublisher\Publish.py", lin e 107, in publish transactions_manager.commit() File "C:\Program Files\Zope-2.7.5-final\lib\python\Zope\App\startup.py", line 222, in commit get_transaction().commit() File "C:\Program Files\Zope-2.7.5-final\lib\python\ZODB\Transaction.py", line 241, in commit ncommitted += self._commit_objects(objects) File "C:\Program Files\Zope-2.7.5-final\lib\python\ZODB\Transaction.py", line 356, in _commit_objects jar.commit(o, self) File "C:\Program Files\Zope-2.7.5-final\lib\python\ZODB\Connection.py", line 4 52, in commit dump(state) UnpickleableError: Cannot pickle <type 'thread.lock'> objects -- Dylan Jay --- http://www.meetmemap.com - makes giving directions easy http://www.pretaweb.com - Update-it-yourself, low cost websites http://www.eatmanifesto.com - against all dumbing down of food Y!:dylan_jay ICQ:520341 MSN:djsq@hotmail.com Ph:+61423198306
Dylan Jay wrote at 2005-6-14 17:45 +1000:
... 356, in _commit_objects jar.commit(o, self) File "C:\Program Files\Zope-2.7.5-final\lib\python\ZODB\Connection.py", line 4 52, in commit dump(state) UnpickleableError: Cannot pickle <type 'thread.lock'> objects
I would catch the error and enter a debugger to analyse the "o" above. With "pdb" (the Python Debugger, part of Python), this could look like: try: dump(state) except: import pdb; pdb.set_trace() Zope will then enter the debugger when the error happens. You must run Zope in the foreground for this to work (otherwise, you do not have a chance to interact with "pdb"). -- Dieter
"Dieter Maurer" <dieter@handshake.de> wrote in message news:17071.4574.893818.528219@gargle.gargle.HOWL...
Dylan Jay wrote at 2005-6-14 17:45 +1000:
... 356, in _commit_objects jar.commit(o, self) File "C:\Program Files\Zope-2.7.5-final\lib\python\ZODB\Connection.py", line 4 52, in commit dump(state) UnpickleableError: Cannot pickle <type 'thread.lock'> objects
I would catch the error and enter a debugger to analyse the "o" above.
With "pdb" (the Python Debugger, part of Python), this could look like:
try: dump(state) except: import pdb; pdb.set_trace()
Good suggestion (I did try to get debugging working in WingIDE and Boa but your way worked best in the end). Unfortunatly I'm still none the wiser. I know which object it is and I've looked at its state (below). I've looked at the OOBTree and made sure it contains nothing that has a lock in it. I can look at sys.exc_info[1].args which is a lock object but what I really need to do is work out where this lock object is and why its entangled with my transaction. Any suggestions? {'__ac_local_roles__': {'djay': ['Owner']}, '_cacheables': {'constructReviewer': <NamedCacheable instance at 0409A8D0>, 'findNeighbors': <NamedCacheable instance at 0409A8C0>}, '_hasBeenTrained': 0, 'filterByMovies': 0, 'filterByPeople': 0, 'filterByVotes': 0, 'hashMoviesToUse': None, 'hashPeopleToUse': None, 'hoods': <OOBTree object at 0x041B5368>, 'id': 'predictor', 'keepInMemory': 0, 'moviesToUse': None, 'neighborhoodSize': 30, 'overlapPenalty': 50, 'peopleToUse': None, 'reviewers': None, 'title': '', 'votesToUse': None}
I think I've tracked it down to a RamCacheManager inside a volitile variable. But I thought volitile variables we'ren't stored? Am I doing something strange with my heirachy that is abusing the ZODB? The heirachy is object.<Map>[Cacheable] And the Cacheable has _v_ZCacheable_cache = RamCacheManager. I believe the RamCacheManager has locks in it.
"Dieter Maurer" <dieter@handshake.de> wrote in message news:17071.4574.893818.528219@gargle.gargle.HOWL...
Dylan Jay wrote at 2005-6-14 17:45 +1000:
... 356, in _commit_objects jar.commit(o, self) File "C:\Program Files\Zope-2.7.5-final\lib\python\ZODB\Connection.py", line 4 52, in commit dump(state) UnpickleableError: Cannot pickle <type 'thread.lock'> objects
I would catch the error and enter a debugger to analyse the "o" above.
With "pdb" (the Python Debugger, part of Python), this could look like:
try: dump(state) except: import pdb; pdb.set_trace()
Good suggestion (I did try to get debugging working in WingIDE and Boa but your way worked best in the end). Unfortunatly I'm still none the wiser. I know which object it is and I've looked at its state (below). I've looked at the OOBTree and made sure it contains nothing that has a lock in it. I can look at sys.exc_info[1].args which is a lock object but what I really need to do is work out where this lock object is and why its entangled with my transaction. Any suggestions?
{'__ac_local_roles__': {'djay': ['Owner']}, '_cacheables': {'constructReviewer': <NamedCacheable instance at 0409A8D0>, 'findNeighbors': <NamedCacheable instance at 0409A8C0>}, '_hasBeenTrained': 0, 'filterByMovies': 0, 'filterByPeople': 0, 'filterByVotes': 0, 'hashMoviesToUse': None, 'hashPeopleToUse': None, 'hoods': <OOBTree object at 0x041B5368>, 'id': 'predictor', 'keepInMemory': 0, 'moviesToUse': None, 'neighborhoodSize': 30, 'overlapPenalty': 50, 'peopleToUse': None, 'reviewers': None, 'title': '', 'votesToUse': None}
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
"Dylan Jay" <gmane@dylanjay.com> wrote in message news:d8ogk5$27c$1@sea.gmane.org...
I think I've tracked it down to a RamCacheManager inside a volitile variable. But I thought volitile variables we'ren't stored? Am I doing something strange with my heirachy that is abusing the ZODB? The heirachy is object.<Map>[Cacheable] And the Cacheable has _v_ZCacheable_cache = RamCacheManager. I believe the RamCacheManager has locks in it.
I think I've tracked down the problem. Cacheable did not inherit from Persistent. I was infact using a super class of Cacheable called NamedCacheable which inherited Acquisition.Implicit which I'd thought was enough (a long time ago when I wrote it). Just for the record, how I tracked this down was by using dumps. In pdb I did from pickle import dumps pp state['attributename'] until I found the parts of the state that raised errors.
"Dieter Maurer" <dieter@handshake.de> wrote in message news:17071.4574.893818.528219@gargle.gargle.HOWL...
Dylan Jay wrote at 2005-6-14 17:45 +1000:
... 356, in _commit_objects jar.commit(o, self) File "C:\Program Files\Zope-2.7.5-final\lib\python\ZODB\Connection.py", line 4 52, in commit dump(state) UnpickleableError: Cannot pickle <type 'thread.lock'> objects
I would catch the error and enter a debugger to analyse the "o" above.
With "pdb" (the Python Debugger, part of Python), this could look like:
try: dump(state) except: import pdb; pdb.set_trace()
Good suggestion (I did try to get debugging working in WingIDE and Boa but your way worked best in the end). Unfortunatly I'm still none the wiser. I know which object it is and I've looked at its state (below). I've looked at the OOBTree and made sure it contains nothing that has a lock in it. I can look at sys.exc_info[1].args which is a lock object but what I really need to do is work out where this lock object is and why its entangled with my transaction. Any suggestions?
{'__ac_local_roles__': {'djay': ['Owner']}, '_cacheables': {'constructReviewer': <NamedCacheable instance at 0409A8D0>, 'findNeighbors': <NamedCacheable instance at 0409A8C0>}, '_hasBeenTrained': 0, 'filterByMovies': 0, 'filterByPeople': 0, 'filterByVotes': 0, 'hashMoviesToUse': None, 'hashPeopleToUse': None, 'hoods': <OOBTree object at 0x041B5368>, 'id': 'predictor', 'keepInMemory': 0, 'moviesToUse': None, 'neighborhoodSize': 30, 'overlapPenalty': 50, 'peopleToUse': None, 'reviewers': None, 'title': '', 'votesToUse': None}
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
participants (2)
-
Dieter Maurer -
Dylan Jay