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

Missing/incomplete information in the email from Ofelia #277

Open
issrec opened this issue May 28, 2024 · 1 comment
Open

Missing/incomplete information in the email from Ofelia #277

issrec opened this issue May 28, 2024 · 1 comment

Comments

@issrec
Copy link

issrec commented May 28, 2024

This configuration:

[global]
smtp-host = xxx
smtp-port = xxx
smtp-user = xxx
smtp-password = xxx
email-from = xxx
email-to = xxx
mail-only-on-error = true

[job-exec "cleanup-logs-directory-without-javamelody"]
schedule = 0 0 20 ? * MON,FRI
container = system
user = tomcat
command = /bin/sh -c 'find /usr/local/tomcat/logs/ -name \"javamelody\" -prune -or ! -type d -mtime ${_RETENTION_DAYS_LOGS} -print0 |sort -z |xargs -0r rm -vf --'
no-overlap = true

Ofelia's container log entries:

...
2024-05-28T02:00:00.04+02:00  common.go:125 ▶ NOTICE [Job "cleanup-logs-directory-without-javamelody" (10790174fcdd)] Started - /bin/sh -c 'find /usr/local/tomcat/logs/ -name "javamelody" -prune -or ! -type d -mtime ${_RETENTION_DAYS_LOGS} -print0 |sort -z |xargs -0r rm -vf --'
2024-05-28T02:00:01.894+02:00  common.go:121 ▶ ERROR [Job "cleanup-logs-directory-without-javamelody" (10790174fcdd)] Finished in "9.569522ms", failed: true, skipped: false, error: error creating exec: API error (409): Container b1d44c9afd7de9a4af0e1f13fd7df0eb7f4f72b3c9d728273fd8fab6ef31ebe5 is not running
...

The attachment cleanup-logs-directory-without-javamelody_10790174fcdd.stderr.json in the email from Ofelia looks like this:

{
  "Execution": {
    "ID": "10790174fcdd",
    "Date": "2024-05-28T02:00:00.040474798+02:00",
    "Duration": 9569522,
    "IsRunning": false,
    "Failed": true,
    "Skipped": false,
    "Error": {}
  },
  "Job": {
    "Schedule": "0 0 2 ? * ?",
    "Name": "cleanup-logs-directory-without-javamelody",
    "Command": "/bin/sh -c 'find /var/logs/ -name \"javamelody\" -prune -or ! -type d -mtime ${_RETENTION_DAYS_LOGS} -print0 |sort -z |xargs -0r rm -vf --'",
    "Container": "system",
    "User": "tomcat",
    "TTY": false,
    "Environment": [],
    "NoOverlap": true,
    "SlackWebhook": "",
    "SlackOnlyOnError": false,
    "SaveFolder": "",
    "SaveOnlyOnError": false,
    "SMTPHost": "",
    "SMTPPort": 0,
    "SMTPUser": "",
    "SMTPPassword": "",
    "SMTPTLSSkipVerify": false,
    "EmailTo": "",
    "EmailFrom": "",
    "MailOnlyOnError": false
  }
}

As you can see, the following information is missing or incorrect in the email from Ofelia:

  • Execution.Error
  • Job.SMTPHost
  • Job.SMTPPort
  • Job.SMTPUser
  • Job.SMTPPassword (for security reasons: anonymized or skipped)
  • Job.EmailTo
  • Job.EmailFrom
  • Job.MailOnlyOnError
@jogwen
Copy link
Contributor

jogwen commented Jul 22, 2024

Same here - the globally defined values are always missing or incorrect, only the locally defined values are reported correctly.

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

2 participants