Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DB migrated from 5.1 throws pickle error in MemberDataTool #2722

Closed
pysailor opened this issue Feb 5, 2019 · 3 comments
Closed

DB migrated from 5.1 throws pickle error in MemberDataTool #2722

pysailor opened this issue Feb 5, 2019 · 3 comments

Comments

@pysailor
Copy link
Contributor

pysailor commented Feb 5, 2019

BUG/PROBLEM REPORT

What I did:

coredev, in branch 5.1.
I created a Plone site and added 1 user (pysailor)

I copied the Data.fs to coredev, branch 5.2 (python2.7)
There, I ran the upgrade steps and loaded the Plone site

What I expect to happen:

That I can use Plone as usual. E.g. that I can add a new Page, that will get displayed properly.

What actually happened:

In the log, when loading the Plone site, I see the following traceback:

2019-02-05 21:41:47,381 ERROR [CMFCore.MembershipTool:160][waitress] Error during wrapUser
Traceback (most recent call last):
  File "/home/thomas/dev/plone5.2devel/eggs/Products.CMFCore-2.4.0b6-py2.7.egg/Products/CMFCore/MembershipTool.py", line 156, in wrapUser
    u = mdtool.wrapUser(u)
  File "/home/thomas/dev/plone5.2devel/eggs/Products.PlonePAS-6.0.1-py2.7.egg/Products/PlonePAS/tools/memberdata.py", line 193, in wrapUser
    return MemberData(u, self)
  File "/home/thomas/dev/plone5.2devel/eggs/Products.PlonePAS-6.0.1-py2.7.egg/Products/PlonePAS/tools/memberdata.py", line 233, in __init__
    BaseMemberAdapter.__init__(self, user, tool)
  File "/home/thomas/dev/plone5.2devel/eggs/Products.CMFCore-2.4.0b6-py2.7.egg/Products/CMFCore/MemberDataTool.py", line 241, in __init__
    self._md = tool._members.get(id, MemberData(id))
  File "/home/thomas/dev/plone5.2devel/eggs/ZODB-5.5.1-py2.7.egg/ZODB/Connection.py", line 796, in setstate
    self._reader.setGhostState(obj, p)
  File "/home/thomas/dev/plone5.2devel/eggs/ZODB-5.5.1-py2.7.egg/ZODB/serialize.py", line 633, in setGhostState
    state = self.getState(pickle)
  File "/home/thomas/dev/plone5.2devel/eggs/ZODB-5.5.1-py2.7.egg/ZODB/serialize.py", line 626, in getState
    return unpickler.load()
  File "/home/thomas/dev/plone5.2devel/eggs/ZODB-5.5.1-py2.7.egg/ZODB/serialize.py", line 492, in _persistent_load
    return self.load_persistent(*reference)
  File "/home/thomas/dev/plone5.2devel/eggs/ZODB-5.5.1-py2.7.egg/ZODB/serialize.py", line 534, in load_persistent
    self._cache.new_ghost(oid, obj)
TypeError: Cache values must be persistent objects.

Even though the front page loads, basically all actions are screwed up by this error (creating a new Page, adding a user...)

I put a pdb here, where site.portal_memberdata._members is being handled:

File "/home/thomas/dev/plone5.2devel/eggs/ZODB-5.5.1-py2.7.egg/ZODB/Connection.py", line 796, in setstate
  self._reader.setGhostState(obj, p)

Here, in my Data.fs migrated from 5.1, p (the pickle) has this content:
'\x80\x02cBTrees.OOBTree\nOOBTree\nq\x01.\x80\x02(U\x05adminq\x02U\x08\x00\x00\x00\x00\x00\x00\x15\xa3q\x03cProducts.PlonePAS.tools.memberdata\nMemberData\nq\x04\x86QU\x08pysailorq\x05U\x08\x00\x00\x00\x00\x00\x00\x17\x87q\x06h\x04\x86Qt\x85\x85\x85q\x07.'

For comparison, I added a fresh Plone site in 5.2 directly, and added a single user (pysailor).
Again, looking at site.portal_memberdata._members in ZODB.Connection.Connection.setstate, and inpecting the pickle, I get:

'\x80\x03cBTrees.OOBTree\nOOBTree\nq\x01.\x80\x03U\x08pysailorq\x02C\x08\x00\x00\x00\x00\x00\x00/xcProducts.CMFCore.MemberDataTool\nMemberData\nq\x03\x86Q\x86\x85\x85\x85q\x04.'

I don't really understand this matter, but I see that apparently a different class is used for the MemberData.
In fact, when I manually replace "Products.PlonePAS.tools.memberdata" with "Products.CMFCore.MemberDataTool" in the "bad" pickle string above, I am able to use that with self._reader.setGhostState(obj, p).

@pbauer
Copy link
Sponsor Member

pbauer commented Feb 5, 2019

Confirmed. The reason is probably the changes made for plone/Products.PlonePAS#24 (mostly in plone/Products.PlonePAS#25)

@pysailor
Copy link
Contributor Author

pysailor commented Feb 6, 2019

I created a PR in p.a.upgrade to fix this issue.
plone/plone.app.upgrade#191

@pysailor
Copy link
Contributor Author

pysailor commented Feb 8, 2019

PR merged

@pysailor pysailor closed this as completed Feb 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants