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: Durable Object will not be deleted #8203

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

🐛 BUG: Durable Object will not be deleted #8203

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

Comments

@jacwright
Copy link

jacwright commented Feb 20, 2025

Which Cloudflare product(s) does this pertain to?

Workers Runtime

What versions are you using?

3.109.2 [Wrangler], 18.20.2 [Node]

What operating system and version are you using?

Mac

Please provide a link to a minimal reproduction

No response

Describe the Bug

I am deleting some durable objects and adding new ones. I have updated the bindings, but it still won't let me use the delete. Here is the output from the console:

% wrangler deploy --env test

 ⛅️ wrangler 3.109.2
--------------------

Total Upload: 458.51 KiB / gzip: 101.60 KiB
Your worker has access to the following bindings:
- Durable Objects:
  - RecordsEntity: RecordsEntity
  - Versioning: Versioning
  - Webhook: Webhook
  - ProjectImporter: ProjectImporter
- D1 Databases:
  - db: xxxxxx-test (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)
- R2 Buckets:
  - storage: xxxxxx-test
- Vars:
  - ENVIRONMENT: "test"

✘ [ERROR] A request to the Cloudflare API (/accounts/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/workers/scripts/xxxxxx-test) failed.

  Cannot apply --delete-class migration to class 'getClosestDurableObjectColo' without also removing
  the binding that references it. [code: 10061]
  
  If you think this is a bug, please open an issue at:
  https://github.com/cloudflare/workers-sdk/issues/new/choose

And here is my wrangler.toml

name = "xxxxxx"
main = "src/index.ts"
compatibility_date = "2024-12-30"

### PRODUCTION ###

[vars]
ENVIRONMENT = "production"

[durable_objects]
bindings = [
  { name = "RecordsEntity", class_name = "RecordsEntity" },
  { name = "Versioning", class_name = "Versioning" },
  { name = "Webhook", class_name = "Webhook" },
  { name = "ProjectImporter", class_name = "ProjectImporter" },
]

[[r2_buckets]]
binding = "storage"
bucket_name = "storage"

[[d1_databases]]
binding = "db"
database_name = "xxxxxx"
database_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"

[[migrations]]
tag = "v0.1"
new_classes = [
  "getClosestDurableObjectColo",
  "pool",
  "database",
  "autoVersion",
  "webhooks",
  "ProjectImporter",
]

[[migrations]]
tag = "v0.2"
new_sqlite_classes = ["RecordsEntity", "Versioning", "Webhook"]
deleted_classes = [
  "getClosestDurableObjectColo",
  "database",
  "pool",
  "autoVersion",
  "webhooks",
]

### TEST ###

[env.test.vars]
ENVIRONMENT = "test"

[env.test.durable_objects]
bindings = [
  { name = "RecordsEntity", class_name = "RecordsEntity" },
  { name = "Versioning", class_name = "Versioning" },
  { name = "Webhook", class_name = "Webhook" },
  { name = "ProjectImporter", class_name = "ProjectImporter" },
]

[[env.test.r2_buckets]]
binding = "storage"
bucket_name = "xxxxxx-test"

[[env.test.d1_databases]]
binding = "db"
database_name = "xxxxxx-test"
database_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"

[[env.test.migrations]]
tag = "v0.1"
new_classes = [
  "getClosestDurableObjectColo",
  "pool",
  "database",
  "autoVersion",
  "webhooks",
  "ProjectImporter",
]

[[env.test.migrations]]
tag = "v0.2"
deleted_classes = [
  "getClosestDurableObjectColo",
  "database",
  "pool",
  "autoVersion",
  "webhooks",
]
new_sqlite_classes = ["RecordsEntity", "Versioning", "Webhook"]

Please provide any relevant error logs

No response

@jacwright jacwright 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
@jacwright
Copy link
Author

jacwright commented Feb 20, 2025

Workaround was to delete them from the website/dashboard and then run the deploy after that to get the new classes added. Fortunately, I'm just working with test right now, but when getting to live, it would be nice to have it happen all at once.

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

1 participant