Unverified Commit 362bf76a authored by mvdbeek's avatar mvdbeek
Browse files

Load data tables in Celery worker

This is needed so that data bundle imports will work.
The test case covering this will just receive the full integration app
and thus didn't have this problem.
Should fix:
```
[2023-06-13 21:33:38,899: ERROR/main] Task galaxy.import_data_bundle[0853f72f-c8ce-4e59-b6e8-25e208ce79f7] raised unexpected: AttributeError("'GalaxyManagerApplication' object has no attribute 'tool_data_tables'")
Traceback (most recent call last):
  File "/cvmfs/main.galaxyproject.org/venv/lib/python3.8/site-packages/celery/app/trace.py", line 451, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/cvmfs/main.galaxyproject.org/venv/lib/python3.8/site-packages/celery/app/trace.py", line 734, in __protected_call__
    return self.run(*args, **kwargs)
  File "/cvmfs/main.galaxyproject.org/galaxy/lib/galaxy/celery/__init__.py", line 163, in wrapper
    rval = app.magic_partial(func)(*args, **kwds)
  File "/cvmfs/main.galaxyproject.org/venv/lib/python3.8/site-packages/lagom/wrapping.py", line 27, in _bound_func
    bound_args, bound_kwargs = argument_updater(args, kwargs)
  File "lagom/container.py", line 350, in _update_args
  File "lagom/container.py", line 425, in _infer_dependencies
  File "lagom/container.py", line 265, in resolve
  File "lagom/container.py", line 392, in _reflection_build_with_err_handling
  File "lagom/container.py", line 408, in _reflection_build
  File "/cvmfs/main.galaxyproject.org/galaxy/lib/galaxy/managers/tool_data.py", line 114, in __init__
    self.tool_data_tables = app.tool_data_tables
AttributeError: 'GalaxyManagerApplication' object has no attribute 'tool_data_tables'
```
parent 8d1f9f8a
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -576,6 +576,8 @@ class GalaxyManagerApplication(MinimalManagerApp, MinimalGalaxyApplication):

        self._configure_tool_shed_registry()
        self._register_singleton(tool_shed_registry.Registry, self.tool_shed_registry)
        # Tool Data Tables
        self._configure_tool_data_tables(from_shed_config=False)

    def _configure_tool_shed_registry(self) -> None:
        # Set up the tool sheds registry
@@ -628,8 +630,6 @@ class UniverseApplication(StructuredApp, GalaxyManagerApplication):
        )
        self.api_keys_manager = self._register_singleton(ApiKeyManager)

        # Tool Data Tables
        self._configure_tool_data_tables(from_shed_config=False)
        # Load dbkey / genome build manager
        self._configure_genome_builds(data_table_name="__dbkeys__", load_old_style=True)