# dagster-plus

sri raghavan

05/11/2023, 11:48 PM
hi y'all - question about Dagster Cloud Hybrid and queue management 🧵
we're running on Cloud Hybrid with Fargate. we ran into a situation where we queued an exorbitant number (26K) of runs (sensor gone awry!), and we'd like to clear the queue (in fact, we'd be just as happy to simply drop the entire dagster DB). I've found this ( from @daniel recently, but I'm not sure if it applies to dagster cloud (concretely, I'm not sure how to get access to the dagster instance in hybrid mode). anyone have any thoughts/pointers?

Anushree Agrawal

05/12/2023, 1:01 AM
hi, I'm running into this! we've tried recreating the deployment, which didn't work, and tried ssh'ing into the Dagster agent ECS task via
aws ecs execute-command
but both approaches didn't work. any suggestions? we're unable to run any jobs on dagster until this is fixed.


05/12/2023, 1:49 AM
hi all - I amended the discussion with a way to do this in Dagster Cloud. We're actively working on bulk termination in the UI as well, so hopefully this is a less annoying experience soon. We can also clear these out for you in this particular case if you give us the go-ahead to do so

Anushree Agrawal

05/12/2023, 5:42 AM
thanks @daniel! you can go ahead and clear these out, but thanks for the reference for future. is the agent token the same one we see in Deployments > Tokens > Manage agent tokens
I tried the script and got the following error:
Copy code
Traceback (most recent call last):
  File "", line 3, in <module>
    instance = DagsterInstance.get() # needs your DAGSTER_HOME to be set
  File "/home/ubuntu/.local/lib/python3.8/site-packages/dagster/_core/instance/", line 479, in get
    return DagsterInstance.from_config(dagster_home_path)
  File "/home/ubuntu/.local/lib/python3.8/site-packages/dagster/_core/instance/", line 495, in from_config
    return DagsterInstance.from_ref(instance_ref)
  File "/home/ubuntu/.local/lib/python3.8/site-packages/dagster/_core/instance/", line 507, in from_ref
    unified_storage =
  File "/home/ubuntu/.local/lib/python3.8/site-packages/dagster/_core/instance/", line 463, in storage
    return self.storage_data.rehydrate() if self.storage_data else None
  File "/home/ubuntu/.local/lib/python3.8/site-packages/dagster/_serdes/", line 99, in rehydrate
    return klass.from_config_value(self, check.not_none(result.value))
  File "/home/ubuntu/.local/lib/python3.8/site-packages/dagster/_core/storage/", line 131, in from_config_value
  File "/home/ubuntu/.local/lib/python3.8/site-packages/dagster/_serdes/", line 70, in rehydrate
    module = importlib.import_module(self.module_name)
  File "/usr/lib/python3.8/importlib/", 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 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 848, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/ubuntu/.local/lib/python3.8/site-packages/dagster_cloud/storage/schedules/", line 1, in <module>
    from .storage import GraphQLScheduleStorage as GraphQLScheduleStorage
  File "/home/ubuntu/.local/lib/python3.8/site-packages/dagster_cloud/storage/schedules/", line 34, in <module>
    class GraphQLScheduleStorage(ScheduleStorage["DagsterCloudAgentInstance"], ConfigurableClass):
  File "/usr/lib/python3.8/", line 261, in inner
    return func(*args, **kwds)
  File "/usr/lib/python3.8/", line 897, in __class_getitem__
    _check_generic(cls, params)
  File "/home/ubuntu/.local/lib/python3.8/site-packages/", line 100, in _check_generic
    raise TypeError(f"{cls} is not a generic class")
TypeError: <class ''> is not a generic class
nevermind, got it to work! just needed a dagster version upgrade. thanks for the help