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

On helm-chart 7.0.0 with value mendRnvLogHistoryDir unset logs are going to /tmp/renovate/logs #489

Open
pippitt opened this issue Apr 16, 2024 · 9 comments

Comments

@pippitt
Copy link

pippitt commented Apr 16, 2024

After updating from chart version 6.10.0 to 7.0.0 we noticed the renovate attached PVC was filling with logs.
Previous image with no logs: ghcr.io/mend/renovate-ce:6.11.0
Current image with logs: ghcr.io/mend/renovate-ce:7.0.0
The previous deployment logged nothing to /tmp/renovate/logs as expected with mendRnvLogHistoryDir unset.
As a work around we set these values:

  mendRnvLogHistoryCleanupCron: "\"0 0 * * *\""
  mendRnvLogHistoryTTLDays: "1"

There is the output of env|grep LOG on the 7.0.0 version container:

MEND_RNV_LOG_HISTORY_TTL_DAYS=1
LOG_FORMAT=json
LOG_LEVEL=debug
MEND_RNV_LOG_HISTORY_CLEANUP_CRON=0 0 * * *

and the same on the 6.11.0 container:

LOG_FORMAT=json
LOG_LEVEL=debug

From the logs on the new version I do see config.log being set, example with redactions:

  "name": "mend-renovate",
  "hostname": "renovate-5cf9c7947b-cr7vg",
  "pid": 9,
  "level": 20,
  "logContext": "DqbRGZIt-avPOyWj11lRf",
  "job": {
    "jobId": 481636,
    "repository": "REDACTED",
    "organizationName": "REDACTED",
    "installationId": REDACTED,
    "reason": "hourly",
    "priority": 10,
    "addedAt": "2024-04-16 17:00:01",
    "startedAt": "2024-04-16 17:47:07",
    "lastAlive": "2024-04-16 17:47:07",
    "attempts": 1
  },
  "config": {
    "endpoint": "https://api.github.com/",
    "gitAuthor": "REDACTED",
    "logContext": "723482411a",
    "platform": "github",
    "repositories": [
      "REDACTED"
    ],
    "username": "REDACTED",
    "token": "***********",
    "dependencyDashboardFooter": "\n- [ ] <!-- manual job -->Check this box to trigger a request for Renovate to run again on this repository\n",
    "logFile": "/tmp/renovate/logs/REDACTED/REDACTED/20240416_174707_723482411a.log"
  },
  "msg": "Running Renovate job",
  "time": "2024-04-16T17:47:07.589Z",
  "v": 0

vs logs from the 6.11.0 for a "msg": "Running Renovate job":

  "name": "renovate",
  "hostname": "renovate-64f6c4c9bc-4cj69",
  "pid": 8,
  "level": 20,
  "logContext": "sxC1fMe05dXst_42Tihzj",
  "job": {
    "jobId": 451485,
    "repository": "REDACTED",
    "organizationName": "REDACTED",
    "installationId": REDACTED,
    "reason": "hourly",
    "priority": 10,
    "addedAt": "2024-04-16 16:00:04",
    "startedAt": "2024-04-16 17:45:11",
    "lastAlive": "2024-04-16 17:45:11",
    "attempts": 1
  },
  "config": {
    "dependencyDashboardFooter": "\n- [ ] <!-- manual job -->Check this box to trigger a request for Renovate to run again on this repository\n",
    "endpoint": "https://api.github.com/",
    "gitAuthor": "REDACTED",
    "logContext": "60bd86b0bc",
    "platform": "github",
    "repositories": [
      "REDACTED"
    ],
    "token": "***********",
    "username": "REDACTED"
  },
  "msg": "Running Renovate job",
  "time": "2024-04-16T17:45:11.380Z",
  "v": 0

Let me know if I can provide further information.

@nabeelsaabna
Copy link
Contributor

nabeelsaabna commented Apr 17, 2024

Yes, logHistoryDir is set by default to /tmp/renovate/logs/ in v7
I'll add that to the release notes

@pippitt
Copy link
Author

pippitt commented Apr 17, 2024

Yes, logHistoryDir is set by default to /tmp/renovate/logs/ in v7 I'll add that to the release notes

If you didn't want logging locally (as we stream all the STDOUT to a logging platform), what should it be set to? I know we tried /dev/null but that just tried to write logs to /dev/null/ORGNAME/REPONAME which would error.

@Gabriel-Ladzaretti
Copy link
Contributor

Gabriel-Ladzaretti commented Apr 17, 2024

If you didn't want logging locally (as we stream all the STDOUT to a logging platform), what should it be set to? I know we tried /dev/null but that just tried to write logs to /dev/null/ORGNAME/REPONAME which would error.

You can set RENOVATE_LOG_FILE=/dev/null instead.

EDIT: The above will override the value that is being sent to the Renovate CLI, effectively disabling it (refer to the Combined config log message).

@pippitt
Copy link
Author

pippitt commented Apr 17, 2024

If you didn't want logging locally (as we stream all the STDOUT to a logging platform), what should it be set to? I know we tried /dev/null but that just tried to write logs to /dev/null/ORGNAME/REPONAME which would error.

You can set RENOVATE_LOG_FILE=/dev/null instead.

EDIT: The above will override the value that is being sent to the Renovate CLI, effectively disabling it (refer to the Combined config log message).

That is what we tried, here are the slightly redacted errors from that:

"level":60,
"err":{"errno":-20,"code":"ENOTDIR","syscall":"mkdir","path":"/dev/null/ORG/REPONAME",
"message":"ENOTDIR: not a directory, mkdir '/dev/null/ORG/REPONAME'",
"stack":"Error: ENOTDIR: not a directory, mkdir '/dev/null/ORG/REPONAME'"},
"msg":"Fatal error: ENOTDIR: not a directory, mkdir '/dev/null/ORG/REPONAME'"

@Gabriel-Ladzaretti
Copy link
Contributor

You tried setting MEND_RNV_LOG_HISTORY_DIR=/dev/null which will cause the error you mention. i suggest setting RENOVATE_LOG_FILE=/dev/null instead.

This will prevent Renovate from writing local logs to the PVC (and the error you mention), but it won't prevent the creation of the **/ORG/REPONAME directories. If this is a problem, Try setting MEND_RNV_LOG_HISTORY_DIR somewhere outside the mount path for your PVC; MEND_RNV_LOG_HISTORY_DIR=/tmp/logs might work.

@Gabriel-Ladzaretti
Copy link
Contributor

Btw, setting MEND_RNV_LOG_HISTORY_DIR outside the PVC alone will prevent it from writing logs to the PVC. but it will not prevent writing local logs.
This also might work for you if this suits your needs.

@nabeelsaabna
Copy link
Contributor

Hi @pippitt we'll address this issue and allow not storing logs at all

@nabeelsaabna
Copy link
Contributor

nabeelsaabna commented May 23, 2024

we update the configurations docs to indicate where the files will be saved by default and how to clean them up
docs: edit MEND_RNV_LOG_HISTORY_DIR description

@justo-mend
Copy link
Contributor

justo-mend commented May 23, 2024

I recommend a feature request to provide a hard-coded value for MEND_RNV_LOG_HISTORY_DIR that will disable writing job logs to file.

The new value could be something like: OFF, NONE, DISABLED

I recommend: NONE

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

4 participants