Back

Cron Function Stuck

  • 0
  • Functions
JustinBack
4 May, 2023, 18:29

Hi!

Whats the procedure for making a cron function running again thats stuck? We want to avoid deleting them altogether and re-deploying didn't work.

As per Function overview the next execution is scheduled "25th February"

TL;DR
The user is experiencing an issue with a cron function in Appwrite. They noticed a display issue where 24 hours are marked as active instead of the default 30 days. The user found a potential underlying issue in the code but is unable to reproduce it. They mention that the issue occurred after upgrading from version 1.2.1 to 1.3.1. The user is asked about the version of Appwrite they are using and if they checked the execution logs of the function, to which they respond that the logs were empty. After resetting the cron, the function seems to be working fine. A suggestion is given to
Drake
4 May, 2023, 18:44

you can try:

  1. remove cron schedule (make sure to click Update)
  2. add the cron schedule back
JustinBack
4 May, 2023, 18:45

Aha! Why didn’t I think of that. Seems to have reset the execution timer.

JustinBack
4 May, 2023, 18:46

whats odd is that the function seems to have executed all the time, according to appwrite but nothing ever was really executed

JustinBack
4 May, 2023, 18:46
JustinBack
4 May, 2023, 18:47

(The Usage shows execution, but the web request in the function never sent)

Drake
4 May, 2023, 18:49

are you sure it's from the same function?

JustinBack
4 May, 2023, 18:49

Definitely, double checked

JustinBack
4 May, 2023, 18:49

After the cron reset it seems to work just fine now

Drake
4 May, 2023, 18:52

did you see stuff in the execution logs of the function?

JustinBack
4 May, 2023, 18:52

Nope it was empty

Drake
4 May, 2023, 18:53

how did you check?

JustinBack
4 May, 2023, 18:53

Matching the function id in the URL and the name of the function

Drake
4 May, 2023, 18:54

what version of appwrite are you on?

JustinBack
4 May, 2023, 19:00

Not on latest yet, 1.3.1. However this issue occurred right after the upgrade from 1.2.1

JustinBack
4 May, 2023, 19:16

I cannot reproduce it at all as I am not sure how it happened to begin with, however errors were at zero as well

Drake
4 May, 2023, 19:35

so weird...even at 1.2.1 the stat should only be recorded if an execution is created...https://github.com/appwrite/appwrite/blob/0180aff4f540fc4085190d8a0606196dc9db2275/app/workers/functions.php#L367-L378

JustinBack
4 May, 2023, 19:40

I found the underlying display issue

JustinBack
4 May, 2023, 19:40

it seems appwrite displays 30 days by default, however 24h is marked as active

JustinBack
4 May, 2023, 19:42

this should explain it better

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more