Skip to content
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

Bot occasionally stops #12

Open
Mothluin opened this issue Jan 20, 2022 · 2 comments
Open

Bot occasionally stops #12

Mothluin opened this issue Jan 20, 2022 · 2 comments

Comments

@Mothluin
Copy link

Hi
I monitored the bot closely as of late, and I'm sad to report it occasionally stops with no auto-restart.
This happened to me a couple times in the past, and started to happen again recently.

Please see the following logs as evidence.
The bot stopped working on 18/01, at 11:40:05 local time:

[...]
2022-01-18T10:15:04: [CHECK] Rebalance not necessary
2022-01-18T10:20:04: [CHECK] Rebalance not necessary
2022-01-18T10:25:04: [CHECK] Rebalance not necessary
2022-01-18T10:30:05: [CHECK] Rebalance not necessary
2022-01-18T10:35:05: [CHECK] Rebalance not necessary
2022-01-18T10:40:05: [CHECK] Rebalance not necessary

I checked the server today and restarted the bot manually at 13:40:05 local time:

2022-01-20T12:40:05:
2022-01-20T12:40:05: Received SIGINT signal
2022-01-20T12:40:05: Shutting down
2022-01-20T12:40:05:
2022-01-20T12:40:08: Trailing Stop at [30 * * * * *] with 25% min profit and 15% max drop ...
2022-01-20T12:40:08: Investing at [0 3 0 * * *] with 25 USDT ...
2022-01-20T12:40:08: Rebalancing at [0 */5 * * * *] with threshold of 5% ...
2022-01-20T12:40:08:
2022-01-20T12:45:03: [CHECK] LUNA deviates 6.835566782097075 USDT (9.88%) -> [OVERPERFORMING]
[...]

I inspected the error log on January, the 18th but I can't find any entry leading to a process halt at that time:

2022-01-18T01:25:30: Error - timeout of 30000ms exceeded
2022-01-18T01:25:30: Account balance or order book are empty
mothluin-error__2022-01-19_00-00-00.log (END)

I'm now thinking to add a cron job entry to ensure the process is restarted a couple times a day at least.

@Thornsnake
Copy link
Owner

Thornsnake commented Jan 20, 2022

I can confirm that issue. It's been reported several times on our Discord as well and was one of the reasons why I switched the cronjob library here: 4ed06f5e6c28d2c3562d07b526818068d7d1a3f0

The new one seems to have the same issue it seems, and I just don't know what it could be. You can find people reporting the issue here:
kelektiv/node-cron#585
kelektiv/node-cron#512

Both cronjob libraries I've tried seem to (at some point) just stop, without an error. I thought about adding another interval that checks if the cronjobs are still running, but that kind of defeats the purpose of having cronjobs. So right now I'm thinking about removing them in favor of simple intervals.

You won't have the granularity to choose to invest every second Sunday, but intervals never fail and most people seem to use a 5 minute Rebalance with a daily Investment anyway.

I will think about how to uddate this without breaking the current bot for people that have automatic updates turned on.

@sheerlox
Copy link

sheerlox commented Oct 1, 2023

hello @Thornsnake!

we have done a lot of work on cron since v1.8.2, which you're using.

could you try to upgrade the package to our latest major version (v3)?

I'm closing kelektiv/node-cron#585 for now since we don't have any way to reproduce the bug, but feel free to comment there if you're still having the issue after upgrading to the latest version so we can reopen the issue!

Note: we are planning on adding support for extended CRON characters soon, so upgrading to v3 will also allow you to "choose to invest every second Sunday" when we release that feature! 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants