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

[Bug]: Issue with Grep Command in Cronicle Scheduled Crons #878

Closed
2 tasks done
saikrishna1488 opened this issue Mar 6, 2025 · 1 comment
Closed
2 tasks done
Labels

Comments

@saikrishna1488
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

Hi Team,

I have scheduled around 35 crons in Cronicle and will be adding more in the coming days. Currently, I am facing an issue with two crons that are failing due to a "file not found" error when using the grep command, even though the cron executes successfully.

When I run cat filename.txt, I can see the output, but using grep causes the cron to fail. Is there any specific reason for this? Below is the shell script I am using:

`pwd

rm -f testing.txt

curl -i http://example.com/crons/testing.php -o testing.txt

ls -l

cat testing.txt

grep 'HTTP/1.1 200' testing.txt
`
Cronicle Setup: Primary and Backup

Looking forward to your insights.

Thanks!

Operating System

Ubuntu 22.04

Node.js Version

22.14.0

Cronicle Version

0.9.76

Server Setup

Multi-Primary with Workers

Storage Setup

S3

Relevant log output

grep: testing.txt: No such file or directory
# Job failed at 2025/03/06 09:40:00 (GMT+5.5).
# Error 2: Script exited with code: 2: % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
# End of log.

Code of Conduct

  • I agree to follow this project's Code of Conduct
@saikrishna1488
Copy link
Author

Hey, the issue is resolved!

The problem was that multiple crons were writing output to the same file name. Since many of them had a 1-minute frequency, another cron would execute the rm command before the grep command could run, causing the file to be deleted and the grep command to fail.

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

No branches or pull requests

1 participant