usegalaxy-eu / galaxy

Data intensive science for everyone.
https://galaxyproject.org/
Other
2 stars 11 forks source link

LSLOGIN with the registered email address result in creation of a new account #232

Closed dyusuf closed 5 months ago

dyusuf commented 5 months ago

Describe the bug

I encountered an issue today while attempting to log in to my Galaxy account. My usual password wasn't working, so I tried using the LSLOGIN with the email address associated with my Galaxy server account. However, instead of logging into my existing Galaxy account, a new account was created using the same email address.

Galaxy Version and/or server at which you observed the bug Galaxy Version: {"version_major":"24.0","version_minor":"rc1"}

To Reproduce Steps to reproduce the behavior:

  1. Go to 'https://usegalaxy.eu/login/start?redirect=None'
  2. Click on 'LSLOGIN'
  3. follow the subsequent steps with an email address registered on the Galaxy server
  4. A new account is created with the existing email address

Expected behavior Using the LSLOGIN command with my registered email address should have logged me into my existing Galaxy account.

bgruening commented 5 months ago

Impersonating the user yields this error:


Mar 26 22:02:51 sn06.galaxyproject.eu gunicorn[1674243]: galaxy.webapps.galaxy.controllers.admin ERROR 2024-03-26 22:02:51,067 [pN:main.4,p:1806988,tN:WSGI_5] Error fetching user for impersonation
Mar 26 22:02:51 sn06.galaxyproject.eu gunicorn[1674243]: Traceback (most recent call last):
Mar 26 22:02:51 sn06.galaxyproject.eu gunicorn[1674243]:   File "/opt/galaxy/server/lib/galaxy/webapps/galaxy/controllers/admin.py", line 632, in impersonate
Mar 26 22:02:51 sn06.galaxyproject.eu gunicorn[1674243]:     trans.handle_user_login(user)
Mar 26 22:02:51 sn06.galaxyproject.eu gunicorn[1674243]:   File "/opt/galaxy/server/lib/galaxy/webapps/base/webapp.py", line 841, in handle_user_login
Mar 26 22:02:51 sn06.galaxyproject.eu gunicorn[1674243]:     self.app.security_agent.create_user_role(user, self.app)
Mar 26 22:02:51 sn06.galaxyproject.eu gunicorn[1674243]:   File "/opt/galaxy/server/lib/galaxy/model/security.py", line 754, in create_user_role
Mar 26 22:02:51 sn06.galaxyproject.eu gunicorn[1674243]:     self.get_private_user_role(user, auto_create=True)
Mar 26 22:02:51 sn06.galaxyproject.eu gunicorn[1674243]:   File "/opt/galaxy/server/lib/galaxy/model/security.py", line 775, in get_private_user_role
Mar 26 22:02:51 sn06.galaxyproject.eu gunicorn[1674243]:     role = self.sa_session.execute(stmt).scalar_one_or_none()
Mar 26 22:02:51 sn06.galaxyproject.eu gunicorn[1674243]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Mar 26 22:02:51 sn06.galaxyproject.eu gunicorn[1674243]:   File "/opt/galaxy/venv/lib/python3.11/site-packages/sqlalchemy/engine/result.py", line 1225, in scalar_one_or_none
Mar 26 22:02:51 sn06.galaxyproject.eu gunicorn[1674243]:     return self._only_one_row(
Mar 26 22:02:51 sn06.galaxyproject.eu gunicorn[1674243]:            ^^^^^^^^^^^^^^^^^^^
Mar 26 22:02:51 sn06.galaxyproject.eu gunicorn[1674243]:   File "/opt/galaxy/venv/lib/python3.11/site-packages/sqlalchemy/engine/result.py", line 614, in _only_one_row
Mar 26 22:02:51 sn06.galaxyproject.eu gunicorn[1674243]:     raise exc.MultipleResultsFound(
Mar 26 22:02:51 sn06.galaxyproject.eu gunicorn[1674243]: sqlalchemy.exc.MultipleResultsFound: Multiple rows were found when one or none was required
bgruening commented 5 months ago

Looking at the DB I only can see one user with a query like select * from galaxy_user where email='foobar@uni-freiburg.de';

davelopez commented 5 months ago

Looking at the DB I only can see one user with a query like select * from galaxy_user where email='foobar@uni-freiburg.de';

The duplication might not be in the galaxy_user table but in the roles table, in the log above it seems to find 2 roles when calling get_private_user_role:

Mar 26 22:02:51 sn06.galaxyproject.eu gunicorn[1674243]:     self.app.security_agent.create_user_role(user, self.app)
Mar 26 22:02:51 sn06.galaxyproject.eu gunicorn[1674243]:   File "/opt/galaxy/server/lib/galaxy/model/security.py", line 754, in create_user_role
Mar 26 22:02:51 sn06.galaxyproject.eu gunicorn[1674243]:     self.get_private_user_role(user, auto_create=True)
Mar 26 22:02:51 sn06.galaxyproject.eu gunicorn[1674243]:   File "/opt/galaxy/server/lib/galaxy/model/security.py", line 775, in get_private_user_role
Mar 26 22:02:51 sn06.galaxyproject.eu gunicorn[1674243]:     role = self.sa_session.execute(stmt).scalar_one_or_none()
Mar 26 22:02:51 sn06.galaxyproject.eu gunicorn[1674243]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
sanjaysrikakulam commented 5 months ago

@dyusuf, we have created an issue in the upstream. Hopefully, we will be able to resolve your issue soon.

sanjaysrikakulam commented 5 months ago

@dyusuf, please try to reset your password and log in.

dyusuf commented 5 months ago

yes it works now. thank you.