Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 BUG: Delete Classes Migration Failing #8210

Open
devceline opened this issue Feb 20, 2025 · 1 comment
Open

🐛 BUG: Delete Classes Migration Failing #8210

devceline opened this issue Feb 20, 2025 · 1 comment
Labels
bug Something that isn't working

Comments

@devceline
Copy link

devceline commented Feb 20, 2025

Which Cloudflare product(s) does this pertain to?

Wrangler

What versions are you using?

3.109.2 [Wrangler], 18.18.2 [Node]

What operating system and version are you using?

Linux (Arch)

Please provide a link to a minimal reproduction

No response

Describe the Bug

After deploying a worker with a durable object Create Migration and bindings setup per environment, like this:

[[migrations]]
tag = "v1" 
new_classes = ["Foo"]

[env.staging]
durable_objects = { bindings = [
  { name = "Bar", class_name = "Foo" }
]}

[env.production]
durable_objects = { bindings = [
  { name = "Bar", class_name = "Foo" }
]}

Later then editing the wrangler.toml with a delete migration:

[[migrations]]
tag = "v1" 
new_classes = ["Foo"]

[[migrations]]
tag = "v2" 
deleted_classes = ["Foo"]

[env.staging]
durable_objects = { bindings = [] }

[env.production]
durable_objects = { bindings = [] }

running wrangler deploy --env staging gives the following error:

Cannot apply --delete-class migration to class 'Foo' without also removing the binding that references it. [code: 10061]

Things I've tried

  • Defining a default durable_objects = { bindings = [] }
  • Erasing any mention of durable_objects
  • Removing the first migration

Please provide any relevant error logs

Cannot apply --delete-class migration to class 'Foo' without also removing the binding that references it. [code: 10061]
@devceline devceline added the bug Something that isn't working label Feb 20, 2025
@github-project-automation github-project-automation bot moved this to Untriaged in workers-sdk Feb 20, 2025
@JeremyPlease
Copy link

I ran into this issue as well. The only workaround I found that worked was to delete the binding in the cloudflare dashboard and then deploy with wrangler and the deleted_class migration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that isn't working
Projects
Status: Untriaged
Development

No branches or pull requests

2 participants