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

Job execution failures not detected #83

Open
ogmueller opened this issue Feb 24, 2025 · 1 comment
Open

Job execution failures not detected #83

ogmueller opened this issue Feb 24, 2025 · 1 comment

Comments

@ogmueller
Copy link

If I am registering a command, which fails for any reason, I would expect the job execution to be "failed" or "error".

Here is an example configuration:

      - "ofelia.enabled=true"
      - "ofelia.job-exec.datecron.schedule=@every 5s"
      - "ofelia.job-exec.datecron.command=nonexistingcommand"

The command "nonexistingcommand" or even something like exit 1, will have a non zero return value. It should be detected as such and mail-only-on-error config should inform me, that there is a problem. Right now, this doesn't seem to happen as the log entry suggests failed: false, skipped: false, error: none.

ofelia                | 2025-02-24T15:34:09.427Z  config.go:138 ▶ DEBUG  dockerLabelsUpdate started
ofelia                | 2025-02-24T15:34:09.427Z  config.go:143 ▶ DEBUG  dockerLabelsUpdate labels: map[ofelia:map[ofelia.enabled:true ofelia.service:true] traefik:map[ofelia.enabled:true ofelia.job-exec.datecron.command:nonexistingcommand ofelia.job-exec.datecron.schedule:@every 5s]]
ofelia                | 2025-02-24T15:34:09.427Z  config.go:185 ▶ DEBUG  no exec jobs to update
ofelia                | 2025-02-24T15:34:09.427Z  config.go:192 ▶ DEBUG  checking exec job datecron if new
ofelia                | 2025-02-24T15:34:09.427Z  scheduler.go:53 ▶ NOTICE  New job registered "datecron" - "nonexistingcommand" - "@every 5s" - ID: 3
ofelia                | 2025-02-24T15:34:09.427Z  config.go:249 ▶ DEBUG  no run jobs to update
ofelia                | 2025-02-24T15:34:09.427Z  config.go:274 ▶ DEBUG  no new run jobs
ofelia                | 2025-02-24T15:34:09.427Z  cron_utils.go:13 ▶ DEBUG  added
ofelia                | 2025-02-24T15:34:14.001Z  cron_utils.go:13 ▶ DEBUG  wake
ofelia                | 2025-02-24T15:34:14.001Z  cron_utils.go:13 ▶ DEBUG  run
ofelia                | 2025-02-24T15:34:14.014Z  common.go:128 ▶ NOTICE  [Job "datecron" (071602a2cf3c)] Started - nonexistingcommand
ofelia                | 2025-02-24T15:34:14.017Z  common.go:128 ▶ NOTICE  [Job "datecron" (071602a2cf3c)] Finished in "2.983588ms", failed: false, skipped: false, error: none
@ogmueller
Copy link
Author

While writing this I did receive some email notifications from some of the jobs. The job itself runs every 5sec, but i do get the notification every 2-4min.

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

1 participant