https://dagster.io/ logo
Title
a

Andrew Parsons

01/25/2022, 12:31 AM
Hi everyone, I have enjoyed using Dagster since 0.11.x. I'm late to the party: I am finally getting around to the op/graph/job migration. As part of the migration, I have removed
mode_defs=
(and deleted all the old
ModeDefinitions
) and replaced them with plain
resource_defs=
. After doing so, every job part of my existing repositories complained that they could not find the modes they once relied upon:
dagster.check.CheckError: Failure condition: Mode <FOOBAR> not found
This appears to be an issue with the `PipelineIndex`'s
PipelineSnapshot
. https://github.com/dagster-io/dagster/blob/2a55278a4e32605b23a26c27e93b6566a3fd9cf[…]ules/dagster/dagster/core/host_representation/pipeline_index.py I poked around in the Dagster CLI, rebuilt my Docker containers with
--no-cache
, and deleted all my old runs, all to no avail. I could not figure out a way to reindex/reset/re-snapshot the pipelines. The only fix has been to rename the repositories (annoying, but not a big deal). While this is not a critical problem, I did burn some hours trying to find the solution. Some documentation or a fix in
> 0.13.16
would be great!
a

alex

01/25/2022, 12:35 AM
do you have a stack trace? Are there any vestigial
mode=
params on schedules or sensors?
a

Andrew Parsons

01/25/2022, 12:43 AM
Hi @alex! I don't have any schedules or sensors. Searching all project files (PyCharm) for
mode[^l]
(regex to exclude "model") yields nothing. i.e. there are no vestigial
mode*=
invocations. Here is the error shown in Dagit (where <FOOBAR> was the mode name):
dagster.check.CheckError: Failure condition: Mode <FOOBAR> not found
  File "/usr/local/lib/python3.8/site-packages/dagster_graphql/implementation/utils.py", line 34, in _fn
    return fn(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/dagster_graphql/implementation/fetch_runs.py", line 204, in validate_pipeline_config
    ensure_valid_config(external_pipeline, mode, run_config)
  File "/usr/local/lib/python3.8/site-packages/dagster_graphql/implementation/external.py", line 87, in ensure_valid_config
    config_type_key=external_pipeline.root_config_key_for_mode(mode),
  File "/usr/local/lib/python3.8/site-packages/dagster/core/host_representation/external.py", line 296, in root_config_key_for_mode
    return self.get_mode_def_snap(
  File "/usr/local/lib/python3.8/site-packages/dagster/core/host_representation/represented.py", line 93, in get_mode_def_snap
    return self._pipeline_index.get_mode_def_snap(mode_name)
  File "/usr/local/lib/python3.8/site-packages/dagster/core/host_representation/pipeline_index.py", line 114, in get_mode_def_snap
    check.failed("Mode {mode} not found".format(mode=name))
  File "/usr/local/lib/python3.8/site-packages/dagster/check/__init__.py", line 119, in failed
    raise CheckError("Failure condition: {desc}".format(desc=desc))
A quick peek at all the Docker service logs doesn't reveal anything else. I don't know if there are any other logs to examine.
a

alex

01/25/2022, 12:46 AM
hm interesting it seems dagit or something in the browser held on to a reference to the mode - did you restart the webserver? maybe clear local storage?
a

Andrew Parsons

01/25/2022, 3:45 PM
Sorry for blaming you all for the issue! Changing browsers confirmed that the issue was browser-side. I had to clear Local Storage through my browser's development tools. (Note to future passers-by: make sure to copy any run configurations you'd like to keep). I'm not in web dev, so that was the last place I thought to look. Thanks for your eyes, @alex 👀