Issue while publishing Worker with crons triggers
See original GitHub issueWhen i run the command npx wrangler@beta publish main.ts --config wrangler.toml --env development
to publish a worker script i get the following error:
⛅️ wrangler 0.0.25
--------------------
Uploaded sharecation-authentication-scheduled-development (2.70 sec)
✘ [ERROR] Received a malformed response from the API
Internal Server Error
PUT
/accounts/XXXXXXXX/workers/scripts/sharecation-authentication-scheduled-development/schedules
-> 500 Internal Server Error
If you think this is a bug, please open an issue at:
https://github.com/cloudflare/wrangler2/issues/new
Error: ./node_modules/.bin/wrangler exited with code 1
at ChildProcess.<anonymous> (file:///Users/XXXXX/git/sharecation/worker/publish.mjs:38:16)
at ChildProcess.emit (node:events:520:28)
at maybeClose (node:internal/child_process:1092:16)
at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
Process finished with exit code 1
wrangler.toml
name = "sharecation-authentication-scheduled"
compatibility_date = "2022-04-01"
usage_model = "unbound"
legacy_env = true
[vars]
ENVIRONMENT = ""
[triggers]
crons = ["0 0 * * mon"]
[env.development]
vars = { ENVIRONMENT = "development" }
kv_namespaces = [
{ binding = "COMMON", id = "XXXX", preview_id = "XXXX" },
{ binding = "AUTHENTICATION", id = "XXXX", preview_id = "XXXX" }
]
[env.production]
vars = { ENVIRONMENT = "production" }
kv_namespaces = [
{ binding = "COMMON", id = "XXXX" },
{ binding = "AUTHENTICATION", id = "XXXX" }
]
I change the cli to print the request and result. request:
PUT https://api.cloudflare.com/client/v4/accounts/XXXX/workers/scripts/sharecation-authentication-scheduled-development/schedules object passed to fetch
{
method: 'PUT',
body: '[{"cron":"0 0 * * mon"}]',
headers: { 'Content-Type': 'application/json' }
'Content-Type': 'application/json',
Authorization: 'Bearer XXXX'
}
response: Body: Internal Server Error Some response headers:
- 'cf-ray', '6faeba6459fb0219-ZRH',
- 'content-type', 'text/plain; charset=utf-8',
Issue Analytics
- State:
- Created a year ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Mini RFC: Cron Triggers #1574 - cloudflare/wrangler - GitHub
To support cron triggers, I propose we add a new triggers table with a crons field as an array of strings.
Read more >Cron Triggers - Workers - Cloudflare Docs
Cron Triggers allow users to map a cron expression to a Worker script using a ScheduledEvent listener that enables Workers to be executed...
Read more >How to Troubleshoot the WordPress Cron
Common things that you may notice when the WP Cron isn't working are: Scheduled posts don't publish at the correct time or at...
Read more >Trigger 'cron' do not working in apscheduler 3 while 'interval ...
I am trying to use package apscheduler 3.1.0 to run a python job every day at the same time. But it seems do...
Read more >Why is my crontab not working, and how can I troubleshoot it?
The vast majority of "my cron script doesn't work" problems are caused by this restrictive path. If your command is in a different...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
A fix for this went out in the most recent API release
Looks like this is related.
https://github.com/cloudflare/wrangler/issues/2234
Our team is currently blocked by this, can’t deploy our workers via the github action or w/ wrangler
Update
This appears to be fixed now