question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issue while publishing Worker with crons triggers

See original GitHub issue

When 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:closed
  • Created a year ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ObsidianMinorcommented, Apr 13, 2022

A fix for this went out in the most recent API release

1reaction
rileymillercommented, Apr 13, 2022

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found