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

No job output when job exits with error #82

Open
ashleysommer opened this issue Nov 22, 2019 · 2 comments
Open

No job output when job exits with error #82

ashleysommer opened this issue Nov 22, 2019 · 2 comments

Comments

@ashleysommer
Copy link
Contributor

Related to #32 and #80

When ofelia runs a job, and that job ends with an error, and exists with a non-zero exit value, then ofelia does not display the captured lines.

For example, if my application encounters an error, prints the error to the output, and exits with a non-zero exit value, then ofelia will show "ERROR" and "non-zero exit value", but it will not show the error text my application generated.

@sortigoza
Copy link

sortigoza commented Dec 6, 2019

Thanks for this nice tool!

I'm also experiencing the same issue:

task-runner-scheduler-579494c9fc-wh26d task-runner-scheduler 2019/12/06 21:23:47 scheduler.go:120 ▶ ERROR my-job - Job finished "42c805d4ec78" in "2.913618884s", failed: true, skipped: false, error: exit status 1

version 0.2.2

the configuration only contains local jobs, no globals:

[job-local "my-job"]
schedule = "23 * * * 1-5"
command = node ****

what are the requirements for the executed command to capture its logs e.g. stdout, stderr?

My container is running in kubernetes, it would be nice to capture the logs from the running tasks in the stdout to capture it and send it to Splunk or similar.

I don't completely get how the logs are captured, with a little guidance I can create a PR!

@Gaibhne
Copy link

Gaibhne commented Feb 2, 2021

It seems to be impossible to get the output/errors/stderr from failed jobs, if anyone finds a way or a hack around it, please drop a line here, because I have attempted every combination of saving the output, mailing it, redirecting it to files and so on and nothing seems to work.

Some things I have tried that did not allow me to see the problem:

ofelia.job-run.status-update.command: bash -c "mysql --defaults-extra-file=/credentials/my.cnf -N --execute=\"<some SQL statement that errors out \""

Error files are empty, docker logs are empty.

ofelia.job-run.status-update.command: bash -c "mysql --defaults-extra-file=/credentials/my.cnf -N --execute=\"<some SQL statement that errors out \"" >> /logs/out.txt

File gets created, but is empty.

ofelia.job-run.status-update.command: bash -c "mysql --defaults-extra-file=/credentials/my.cnf -N --execute=\"<some SQL statement that errors out \"" 2>&1 >> /logs/out.txt

File gets created, but is empty.

ofelia.job-run.status-update.command: bash -c "mysql --defaults-extra-file=/credentials/my.cnf -N --execute=\"<some SQL statement that errors out \" 2>&1 >> /logs/out.txt"

File gets created, but is empty.

/logs is mounted correctly, of course (otherwise it couldn't create the file). Mails come with files that claim to have a size (370 bytes, always) but are actually empty. Log files saved on the disk are 0 bytes.

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