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
'_Globals' has no attribute 'user' : exception when using an IAuthenticator on CKAN 2.8.0 #4247
Comments
'_Globals' has no attribute 'user'
exception when using an IAuthenticator on CKAN 2.8.0Turns out this is documented in ckan/ckan#4247. As of CKAN 2.8.0 `views/__init__.py` line 101 throws an error that isn't caught (`AttributeError: '_Globals' object has no attribute 'user'`). Setting c.user sets g and c user to None which prevents the error from being raised. 2.7.3 didn't have this issue.
For the record, issue also occurs with ckanext-saml2 extension. |
[#4247] Allow extensions not to set a c.user (regression fix)
[ckan#4247] Allow extensions not to set a c.user (regression fix)
I propose to reopen this bug. I still have the very same error, but with a bit different Traceback.
|
Adding this code at the beginning of
|
I'm putting together a new deployment based on the new CKAN v2.8.0 release. I'm using ckanext-ldap as an authenticator, though it looks like this bug would apply to any authenticator plugin.
This exact setup worked fine on CKAN v2.7.3.
CKAN Version if known (or site URL)
CKAN v 2.8.0
ckanext-ldap @
ckan-upgrade-2.8.0a
Please describe the expected behaviour
If the IAuthenticator plugin cannot authenticate the user, it does not set
g.user
, and CKAN should run the default authenticator.Please describe the actual behaviour
If the IAuthenticator plugin cannot authenticate the user, it does not set
g.user
, and CKAN tries to lookupg.user
and crashes with traceback:What steps can be taken to reproduce the issue?
g.user
.What is odd is that this section of code at
identify_user
inckan/views/__init__.py
has not changed between v2.7.3 and v2.8.0. And the way the authenticator plugin handles/setsg.user
has not changed either. I'm guessing this is caused by a change in the way the _Globals object behaves when it cannot find an attribute.The text was updated successfully, but these errors were encountered: