-
Notifications
You must be signed in to change notification settings - Fork 626
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
cron fails on two servers, approximately same time, without error #423
Comments
For me, it does not seem to depend on the server load: one of my servers is rather idle, the other rather busy. Both have the same resources. |
That's really strange. Is there a service that both crons are using? What I'm wondering is if there is a possibility that they were using the same service that went down at some time which caused an exception in your calling code which cascaded and caused the crons to die. Let me know, thanks! |
Both servers synchronize to the ubuntu time server every 30 min, but at different times. However, sometimes the synchronization shows some timeouts (10s) - see the second log - which are longer than the cron interval. Could this be a problem? Server 1: Server 2: |
Hi @ChristophDFine . Did you ever get to the bottom of what caused this? |
No, not yet. I am still waiting that it happens again so I get more debug info. |
Hey, Edit: might not be the same issue since your processes were launched at different times and stopped at the same time. |
Has anyone been able to reproduce this issue? If not I'll close the issue and chalk it up to a node issue. Let me know. Thanks. |
This morning I got this same error and tried out with a fresh new install of rasbian and node-red. I was able to pinpoint it to an inject node with specific content. With this (below) node it crashed, with other configurated inject nodes there are no problems. [{"id":"a02e32cd.28c53","type":"tab","label":"Flow 6","disabled":false,"info":""},{"id":"a78a0f31.f1bc9","type":"inject","z":"a02e32cd.28c53","name":"Init & reset","topic":"","payload":"auto","payloadType":"str","repeat":"","crontab":"*/20 2 * * *","once":true,"onceDelay":0.1,"x":130,"y":120,"wires":[[]]}] |
Hi, Code
Logs{"level":"debug","message":"CRON:TICK Finding X job start","timestamp":"2023-01-21 03:06:10"} |
@awaismehmood88 are you able to reproduce this behavior? @ChristophDFine what indicates that the error is with Node as opposed to node-cron? |
Yes, unfortunately I had to choose other library over this. |
@awaismehmood88 out of curiosity, which other library did you choose? |
Using node-cron |
@awaismehmood88 I'm trying to reproduce your issue. what does the |
FindJob function finds jobs from DB and executive IO intensive task, it may take less than a second or may take up to one minute, code also contains time intervals, callbacks etc There was not fixed time when cron stops, I tried same code on mac and linux it stops after few days |
you're sure there's no error message when it stops? I started a test cron job right after my last comment just to test this and it still works after a few days. my guess is it's related to #467 if it's unpredictable and caused by the environment. can you start very simple test cron to see if a console log causes it to fail after a couple of days? could you also try starting an even more complex job with more DB/IO operations to see if you can get it to fail in a few seconds or minutes? I'm surprised actually because if it's time intensive you should be able to just make it |
There was no error shown in logs, I'll try simple cron job on same machine and share more details. |
Closing this issue since OP established it wasn't an issue with the library, but rather with Node.js. EDIT: leaving the |
I have two aws servers, identical setup:
lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 18.04.2 LTS Release: 18.04 Codename: bionic
uname -r 4.15.0-1035-aws
node --version v8.16.0
cat package.json | grep cron "cron": "^1.7.1",
both have cron running with this code:
new CronJob('*/10 * * * * *', procNewBlock, null, true, 'Europe/Berlin');
both stopped running at approximately the same time, the first was running the last time at:
May 2 09:05:47 UTC
the second last run was at:
May 2 09:06:30 UTC
so far this was the only time that this happend (running for about 1 month now). To me it looks as if some scheduled system task outside of nodejs is killing the crons. But any help greatly appreciated. The nodejs processes did not see any interruption.
The text was updated successfully, but these errors were encountered: