-
Notifications
You must be signed in to change notification settings - Fork 106
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
Fix AttributeError and HTTP Configuration for Fedora Login Authentication #1725
Conversation
…or resolving server errors during login Added New file Auth_ERROR-README.md with the description on how to fix this error
Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci ✔️ fi-tox-mypy SUCCESS in 6m 38s |
…or resolving server errors during login Added New file Auth_ERROR-README.md with the description on how to fix this error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at the guide it would be better to fix the issue itself than adding a workaround documentation. I will look at the social_sqlalchemy
issue and try to fix that.
Also the documentation is in https://github.com/fedora-infra/anitya/tree/master/docs, adding new README will be just confusing.
server_change.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change shouldn't be done here, but better here, as we only want dev environment to run as HTTP not anything else.
Auth_ERROR_README.md
Outdated
### Solution | ||
To resolve the AttributeError, replace `encodestring` with `encodebytes` in the affected file (`storage.py` within the `social_sqlalchemy` package). To resolve the server errors when logging in, change the Flask application configuration to run over HTTP instead of HTTPS. | ||
|
||
### Steps to Resolve |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like the issue is with old social_sqlalchemy
dependency. I will look into that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would recommend to remove this file altogether and I need to fix the dev environment as I wasn't aware that there are issues.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I just removed them
Build succeeded. ✔️ fi-tox-mypy SUCCESS in 5m 44s |
I think we can close it as there are no files added, but you can write your solution to issue you created so it's documented. |
Description:
Changes Made:
base64.encodestring
withbase64.encodebytes
to resolve theAttributeError
encountered during authentication with Fedora login in the Flask application.Details:
Replacement of
encodestring
:The
AttributeError
was raised due to the usage of the deprecatedencodestring
attribute of thebase64
module. In Python 3,encodestring
has been deprecated and replaced withencodebytes
. This change ensures compatibility with Python 3 and resolves the error.HTTP Configuration Update:
The Flask application was configured to run over HTTPS by default, causing server errors when logging in due to mismatched protocols. To address this issue, the
SERVER_NAME
configuration variable in thewsgi.py
file was modified to use HTTP instead of HTTPS.Steps Taken:
AttributeError
(storage.py
within thesocial_sqlalchemy
package).storage.py
file in a text editor.base64.encodestring
withbase64.encodebytes
.wsgi.py
file to set theSERVER_NAME
configuration variable to use HTTP (http://localhost:5000
).Additionally I have created a file named Auth_ERROR_README.md where you can see full steps to resolve this