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

Don't use session storage anymore - does not work with plone 5 for anonymous users #60

Merged
merged 1 commit into from Feb 3, 2020

Conversation

@maethu
Copy link
Member

maethu commented Feb 3, 2020

This fixes the following error:

POSKeyError: 0x09
  File "ZPublisher/Publish.py", line 138, in publish
    request, bind=1)
  File "ZPublisher/mapply.py", line 77, in mapply
    if debug is not None: return debug(object,args,context)
  File "ZPublisher/Publish.py", line 48, in call_object
    result=apply(object,args) # Type s<cr> to step into published object.
  File "home/zope/eggs/ftw.pdfgenerator-1.6.6-py2.7.egg/ftw/pdfgenerator/browser/views.py", line 17, in __call__
    if self.allow_alternate_output():
  File "home/zope/eggs/ftw.pdfgenerator-1.6.6-py2.7.egg/ftw/pdfgenerator/browser/views.py", line 34, in allow_alternate_output
    elif self.request.SESSION.get(DEBUG_MODE_SESSION_KEY, False):
  File "ZPublisher/HTTPRequest.py", line 1380, in __getattr__
    v = self.get(key, default, returnTaints=returnTaints)
  File "ZPublisher/HTTPRequest.py", line 1337, in get
    v = v()
  File "home/zope/eggs/Zope2-2.13.29-py2.7.egg/Products/Sessions/SessionDataManager.py", line 101, in getSessionData
    return self._getSessionDataObject(key)
  File "home/zope/eggs/Zope2-2.13.29-py2.7.egg/Products/Sessions/SessionDataManager.py", line 188, in _getSessionDataObject
    ob = container.new_or_existing(key)
  File "home/zope/eggs/Zope2-2.13.29-py2.7.egg/Products/Transience/Transience.py", line 839, in new_or_existing
    item = self.get(key, _marker)
  File "home/zope/eggs/Zope2-2.13.29-py2.7.egg/Products/Transience/Transience.py", line 495, in get
    item = self._move_item(k, current_ts, default)
  File "home/zope/eggs/Zope2-2.13.29-py2.7.egg/Products/Transience/Transience.py", line 285, in _move_item
    self._housekeep(current_ts)
  File "home/zope/eggs/Zope2-2.13.29-py2.7.egg/Products/Transience/Transience.py", line 934, in _housekeep
    self._finalize(now)
  File "home/zope/eggs/Zope2-2.13.29-py2.7.egg/Products/Transience/Transience.py", line 551, in _finalize
    last_finalized = self._last_finalized_timeslice()
  File "home/zope/eggs/Zope2-2.13.29-py2.7.egg/Products/Transience/Transience.py", line 1071, in __call__
    return self.value
  File "ZODB/Connection.py", line 796, in setstate
    p, serial = self._storage.load(oid)
  File "ZODB/mvccadapter.py", line 143, in load
    r = self._storage.loadBefore(oid, self._start)
  File "tempstorage/TemporaryStorage.py", line 187, in loadBefore
    raise POSException.POSKeyError(oid)

For more infos: see https://community.plone.org/t/sessions-and-poskeyerrors/5939/19
They recommend to use something else, like cookie storage.

@maethu maethu requested a review from jone Feb 3, 2020
@maethu maethu force-pushed the mle-fix-anon-export branch from afdad67 to 026e036 Feb 3, 2020
@maethu

This comment has been minimized.

Copy link
Member Author

maethu commented Feb 3, 2020

@jone I extended the mock tests a bit, even-thought in realty those tests would all fail in plone 5, due the broken session storage.

@maethu maethu force-pushed the mle-fix-anon-export branch from 026e036 to f7dfc12 Feb 3, 2020
@jone
jone approved these changes Feb 3, 2020
@maethu maethu merged commit b42c2fc into master Feb 3, 2020
2 checks passed
2 checks passed
CI Governor: test-plone-4.3.x.cfg Task #506186 succeeded
Details
CI Governor: test-plone-5.1.x.cfg Task #506187 succeeded
Details
@maethu maethu deleted the mle-fix-anon-export branch Feb 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.