Cannot delete workers with durable object bindings

I am unable to delete workers in the dashboard or via the API. As a bit of background, I have preview workers created on pull requests via CI in projects that contain durable objects, and I need to clean them up afterwards.

When I try to delete the workers, I get the error script still in use by a durable object namespace (Code: 10064). I get this both in the manage service screen in the dashboard, and trying to delete via the API.

Is there no way to remove a binding, thus enabling me to delete the preview workers? I’ve seen that I can delete the [durable_objects] in my wrangler.toml, but this would also remove the DO from my production workers that I don’t want to happen.

Also, on a related note, is there any way to create previews as service environments, now that they’re enabled, rather than separate workers?

@lee.ellam

If you go to the big list of Workers, then click on one, you’ll see tabs for Metrics, Triggers, Settings. The Settings tab has a delete button.
From there you can delete a worker

I can’t, because I get the error message I shared when trying to delete.

No durable objects listed (even though there is one bound):

Cannot delete:

Send an email to [email protected] , your query would be solved soon

I’ve reached out to [email protected] but my ticket was closed automatically.

I have a collection of workers, created using wrangler.toml environments (dev - default, previews - dynamically created in CI, and production).

These workers are using Durable Objects. In the dashboard, only the default dev worker displays the durable object binding. None of the preview workers nor the production worker display the bindings. This causes 2 issues, the first being that I can’t delete a preview worker, and the second being that the durable objects are not accessible from code (env.{MY_BINDING}.idFromName(...) doesn’t work, for example).

What is more odd, is that if I list the durable objects via the API, bindings are returned for each worker, it just seems that they are detached from the workers somehow.

I cannot simply remove the [durable_objects] section from my wrangler.toml and use wrangler to publish and delete the class, as I need the class for all of my workers!

Can anyone from Cloudflare shed some light on this?

I managed to fix this by also scoping [durable_objects] under my environments, so:

[durable_objects]
...

[env.preview.durable_objects]
...

[env.production.durable_objects]
...

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.