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

Minimizing a database fails on current master #726

Closed
dwt opened this issue Nov 5, 2019 · 2 comments
Assignees
Labels
bug
Milestone

Comments

@dwt
Copy link
Contributor

@dwt dwt commented Nov 5, 2019

Hi there,

I noticed that minimize fails on the current master with this error message:

2019-11-05 11:07:59 ERROR [ZODB.Connection:787][waitress] Shouldn't load state for AccessControl.users.User 0x04 when the connection is closed
Traceback (most recent call last):
  File "/Users/dwt/.virtualenvs/tmp-274bc27ca19363/lib/python3.7/site-packages/ZODB/Connection.py", line 785, in setstate
    raise ConnectionStateError(msg)
ZODB.POSException.ConnectionStateError: Shouldn't load state for AccessControl.users.User 0x04 when the connection is closed
2019-11-05 11:07:59 ERROR [waitress:363][waitress] Exception while serving /Control_Panel/Database/main/manage_minimize
Traceback (most recent call last):
  File "/Users/dwt/.virtualenvs/tmp-274bc27ca19363/lib/python3.7/site-packages/waitress/channel.py", line 356, in service
    task.service()
  File "/Users/dwt/.virtualenvs/tmp-274bc27ca19363/lib/python3.7/site-packages/waitress/task.py", line 172, in service
    self.execute()
  File "/Users/dwt/.virtualenvs/tmp-274bc27ca19363/lib/python3.7/site-packages/waitress/task.py", line 440, in execute
    app_iter = self.channel.server.application(environ, start_response)
  File "/Users/dwt/.virtualenvs/tmp-274bc27ca19363/src/zope/src/ZPublisher/httpexceptions.py", line 30, in __call__
    return self.application(environ, start_response)
  File "/Users/dwt/.virtualenvs/tmp-274bc27ca19363/lib/python3.7/site-packages/paste/translogger.py", line 69, in __call__
    return self.application(environ, replacement_start_response)
  File "/Users/dwt/.virtualenvs/tmp-274bc27ca19363/src/zope/src/ZPublisher/WSGIPublisher.py", line 335, in publish_module
    if user is not None and user.getUserName() != 'Anonymous User':
  File "/Users/dwt/.virtualenvs/tmp-274bc27ca19363/lib/python3.7/site-packages/ZODB/Connection.py", line 785, in setstate
    raise ConnectionStateError(msg)
ZODB.POSException.ConnectionStateError: Shouldn't load state for AccessControl.users.User 0x04 when the connection is closed

To reproduce:

python3.7 -m venv tmpenv
source tmpenv/bin/activate
cd tmpenv

SWITCH=s
pip --quiet install --upgrade setuptools wheel     
pip --quiet install --upgrade pip

pip --quiet install --exists-action $SWITCH -r https://raw.githubusercontent.com/zopefoundation/Zope/master/requirements-full.txt

mkwsgiinstance -d instance -u admin:admin
runwsgi --verbose --debug instance/etc/zope.ini &
http --auth admin:admin POST http://localhost:8080/Control_Panel/Database/main/manage_minimize

The http command is is httpie from https://pypi.org/project/httpie/ use curl or the browser at will.

@dwt dwt changed the title Minimizin a database fails on current master Minimizing a database fails on current master Nov 5, 2019
@dataflake dataflake self-assigned this Nov 5, 2019
@dataflake dataflake added the bug label Nov 5, 2019
@dataflake dataflake added this to To do in Zope 4 bugfix via automation Nov 5, 2019
@dataflake dataflake added this to the 4.1.3 milestone Nov 5, 2019
@dataflake

This comment has been minimized.

Copy link
Member

@dataflake dataflake commented Nov 5, 2019

This regression happened when adding code to add the username to the access log in 24ae27b. The simple fix is to indent that code so it is within the publishing context and not outside of it.

dataflake added a commit that referenced this issue Nov 5, 2019
@dataflake dataflake closed this in b18549f Nov 5, 2019
Zope 4 bugfix automation moved this from To do to Done Nov 5, 2019
@dwt

This comment has been minimized.

Copy link
Contributor Author

@dwt dwt commented Nov 5, 2019

Thanks Jens! :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Zope 4 bugfix
  
Done
2 participants
You can’t perform that action at this time.