#3491 Local auth password login fails with a traceback on Python 3 (Pagure git e2c4680b)
Closed: Fixed 5 years ago Opened 5 years ago by ngompa.

When using Pagure git master (e2c4680) on Python 3, I can set up an instance and create a user, but logging in with that user fails with the error "username or password of invalid format".

In the Apache httpd error logs, this is what I see:

[Sun Aug 05 11:12:59.924849 2018] [wsgi:error] [pid 8479] [remote 127.0.0.1:48458] 2018-08-05 11:12:59,922 [ERROR] pagure.ui.login: Password of unknown version found in the database
[Sun Aug 05 11:12:59.924904 2018] [wsgi:error] [pid 8479] [remote 127.0.0.1:48458] Traceback (most recent call last):
[Sun Aug 05 11:12:59.924916 2018] [wsgi:error] [pid 8479] [remote 127.0.0.1:48458]   File "/usr/lib/python3.6/site-packages/pagure/ui/login.py", line 107, in do_login
[Sun Aug 05 11:12:59.924921 2018] [wsgi:error] [pid 8479] [remote 127.0.0.1:48458]     seed=pagure.config.config.get('PASSWORD_SEED', None))
[Sun Aug 05 11:12:59.924925 2018] [wsgi:error] [pid 8479] [remote 127.0.0.1:48458]   File "/usr/lib/python3.6/site-packages/pagure/lib/login.py", line 85, in check_password
[Sun Aug 05 11:12:59.924929 2018] [wsgi:error] [pid 8479] [remote 127.0.0.1:48458]     'Password of unknown version found in the database'
[Sun Aug 05 11:12:59.924936 2018] [wsgi:error] [pid 8479] [remote 127.0.0.1:48458] pagure.exceptions.PagureException: Password of unknown version found in the database
[Sun Aug 05 11:12:59.924947 2018] [wsgi:error] [pid 8479] [remote 127.0.0.1:48458] 
[Sun Aug 05 11:12:59.924988 2018] [wsgi:error] [pid 8479] [remote 127.0.0.1:48458] 2018-08-05 11:12:59,922 [ERROR] pagure.ui.login: Password of unknown version found in the database
[Sun Aug 05 11:12:59.925000 2018] [wsgi:error] [pid 8479] [remote 127.0.0.1:48458] Traceback (most recent call last):
[Sun Aug 05 11:12:59.925005 2018] [wsgi:error] [pid 8479] [remote 127.0.0.1:48458]   File "/usr/lib/python3.6/site-packages/pagure/ui/login.py", line 107, in do_login
[Sun Aug 05 11:12:59.925009 2018] [wsgi:error] [pid 8479] [remote 127.0.0.1:48458]     seed=pagure.config.config.get('PASSWORD_SEED', None))
[Sun Aug 05 11:12:59.925013 2018] [wsgi:error] [pid 8479] [remote 127.0.0.1:48458]   File "/usr/lib/python3.6/site-packages/pagure/lib/login.py", line 85, in check_password
[Sun Aug 05 11:12:59.925017 2018] [wsgi:error] [pid 8479] [remote 127.0.0.1:48458]     'Password of unknown version found in the database'
[Sun Aug 05 11:12:59.925022 2018] [wsgi:error] [pid 8479] [remote 127.0.0.1:48458] pagure.exceptions.PagureException: Password of unknown version found in the database
[Sun Aug 05 11:12:59.925028 2018] [wsgi:error] [pid 8479] [remote 127.0.0.1:48458] 

This is with openSUSE Leap 15.0 set up with Pagure on Python 3.6 with local auth.


I have no idea what PASSWORD_SEED is (as it's not documented and only appears to be referenced in this file), but when I create a pagure instance of the same code with Python 2, everything works...

PASSWORD_SEED is no longer used anywhere but in a piece of code kept for backward compability. Basically it was a seed added to the password when where were using sha512 instead of bcrypt to encrypt the password.

The issue is more in the fact that it seems that the password store does not contain the version information we want.

Metadata Update from @pingou:
- Issue tagged with: bug

5 years ago

Is this a fresh installation or you have some data in your database?

This is a fresh install.

If anyone wants to reproduce my setup, only the following is required:

  1. Set up openSUSE Leap 15.0 in a VM
  2. sudo zypper refresh && sudo zypper install git-core
  3. git clone https://pagure.io/pagure-setup-scripts.git
  4. cd pagure-setup-scripts; chmod +x pagure-quick-localinstall.sh
  5. sudo USE_PAGURE_GIT=1 USE_PYTHON3=1 ./pagure-quick-localinstall.sh

After that runs, you'll have an instance running on localhost.localdomain. Create a user through the web interface, and then access the PostgreSQL database to get the token to confirm the user. Confirm the user and try to login. That will fail with the error noted in the original post.

hm, I've just tried to replicate this locally.

I used a brand new sqlite database, created a new user, went into the db to get the confirmation token, I could confirm the user and log into pagure just fine (all this running the app via python3 runserver.py -c config.

Did you try this on a Fedora host (not sure what that would change but...)

Did you try this on a Fedora host (not sure what that would change but...)

I have not tried this on Fedora. I also haven't used SQLite at all. I'm using PostgreSQL.

Ok, I can reproduce with postgresql, looking into it

Metadata Update from @pingou:
- Issue assigned to pingou

5 years ago

Login to comment on this ticket.

Metadata
Related Pull Requests
  • #3517 Merged 5 years ago