I'm testing the use of ephemeris inside ansible-galaxy-extras in the context of the compose docker containers, using the user created in Galaxy through:
bioblend.ConnectionError: Unexpected HTTP status code: 500: {"err_msg": "Uncaught exception in exposed API method:", "err_code": 0}
galaxy.web.framework.decorators ERROR 2018-02-05 21:08:07,654 Uncaught exception in exposed API method:
Traceback (most recent call last):
File "lib/galaxy/web/framework/decorators.py", line 281, in decorator
rval = func(self, trans, *args, **kwargs)
File "lib/galaxy/webapps/galaxy/api/workflows.py", line 411, in import_new_workflow_deprecated
return self.__api_import_new_workflow(trans, payload, **kwd)
File "lib/galaxy/webapps/galaxy/api/workflows.py", line 535, in __api_import_new_workflow
workflow, missing_tool_tups = self._workflow_from_dict(trans, data, **from_dict_kwds)
File "lib/galaxy/web/base/controller.py", line 1266, in _workflow_from_dict
exact_tools=exact_tools,
File "lib/galaxy/managers/workflows.py", line 235, in build_workflow_from_dict
trans.app.tag_handler.set_tags_from_list(user=trans.user, item=stored, new_tags_list=workflow_tags)
File "lib/galaxy/managers/tags.py", line 60, in set_tags_from_list
self.sa_session.flush()
File "/export/venv/local/lib/python2.7/site-packages/sqlalchemy/orm/scoping.py", line 157, in do
return getattr(self.registry(), name)(*args, **kwargs)
File "/export/venv/local/lib/python2.7/site-packages/sqlalchemy/orm/session.py", line 2019, in flush
self._flush(objects)
File "/export/venv/local/lib/python2.7/site-packages/sqlalchemy/orm/session.py", line 2137, in _flush
transaction.rollback(_capture_exception=True)
File "/export/venv/local/lib/python2.7/site-packages/sqlalchemy/util/langhelpers.py", line 60, in __exit__
compat.reraise(exc_type, exc_value, exc_tb)
File "/export/venv/local/lib/python2.7/site-packages/sqlalchemy/orm/session.py", line 2101, in _flush
flush_context.execute()
File "/export/venv/local/lib/python2.7/site-packages/sqlalchemy/orm/unitofwork.py", line 373, in execute
rec.execute(self)
File "/export/venv/local/lib/python2.7/site-packages/sqlalchemy/orm/unitofwork.py", line 532, in execute
uow
File "/export/venv/local/lib/python2.7/site-packages/sqlalchemy/orm/persistence.py", line 174, in save_obj
mapper, table, insert)
File "/export/venv/local/lib/python2.7/site-packages/sqlalchemy/orm/persistence.py", line 800, in _emit_insert_statements
execute(statement, params)
File "/export/venv/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 914, in execute
return meth(self, multiparams, params)
File "/export/venv/local/lib/python2.7/site-packages/sqlalchemy/sql/elements.py", line 323, in _execute_on_connection
return connection._execute_clauseelement(self, multiparams, params)
File "/export/venv/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1010, in _execute_clauseelement
compiled_sql, distilled_params
File "/export/venv/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1146, in _execute_context
context)
File "/export/venv/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1341, in _handle_dbapi_exception
exc_info
File "/export/venv/local/lib/python2.7/site-packages/sqlalchemy/util/compat.py", line 202, in raise_from_cause
reraise(type(exception), exception, tb=exc_tb, cause=cause)
File "/export/venv/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1139, in _execute_context
context)
File "/export/venv/local/lib/python2.7/site-packages/sqlalchemy/engine/default.py", line 450, in do_execute
cursor.execute(statement, parameters)
IntegrityError: (psycopg2.IntegrityError) null value in column "user_id" violates not-null constraint
DETAIL: Failing row contains (21, 2018-02-05 21:08:07.648718, 2018-02-05 21:08:07.648727, null, null, Fluxomics stationary 13C-MS iso2flux with visualization, f, f, null, t).
[SQL: 'INSERT INTO stored_workflow (create_time, update_time, user_id, latest_workflow_id, name, deleted, importable, slug, published) VALUES (%(create_time)s, %(update_time)s, %(user_id)s, %(latest_workflow_id)s, %(name)s, %(deleted)s, %(importable)s, %(slug)s, %(published)s) RETURNING stored_workflow.id'] [parameters: {'update_time': datetime.datetime(2018, 2, 5, 21, 8, 7, 648727), 'user_id': None, 'importable': False, 'latest_workflow_id': None, 'deleted': False, 'create_time': datetime.datetime(2018, 2, 5, 21, 8, 7, 648718), 'published': True, 'slug': None, 'name': u'Fluxomics stationary 13C-MS iso2flux with visualization'}]
However, if you create another user manually on the Galaxy UI, and execute the same command with this second user, the command goes through and, in this case, workflows get imported.
On a different container, we use the master API key to create the admin user through Bioblend, and then we make very similar API calls to create workflows, which go without trouble (as in the case of the second user here). Any ideas? I realise that this is not purely an ansible-galaxy-extras issues of course. Should we aim to change the method used on /usr/local/bin/create_galaxy_user.py
so that is not directly interacting with the database bypassing galaxy? or is there any programatic call that could somehow "rescue" the database-created user so that it works with the API calls mentioned?... or is it completely unrelated?