New user auto creation with LDAP authentication failing

Hi,

I’ve been successfully using galaxy.auth.providers.ldap_ad with auto account creation for over a year, and today it started throwing an error. There is a chance this is the first new user to log in since I upgraded to release_19.05. Here is the log output:

galaxy.auth.providers.ldap_ad DEBUG 2019-09-26 16:03:06,064 LDAP authentication successful
galaxy.auth.util DEBUG 2019-09-26 16:03:06,071 Email: someone@example.com, auto-register with username: someone
galaxy.web.framework.decorators ERROR 2019-09-26 16:03:06,097 Uncaught exception in exposed API method:
Traceback (most recent call last):
  File "/home/galaxy/galaxy-dist/lib/galaxy/web/framework/decorators.py", line 282, in decorator
    rval = func(self, trans, *args, **kwargs)
  File "/home/galaxy/galaxy-dist/lib/galaxy/webapps/galaxy/controllers/user.py", line 116, in login
    return self.__validate_login(trans, payload, **kwd)
  File "/home/galaxy/galaxy-dist/lib/galaxy/webapps/galaxy/controllers/user.py", line 137, in __validate_login
    message, user = self.__autoregistration(trans, login, password)
  File "/home/galaxy/galaxy-dist/lib/galaxy/webapps/galaxy/controllers/user.py", line 93, in __autoregistration
    user = self.user_manager.create(email=email, username=username, password="")
  File "/home/galaxy/galaxy-dist/lib/galaxy/managers/users.py", line 99, in create
    self.session().flush()
  File "/home/galaxy/galaxy-dist/.venv/local/lib/python2.7/site-packages/sqlalchemy/orm/scoping.py", line 162, in do
    return getattr(self.registry(), name)(*args, **kwargs)
  File "/home/galaxy/galaxy-dist/.venv/local/lib/python2.7/site-packages/sqlalchemy/orm/session.py", line 2446, in flush
    self._flush(objects)
  File "/home/galaxy/galaxy-dist/.venv/local/lib/python2.7/site-packages/sqlalchemy/orm/session.py", line 2584, in _flush
    transaction.rollback(_capture_exception=True)
  File "/home/galaxy/galaxy-dist/.venv/local/lib/python2.7/site-packages/sqlalchemy/util/langhelpers.py", line 67, in __exit__
    compat.reraise(exc_type, exc_value, exc_tb)
  File "/home/galaxy/galaxy-dist/.venv/local/lib/python2.7/site-packages/sqlalchemy/orm/session.py", line 2544, in _flush
    flush_context.execute()
  File "/home/galaxy/galaxy-dist/.venv/local/lib/python2.7/site-packages/sqlalchemy/orm/unitofwork.py", line 416, in execute
    rec.execute(self)
  File "/home/galaxy/galaxy-dist/.venv/local/lib/python2.7/site-packages/sqlalchemy/orm/unitofwork.py", line 583, in execute
    uow,
  File "/home/galaxy/galaxy-dist/.venv/local/lib/python2.7/site-packages/sqlalchemy/orm/persistence.py", line 245, in save_obj
    insert,
  File "/home/galaxy/galaxy-dist/.venv/local/lib/python2.7/site-packages/sqlalchemy/orm/persistence.py", line 1116, in _emit_insert_statements
    statement, params
  File "/home/galaxy/galaxy-dist/.venv/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 980, in execute
    return meth(self, multiparams, params)
  File "/home/galaxy/galaxy-dist/.venv/local/lib/python2.7/site-packages/sqlalchemy/sql/elements.py", line 273, in _execute_on_connection
    return connection._execute_clauseelement(self, multiparams, params)
  File "/home/galaxy/galaxy-dist/.venv/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1099, in _execute_clauseelement
    distilled_params,
  File "/home/galaxy/galaxy-dist/.venv/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1174, in _execute_context
    e, util.text_type(statement), parameters, None, None
  File "/home/galaxy/galaxy-dist/.venv/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1458, in _handle_dbapi_exception
    util.raise_from_cause(sqlalchemy_exception, exc_info)
  File "/home/galaxy/galaxy-dist/.venv/local/lib/python2.7/site-packages/sqlalchemy/util/compat.py", line 296, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb, cause=cause)
  File "/home/galaxy/galaxy-dist/.venv/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1171, in _execute_context
    context = constructor(dialect, self, conn, *args)
  File "/home/galaxy/galaxy-dist/.venv/local/lib/python2.7/site-packages/sqlalchemy/engine/default.py", line 719, in _init_compiled
    for key in compiled_params
  File "/home/galaxy/galaxy-dist/.venv/local/lib/python2.7/site-packages/sqlalchemy/engine/default.py", line 719, in <genexpr>
    for key in compiled_params
  File "/home/galaxy/galaxy-dist/.venv/local/lib/python2.7/site-packages/sqlalchemy/sql/type_api.py", line 1194, in process
    return process_param(value, dialect)
  File "/home/galaxy/galaxy-dist/lib/galaxy/model/custom_types.py", line 373, in process_bind_param
    value = value[0:self.impl.length]
