Hello one my workers suddenly can t be

Hello, one my workers suddenly can't be published anymore, with a workers.api.error.internal_server [code: 10002] error. There's no error at compile time, and the wrangler.toml file has been untouched for 2 weeks (git is my witness). Last time I published it was 2 days ago, and now with reversed changes I still can't publish it. So is it just the Cloudflare's API going through some troubles (and status page is up to date), or potentially breaking changes introduced to wrangler?
24 Replies
arbfay
arbfay•2y ago
The worker uses Service Bindings, KV & DO
Unsmart
Unsmart•2y ago
I've had this happen a few time can you try to logout and back in on wrangler
arbfay
arbfay•2y ago
Unfortunately still the same error I've just tried clearing the local cache, and using an older version of wrangler (2.0.28) but same
Max (@rozenmd)
Max (@rozenmd)•2y ago
can you try adding WRANGLER_LOG=debug in front of your wrangler command like WRANGLER_LOG=debug wrangler publish
arbfay
arbfay•2y ago
The CF API response is:
-- START CF API RESPONSE: Internal Server Error 500
HEADERS: {}
RESPONSE: {
"result": null,
"success": false,
"errors": [
{
"code": 10002,
"message": "workers.api.error.internal_server"
}
],
"messages": []
}

-- END CF API RESPONSE
-- START CF API RESPONSE: Internal Server Error 500
HEADERS: {}
RESPONSE: {
"result": null,
"success": false,
"errors": [
{
"code": 10002,
"message": "workers.api.error.internal_server"
}
],
"messages": []
}

-- END CF API RESPONSE
And the request at which it fails,
-- START CF API REQUEST: PUT https://api.cloudflare.com/client/v4/accounts/[REDACTED]/workers/scripts/accounts?include_subdomain_availability=true&excludeScript=true
HEADERS: {
"Authorization": "Bearer [REDACTED]",
"User-Agent": "wrangler/2.1.6"
}
INIT: {
"method": "PUT",
"body": {}
}
-- START CF API REQUEST: PUT https://api.cloudflare.com/client/v4/accounts/[REDACTED]/workers/scripts/accounts?include_subdomain_availability=true&excludeScript=true
HEADERS: {
"Authorization": "Bearer [REDACTED]",
"User-Agent": "wrangler/2.1.6"
}
INIT: {
"method": "PUT",
"body": {}
}
Note that edge-preview also fails. I tried to do a manual deployment (with no changes) via the CF dashboard, and get the same error. It seems like this worker (which is critical :s) is locked out...
Max (@rozenmd)
Max (@rozenmd)•2y ago
Are there vars in the wrangler.toml by any chance? like a [vars] section
arbfay
arbfay•2y ago
yep there are (but been the same for a couple of weeks)
Max (@rozenmd)
Max (@rozenmd)•2y ago
just out of curiosity... if you run wrangler publish --keep-vars does it fail?
arbfay
arbfay•2y ago
it fails yeah 😒
Max (@rozenmd)
Max (@rozenmd)•2y ago
fails on 2.1.6, yeah?
arbfay
arbfay•2y ago
yep, tried 2.0.28 and 2.0.26 too and it fails too fails via the dashboard too, so maybe not a wrangler issue? (unless the browser uses wrangler?)
Max (@rozenmd)
Max (@rozenmd)•2y ago
there was a wrangler breaking change released in 2.0.28 and reverted in 2.1.6 - but if it also fails with --keep-vars in 2.1.6, it's likely not that Are you using OAuth, or API keys?
arbfay
arbfay•2y ago
logged in with wrangler login, so I guess OAuth?
Unknown User
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
arbfay
arbfay•2y ago
f2b6f40c0c425e2c6c35855f8301e21b and the worker has the tag ccdf742da66c48b18122938c4ab02ebc (not too risky to share here right?)
Unknown User
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
arbfay
arbfay•2y ago
Nope, I tried with the exact same code I published 2 days ago via wrangler, and it doesn't work. I also tried via the UI (the quick edit button), where the code is the latest published, and then just clicked save & deploy (with no modification whatsoever), and it fails with the same error code.
No description
Unknown User
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
arbfay
arbfay•2y ago
Yep, service bindings (x2), KV (x1) and DOs (x4)
Unknown User
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
arbfay
arbfay•2y ago
yeah all other workers are totally fine, also with bindings compatibility_date = "2022-09-08" in the wrangler file
Unknown User
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
arbfay
arbfay•2y ago
For archive: Reproduced by @petebd. It looks like exporting an array in index.js doesn't work (anymore), but root cause not yet determined. I've been using the export to have a global variable for subdirs to reuse, so instead I moved the export to a utils subdirectory so that it can still be accessed (and not copied everywhere) and it now works.
Unknown User
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View