galaxyproject / galaxy

Data intensive science for everyone.
https://galaxyproject.org
Other
1.37k stars 992 forks source link

[20.05] Error in 'Manual Data Manager' hook 'exec_before_job' #10023

Closed abretaud closed 2 years ago

abretaud commented 4 years ago

Hi, Found an error with latest data_manager_manual and galaxy 20.05 while testing biomaj2galaxy with 20.05:

galaxy.jobs.runners ERROR 2020-07-22 15:15:32,060 (1) Failure preparing job
Traceback (most recent call last):
  File "/galaxy-central/lib/galaxy/jobs/runners/__init__.py", line 236, in prepare_job
    job_wrapper.prepare()
  File "/galaxy-central/lib/galaxy/jobs/__init__.py", line 1096, in prepare
    tool_evaluator.set_compute_environment(compute_environment, get_special=get_special)
  File "/galaxy-central/lib/galaxy/tools/evaluation.py", line 119, in set_compute_environment
    out_data=out_data, tool=self.tool, param_dict=incoming)
  File "/galaxy-central/lib/galaxy/tools/__init__.py", line 1838, in call_hook
    return code(*args, **kwargs)
  File "/galaxy-central/database/shed_tools/toolshed.g2.bx.psu.edu/repos/iuc/data_manager_manual/0bed5ee5b74a/data_manager_manual/data_manager/data_manager_manual.py", line 61, in exec_before_job
    target_dir, tool_path, relative_target_dir = tdtm.get_target_install_dir(tool_shed_repository)
  File "/galaxy-central/lib/galaxy/tool_shed/tools/data_table_manager.py", line 112, in get_target_install_dir
    tool_path, relative_target_dir = tool_shed_repository.get_tool_relative_path(self.app)
  File "/galaxy-central/lib/galaxy/model/tool_shed_install/__init__.py", line 103, in get_tool_relative_path
    shed_conf_dict = self.get_shed_config_dict(app)
  File "/galaxy-central/lib/galaxy/model/tool_shed_install/__init__.py", line 95, in get_shed_config_dict
    if self.shed_config_filename:
  File "/galaxy-central/lib/galaxy/model/tool_shed_install/__init__.py", line 84, in shed_config_filename
    return self.metadata.get('shed_config_filename')
  File "/galaxy_venv/lib/python3.7/site-packages/sqlalchemy/orm/attributes.py", line 286, in __get__
    return self.impl.get(instance_state(instance), dict_)
  File "/galaxy_venv/lib/python3.7/site-packages/sqlalchemy/orm/attributes.py", line 720, in get
    value = callable_(state, passive)
  File "/galaxy_venv/lib/python3.7/site-packages/sqlalchemy/orm/strategies.py", line 439, in __call__
    return strategy._load_for_state(state, passive)
  File "/galaxy_venv/lib/python3.7/site-packages/sqlalchemy/orm/strategies.py", line 412, in _load_for_state
    % (orm_util.state_str(state), self.key)
sqlalchemy.orm.exc.DetachedInstanceError: Error in 'Manual Data Manager' hook 'exec_before_job', original message: Parent instance <ToolShedRepository at 0x7fb5b70a2c88> is not bound to a Session; deferred load operation of attribute 'metadata' cannot proceed (Background on this error at: http://sqlalche.me/e/bhk3)

I guess Galaxy has problems executing this code: https://github.com/galaxyproject/tools-iuc/blob/master/data_managers/data_manager_manual/data_manager/data_manager_manual.py#L35 Any idea if it's a data_manager_manual or galaxy problem?

nsoranzo commented 4 years ago

@mvdbeek I think you solved a similar issue somewhere else? E.g. https://github.com/galaxyproject/galaxy/pull/8933

abretaud commented 3 years ago

I just stumble upon this again, any clue on where it could come from?

mvdbeek commented 2 years ago

I think we've fixed this for good in https://github.com/galaxyproject/galaxy/pull/12390, which will be part of 21.09. I'm gonna close this but feel free to open again if you see this after updating to 21.09.