StatementError: (exceptions.TypeError) '_hashlib.HASH' object has no attribute '__getitem__' [SQL: u'INSERT INTO galaxy_user (create_time, update_time, email, username, password, last_password_change, external, form_values_id, deleted, purged, disk_usage, active, activation_token) VALUES (%(create_time)s, %(update_time)s, %(email)s, %(username)s, %(password)s, %(last_password_change)s, %(external)s, %(form_values_id)s, %(deleted)s, %(purged)s, %(disk_usage)s, %(active)s, %(activation_token)s) RETURNING galaxy_user.id'] [parameters: [{'username': 'someone', 'disk_usage': None, 'form_values_id': None, 'deleted': False, 'email': 'someone@example.com', 'last_password_change': datetime.datetime(2019, 9, 26, 16, 3, 6, 92741), 'external': False, 'active': True, 'password': <sha1 HASH object @ 0x7f9950dda620>, 'purged': False, 'activation_token': None}]]

Please let me know if you know what broke. I checked the github issue tracker but didn’t see anything that seemed related.

thanks,
-Will

1 Like

Welcome @wholtz

I’ve pinged the developers at Gitter to see if anyone recognizes the issue. Please feel free to chat there, too. https://gitter.im/galaxyproject/Lobby?at=5d9382df47de0a719d445dbe

I also found a similar error message reported yesterday:

object has no attribute ‘getitem

BUT with respect to a completely different use case. No idea if related. There will be feedback there as well: Cannot name datasets by a number · Issue #8680 · galaxyproject/galaxy · GitHub.

If there is no actionable feedback after a few more days, then this should be reported as a new issue at GitHub - galaxyproject/galaxy: Data intensive science for everyone.. Be clear and include as many details as you can, including what you posted above. You might also want to cross-link the two (put the Galaxy help link in the Github issue ticket, and then post that Github ticket back here. That way if others run into this issue, or a similar issue, now or later, all will be connected.

Thanks!

admin edit: correction Galaxy releases all support Python 2, as will the upcoming 19.09 release. Python 3 is not recommended quite yet.

Hi Will,
I think I have a hunch. Are you using use_pbkdf2: false in config/galaxy.yml ?

1 Like

Hi @nsoranzo,

Yes, I did have use_pbkdf2: false and removing this setting did allow autoregistration to start working again. Given how disconnected autoregistration is from FTP server encryption settings, I’m quite impressed with your ability to nail this on your first attempt!

I’m no longer making use of the FTP server functionality, so my issue is resolved.

thanks much!

-Will

1 Like

@wholtz Thanks for the compliment, your report and the traceback were very helpful in tracking the issue down. It should be fixed by https://github.com/galaxyproject/galaxy/pull/8739 , let us know if you want to have this backported to 19.05.

1 Like