Hi! I’ve been trying out dagster-celery for our da...
# announcements
o
Hi! I’ve been trying out dagster-celery for our data processing pipelines, and the official example , but once I’ve installed
simplejson
, the celery worker fails, and I can’t seem to be able to extract meaningful information from the trace. It reproduces on several (MacOS Catalina) machines with both python 3.8 and 3.6, and having only dagster, dagster-celery, dagit and simplejson installed. I couldn’t find any reference online, so I suspect it isn’t a known issue - is it? I think it has to do with some config ser/de being miswritten/read by the worker - I’ll really appreciate your input. Here’s the worker trace:
Copy code
[2020-07-22 17:36:50,361: INFO/MainProcess] Received task: execute_plan[a833e3b9-3e70-4733-bc44-07b2eb611f2c]
[2020-07-22 17:36:50,425: ERROR/ForkPoolWorker-2] Task execute_plan[a833e3b9-3e70-4733-bc44-07b2eb611f2c] raised unexpected: CheckError("Failure condition: Couldn't import module module_name when attempting to rehydrate the configurable class module_name.class_name")
Traceback (most recent call last):
  File "/private/tmp/venv/lib/python3.8/site-packages/dagster/serdes/__init__.py", line 343, in rehydrate
    module = importlib.import_module(self.module_name)
  File "/Users/ofer/.pyenv/versions/3.8.3/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'module_name'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/private/tmp/venv/lib/python3.8/site-packages/celery/app/trace.py", line 412, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/private/tmp/venv/lib/python3.8/site-packages/celery/app/trace.py", line 704, in __protected_call__
    return self.run(*args, **kwargs)
  File "/private/tmp/venv/lib/python3.8/site-packages/dagster_celery/tasks.py", line 23, in _execute_plan
    instance = DagsterInstance.from_ref(instance_ref)
  File "/private/tmp/venv/lib/python3.8/site-packages/dagster/core/instance/__init__.py", line 284, in from_ref
    local_artifact_storage=instance_ref.local_artifact_storage,
  File "/private/tmp/venv/lib/python3.8/site-packages/dagster/core/instance/ref.py", line 181, in local_artifact_storage
    return self.local_artifact_storage_data.rehydrate()
  File "/private/tmp/venv/lib/python3.8/site-packages/dagster/serdes/__init__.py", line 345, in rehydrate
    check.failed(
  File "/private/tmp/venv/lib/python3.8/site-packages/dagster/check/__init__.py", line 109, in failed
    raise_with_traceback(CheckError('Failure condition: {desc}'.format(desc=desc)))
  File "/private/tmp/venv/lib/python3.8/site-packages/future/utils/__init__.py", line 446, in raise_with_traceback
    raise exc.with_traceback(traceback)
  File "/private/tmp/venv/lib/python3.8/site-packages/dagster/serdes/__init__.py", line 343, in rehydrate
    module = importlib.import_module(self.module_name)
  File "/Users/ofer/.pyenv/versions/3.8.3/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked
dagster.check.CheckError: Failure condition: Couldn't import module module_name when attempting to rehydrate the configurable class module_name.class_name
s
I would guess that you have “module_name” somewhere in your dagster.yaml configuration file
o
I’m using the exact config as in the example, so no “module_name” in dagster.yaml. It looks like that:
Copy code
execution:
  celery:
storage:
  filesystem:
s
^--- that is run config, not the instance (dagster.yaml) config
o
I see, so I misconfigured it. Thanks! Any idea though why it would only fail if simplejson is installed?
s
No idea! I’ve never dealt with that library.