renovatebot / renovate

Home of the Renovate CLI: Cross-platform Dependency Automation by Mend.io
https://mend.io/renovate
GNU Affero General Public License v3.0
17.15k stars 2.23k forks source link

Lockfile maintenance MR not opened when encountering errors #18629

Open bobvandevijver opened 1 year ago

bobvandevijver commented 1 year ago

How are you running Renovate?

Self-hosted

If you're self-hosting Renovate, tell us what version of Renovate you run.

34.6.0

If you're self-hosting Renovate, select which platform you are using.

GitLab self-hosted

If you're self-hosting Renovate, tell us what version of the platform you run.

15.5.1

Was this something which used to work for you, and then stopped?

It used to work, and then stopped

Describe the bug

I was missing the weekly lock file maintenance PR, so I went looking why it wasn't generated anymore. It looks like it fails to open a PR with an error message when the docker command fails. The log clearly shows the ExecError, but renovate just continues and detects no changes to the lock file, as that wasn't updated due to the previous error.

Relevant debug logs

Logs ``` {"name":"renovate","hostname":"runner-pt6gmhxg-project-49-concurrent-0","pid":30,"level":20,"logContext":"K3VNfOOLJp2LpFYMSki_1","repository":"backoffice/crm","branch":"renovate/lock-file-maintenance","msg":"syncBranchState()","time":"2022-10-28T07:03:37.148Z","v":0} {"name":"renovate","hostname":"runner-pt6gmhxg-project-49-concurrent-0","pid":30,"level":20,"logContext":"K3VNfOOLJp2LpFYMSki_1","repository":"backoffice/crm","branch":"renovate/lock-file-maintenance","msg":"syncBranchState(): Branch cache not found, creating minimal branchState","time":"2022-10-28T07:03:37.148Z","v":0} {"name":"renovate","hostname":"runner-pt6gmhxg-project-49-concurrent-0","pid":30,"level":20,"logContext":"K3VNfOOLJp2LpFYMSki_1","repository":"backoffice/crm","branch":"renovate/lock-file-maintenance","msg":"getBranchPr(renovate/lock-file-maintenance)","time":"2022-10-28T07:03:37.149Z","v":0} {"name":"renovate","hostname":"runner-pt6gmhxg-project-49-concurrent-0","pid":30,"level":20,"logContext":"K3VNfOOLJp2LpFYMSki_1","repository":"backoffice/crm","branch":"renovate/lock-file-maintenance","msg":"findPr(renovate/lock-file-maintenance, undefined, open)","time":"2022-10-28T07:03:37.149Z","v":0} {"name":"renovate","hostname":"runner-pt6gmhxg-project-49-concurrent-0","pid":30,"level":20,"logContext":"K3VNfOOLJp2LpFYMSki_1","repository":"backoffice/crm","branch":"renovate/lock-file-maintenance","msg":"branchExists=false","time":"2022-10-28T07:03:37.149Z","v":0} {"name":"renovate","hostname":"runner-pt6gmhxg-project-49-concurrent-0","pid":30,"level":20,"logContext":"K3VNfOOLJp2LpFYMSki_1","repository":"backoffice/crm","branch":"renovate/lock-file-maintenance","msg":"dependencyDashboardCheck=undefined","time":"2022-10-28T07:03:37.149Z","v":0} {"name":"renovate","hostname":"runner-pt6gmhxg-project-49-concurrent-0","pid":30,"level":20,"logContext":"K3VNfOOLJp2LpFYMSki_1","repository":"backoffice/crm","branch":"renovate/lock-file-maintenance","msg":"recreateClosed is true","time":"2022-10-28T07:03:37.149Z","v":0} {"name":"renovate","hostname":"runner-pt6gmhxg-project-49-concurrent-0","pid":30,"level":20,"logContext":"K3VNfOOLJp2LpFYMSki_1","repository":"backoffice/crm","branch":"renovate/lock-file-maintenance","msg":"Checking schedule(before 10am on friday, Europe/Amsterdam)","time":"2022-10-28T07:03:37.150Z","v":0} {"name":"renovate","hostname":"runner-pt6gmhxg-project-49-concurrent-0","pid":30,"level":20,"logContext":"K3VNfOOLJp2LpFYMSki_1","repository":"backoffice/crm","branch":"renovate/lock-file-maintenance","timezone":"Europe/Amsterdam","msg":"Found timezone","time":"2022-10-28T07:03:37.155Z","v":0} {"name":"renovate","hostname":"runner-pt6gmhxg-project-49-concurrent-0","pid":30,"level":20,"logContext":"K3VNfOOLJp2LpFYMSki_1","repository":"backoffice/crm","branch":"renovate/lock-file-maintenance","msg":"Adjusting now for timezone","time":"2022-10-28T07:03:37.159Z","v":0} {"name":"renovate","hostname":"runner-pt6gmhxg-project-49-concurrent-0","pid":30,"level":20,"logContext":"K3VNfOOLJp2LpFYMSki_1","repository":"backoffice/crm","branch":"renovate/lock-file-maintenance","msg":"Checking 1 schedule(s)","time":"2022-10-28T07:03:37.162Z","v":0} {"name":"renovate","hostname":"runner-pt6gmhxg-project-49-concurrent-0","pid":30,"level":20,"logContext":"K3VNfOOLJp2LpFYMSki_1","repository":"backoffice/crm","branch":"renovate/lock-file-maintenance","parsedSchedule":{"schedules":[{"t_b":[36000],"d":[6]}],"exceptions":[],"error":-1},"msg":"Checking schedule \"before 10am on friday\"","time":"2022-10-28T07:03:37.162Z","v":0} {"name":"renovate","hostname":"runner-pt6gmhxg-project-49-concurrent-0","pid":30,"level":20,"logContext":"K3VNfOOLJp2LpFYMSki_1","repository":"backoffice/crm","branch":"renovate/lock-file-maintenance","msg":"Matches schedule before 10am on friday","time":"2022-10-28T07:03:37.165Z","v":0} {"name":"renovate","hostname":"runner-pt6gmhxg-project-49-concurrent-0","pid":30,"level":20,"logContext":"K3VNfOOLJp2LpFYMSki_1","repository":"backoffice/crm","branch":"renovate/lock-file-maintenance","msg":"Branch needs creating","time":"2022-10-28T07:03:37.165Z","v":0} {"name":"renovate","hostname":"runner-pt6gmhxg-project-49-concurrent-0","pid":30,"level":20,"logContext":"K3VNfOOLJp2LpFYMSki_1","repository":"backoffice/crm","branch":"renovate/lock-file-maintenance","msg":"Using reuseExistingBranch: false","time":"2022-10-28T07:03:37.165Z","v":0} {"name":"renovate","hostname":"runner-pt6gmhxg-project-49-concurrent-0","pid":30,"level":20,"logContext":"K3VNfOOLJp2LpFYMSki_1","repository":"backoffice/crm","branch":"renovate/lock-file-maintenance","msg":"Setting current branch to master","time":"2022-10-28T07:03:37.166Z","v":0} {"name":"renovate","hostname":"runner-pt6gmhxg-project-49-concurrent-0","pid":30,"level":20,"logContext":"K3VNfOOLJp2LpFYMSki_1","repository":"backoffice/crm","branch":"renovate/lock-file-maintenance","branchName":"master","latestCommitDate":"2022-10-28T06:04:46+00:00","msg":"latest commit","time":"2022-10-28T07:03:37.268Z","v":0} {"name":"renovate","hostname":"runner-pt6gmhxg-project-49-concurrent-0","pid":30,"level":20,"logContext":"K3VNfOOLJp2LpFYMSki_1","repository":"backoffice/crm","branch":"renovate/lock-file-maintenance","msg":"manager.getUpdatedPackageFiles() reuseExistingBranch=false","time":"2022-10-28T07:03:37.323Z","v":0} {"name":"renovate","hostname":"runner-pt6gmhxg-project-49-concurrent-0","pid":30,"level":20,"logContext":"K3VNfOOLJp2LpFYMSki_1","repository":"backoffice/crm","branch":"renovate/lock-file-maintenance","msg":"composer.updateArtifacts(composer.json)","time":"2022-10-28T07:03:37.405Z","v":0} {"name":"renovate","hostname":"runner-pt6gmhxg-project-49-concurrent-0","pid":30,"level":20,"logContext":"K3VNfOOLJp2LpFYMSki_1","repository":"backoffice/crm","branch":"renovate/lock-file-maintenance","msg":"Using php constraint from config","time":"2022-10-28T07:03:37.447Z","v":0} {"name":"renovate","hostname":"runner-pt6gmhxg-project-49-concurrent-0","pid":30,"level":20,"logContext":"K3VNfOOLJp2LpFYMSki_1","repository":"backoffice/crm","branch":"renovate/lock-file-maintenance","preCmd":"composer","preArgs":"install --ignore-platform-req ext-apcu --ignore-platform-req ext-decimal --ignore-platform-req ext-imap --ignore-platform-req ext-intl --ignore-platform-req ext-pdo --ignore-platform-req ext-sodium --ignore-platform-req ext-zip --no-ansi --no-interaction","msg":"composer pre-update command","time":"2022-10-28T07:03:37.448Z","v":0} {"name":"renovate","hostname":"runner-pt6gmhxg-project-49-concurrent-0","pid":30,"level":20,"logContext":"K3VNfOOLJp2LpFYMSki_1","repository":"backoffice/crm","branch":"renovate/lock-file-maintenance","cmd":"composer","args":"update --ignore-platform-req ext-apcu --ignore-platform-req ext-decimal --ignore-platform-req ext-imap --ignore-platform-req ext-intl --ignore-platform-req ext-pdo --ignore-platform-req ext-sodium --ignore-platform-req ext-zip --no-ansi --no-interaction","msg":"composer command","time":"2022-10-28T07:03:37.448Z","v":0} {"name":"renovate","hostname":"runner-pt6gmhxg-project-49-concurrent-0","pid":30,"level":20,"logContext":"K3VNfOOLJp2LpFYMSki_1","repository":"backoffice/crm","branch":"renovate/lock-file-maintenance","msg":"Setting CONTAINERBASE_CACHE_DIR to /cache/renovate/a2b/cache/containerbase","time":"2022-10-28T07:03:37.449Z","v":0} {"name":"renovate","hostname":"runner-pt6gmhxg-project-49-concurrent-0","pid":30,"level":20,"logContext":"K3VNfOOLJp2LpFYMSki_1","repository":"backoffice/crm","branch":"renovate/lock-file-maintenance","image":"php","msg":"Using docker to execute","time":"2022-10-28T07:03:37.450Z","v":0} {"name":"renovate","hostname":"runner-pt6gmhxg-project-49-concurrent-0","pid":30,"level":20,"logContext":"K3VNfOOLJp2LpFYMSki_1","repository":"backoffice/crm","branch":"renovate/lock-file-maintenance","host":"api.github.com","msg":"No throttle","time":"2022-10-28T07:03:37.454Z","v":0} {"name":"renovate","hostname":"runner-pt6gmhxg-project-49-concurrent-0","pid":30,"level":20,"logContext":"K3VNfOOLJp2LpFYMSki_1","repository":"backoffice/crm","branch":"renovate/lock-file-maintenance","host":"api.github.com","msg":"No concurrency limits","time":"2022-10-28T07:03:37.455Z","v":0} {"name":"renovate","hostname":"runner-pt6gmhxg-project-49-concurrent-0","pid":30,"level":20,"logContext":"K3VNfOOLJp2LpFYMSki_1","repository":"backoffice/crm","branch":"renovate/lock-file-maintenance","toolName":"composer","constraint":"^2.3","resolvedVersion":"2.4.4","msg":"Resolved stable matching version","time":"2022-10-28T07:03:39.030Z","v":0} {"name":"renovate","hostname":"runner-pt6gmhxg-project-49-concurrent-0","pid":30,"level":20,"logContext":"K3VNfOOLJp2LpFYMSki_1","repository":"backoffice/crm","branch":"renovate/lock-file-maintenance","msg":"containerbaseDir is inside cacheDir","time":"2022-10-28T07:03:39.030Z","v":0} {"name":"renovate","hostname":"runner-pt6gmhxg-project-49-concurrent-0","pid":30,"level":20,"logContext":"K3VNfOOLJp2LpFYMSki_1","repository":"backoffice/crm","branch":"renovate/lock-file-maintenance","depName":"docker.a2b-internet.com/renovate-crm/php","scheme":"composer","constraint":"^8.1","msg":"Found version constraint - checking for a compatible image to use","time":"2022-10-28T07:03:39.031Z","v":0} {"name":"renovate","hostname":"runner-pt6gmhxg-project-49-concurrent-0","pid":30,"level":20,"logContext":"K3VNfOOLJp2LpFYMSki_1","repository":"backoffice/crm","branch":"renovate/lock-file-maintenance","depName":"docker.a2b-internet.com/renovate-crm/php","scheme":"composer","constraint":"^8.1","version":"8.1","msg":"Found compatible image version","time":"2022-10-28T07:03:39.063Z","v":0} {"name":"renovate","hostname":"runner-pt6gmhxg-project-49-concurrent-0","pid":30,"level":20,"logContext":"K3VNfOOLJp2LpFYMSki_1","repository":"backoffice/crm","branch":"renovate/lock-file-maintenance","image":"docker.a2b-internet.com/renovate-crm/php","tagConstraint":"^8.1","tagVersioning":"composer","tag":"8.1","msg":"Resolved tag constraint","time":"2022-10-28T07:03:39.064Z","v":0} {"name":"renovate","hostname":"runner-pt6gmhxg-project-49-concurrent-0","pid":30,"level":20,"logContext":"K3VNfOOLJp2LpFYMSki_1","repository":"backoffice/crm","branch":"renovate/lock-file-maintenance","msg":"Fetching Docker image: docker.a2b-internet.com/renovate-crm/php:8.1","time":"2022-10-28T07:03:39.064Z","v":0} {"name":"renovate","hostname":"runner-pt6gmhxg-project-49-concurrent-0","pid":30,"level":20,"logContext":"K3VNfOOLJp2LpFYMSki_1","repository":"backoffice/crm","branch":"renovate/lock-file-maintenance","msg":"Finished fetching Docker image docker.a2b-internet.com/renovate-crm/php:8.1@sha256:fa43d7c38ce5724a6c88b706ac591971154fe4a1d1ee77a9bce76f52e9b94a6d","time":"2022-10-28T07:03:39.383Z","v":0} {"name":"renovate","hostname":"runner-pt6gmhxg-project-49-concurrent-0","pid":30,"level":20,"logContext":"K3VNfOOLJp2LpFYMSki_1","repository":"backoffice/crm","branch":"renovate/lock-file-maintenance","command":"docker run --rm --name=renovate_php --label=renovate_child -v \"/cache/renovate/a2b/repos/gitlab/backoffice/crm\":\"/cache/renovate/a2b/repos/gitlab/backoffice/crm\" -v \"/cache/renovate/a2b/cache\":\"/cache/renovate/a2b/cache\" -e COMPOSER_CACHE_DIR -e COMPOSER_AUTH -e BUILDPACK_CACHE_DIR -e CONTAINERBASE_CACHE_DIR -w \"/cache/renovate/a2b/repos/gitlab/backoffice/crm\" docker.a2b-internet.com/renovate-crm/php:8.1 bash -l -c \"install-tool composer 2.4.4 && composer install --ignore-platform-req ext-apcu --ignore-platform-req ext-decimal --ignore-platform-req ext-imap --ignore-platform-req ext-intl --ignore-platform-req ext-pdo --ignore-platform-req ext-sodium --ignore-platform-req ext-zip --no-ansi --no-interaction && composer update --ignore-platform-req ext-apcu --ignore-platform-req ext-decimal --ignore-platform-req ext-imap --ignore-platform-req ext-intl --ignore-platform-req ext-pdo --ignore-platform-req ext-sodium --ignore-platform-req ext-zip --no-ansi --no-interaction\"","msg":"Executing command","time":"2022-10-28T07:03:39.453Z","v":0} {"name":"renovate","hostname":"runner-pt6gmhxg-project-49-concurrent-0","pid":30,"level":20,"logContext":"K3VNfOOLJp2LpFYMSki_1","repository":"backoffice/crm","branch":"renovate/lock-file-maintenance","err":{"name":"ExecError","cmd":"/bin/sh -c docker run --rm --name=renovate_php --label=renovate_child -v \"/cache/renovate/a2b/repos/gitlab/backoffice/crm\":\"/cache/renovate/a2b/repos/gitlab/backoffice/crm\" -v \"/cache/renovate/a2b/cache\":\"/cache/renovate/a2b/cache\" -e COMPOSER_CACHE_DIR -e COMPOSER_AUTH -e BUILDPACK_CACHE_DIR -e CONTAINERBASE_CACHE_DIR -w \"/cache/renovate/a2b/repos/gitlab/backoffice/crm\" docker.a2b-internet.com/renovate-crm/php:8.1 bash -l -c \"install-tool composer 2.4.4 && composer install --ignore-platform-req ext-apcu --ignore-platform-req ext-decimal --ignore-platform-req ext-imap --ignore-platform-req ext-intl --ignore-platform-req ext-pdo --ignore-platform-req ext-sodium --ignore-platform-req ext-zip --no-ansi --no-interaction && composer update --ignore-platform-req ext-apcu --ignore-platform-req ext-decimal --ignore-platform-req ext-imap --ignore-platform-req ext-intl --ignore-platform-req ext-pdo --ignore-platform-req ext-sodium --ignore-platform-req ext-zip --no-ansi --no-interaction\"","stderr":"> **VERY LONG INCOMPLETE CONTAINER LOG**\n\n at ChildProcess. (/usr/src/app/node_modules/renovate/lib/util/exec/common.ts:99:11)\n at ChildProcess.emit (node:events:525:35)\n at ChildProcess.emit (node:domain:489:12)\n at Process.ChildProcess._handle.onexit (node:internal/child_process:293:12)"},"msg":"rawExec err","time":"2022-10-28T07:04:38.993Z","v":0} {"name":"renovate","hostname":"runner-pt6gmhxg-project-49-concurrent-0","pid":30,"level":20,"logContext":"K3VNfOOLJp2LpFYMSki_1","repository":"backoffice/crm","branch":"renovate/lock-file-maintenance","err":{"name":"ExecError","cmd":"/bin/sh -c docker run --rm --name=renovate_php --label=renovate_child -v \"/cache/renovate/a2b/repos/gitlab/backoffice/crm\":\"/cache/renovate/a2b/repos/gitlab/backoffice/crm\" -v \"/cache/renovate/a2b/cache\":\"/cache/renovate/a2b/cache\" -e COMPOSER_CACHE_DIR -e COMPOSER_AUTH -e BUILDPACK_CACHE_DIR -e CONTAINERBASE_CACHE_DIR -w \"/cache/renovate/a2b/repos/gitlab/backoffice/crm\" docker.a2b-internet.com/renovate-crm/php:8.1 bash -l -c \"install-tool composer 2.4.4 && composer install --ignore-platform-req ext-apcu --ignore-platform-req ext-decimal --ignore-platform-req ext-imap --ignore-platform-req ext-intl --ignore-platform-req ext-pdo --ignore-platform-req ext-sodium --ignore-platform-req ext-zip --no-ansi --no-interaction && composer update --ignore-platform-req ext-apcu --ignore-platform-req ext-decimal --ignore-platform-req ext-imap --ignore-platform-req ext-intl --ignore-platform-req ext-pdo --ignore-platform-req ext-sodium --ignore-platform-req ext-zip --no-ansi --no-interaction\"","stderr":"> **VERY LONG INCOMPLETE CONTAINER LOG**\n\n at ChildProcess. (/usr/src/app/node_modules/renovate/lib/util/exec/common.ts:99:11)\n at ChildProcess.emit (node:events:525:35)\n at ChildProcess.emit (node:domain:489:12)\n at Process.ChildProcess._handle.onexit (node:internal/child_process:293:12)"},"msg":"Failed to generate composer.lock","time":"2022-10-28T07:04:39.055Z","v":0} {"name":"renovate","hostname":"runner-pt6gmhxg-project-49-concurrent-0","pid":30,"level":20,"logContext":"K3VNfOOLJp2LpFYMSki_1","repository":"backoffice/crm","branch":"renovate/lock-file-maintenance","msg":"No package files need updating","time":"2022-10-28T07:04:39.062Z","v":0} {"name":"renovate","hostname":"runner-pt6gmhxg-project-49-concurrent-0","pid":30,"level":20,"logContext":"K3VNfOOLJp2LpFYMSki_1","repository":"backoffice/crm","branch":"renovate/lock-file-maintenance","msg":"No updated lock files in branch","time":"2022-10-28T07:04:39.064Z","v":0} {"name":"renovate","hostname":"runner-pt6gmhxg-project-49-concurrent-0","pid":30,"level":20,"logContext":"K3VNfOOLJp2LpFYMSki_1","repository":"backoffice/crm","branch":"renovate/lock-file-maintenance","msg":"PR has no releaseTimestamp","time":"2022-10-28T07:04:39.064Z","v":0} {"name":"renovate","hostname":"runner-pt6gmhxg-project-49-concurrent-0","pid":30,"level":20,"logContext":"K3VNfOOLJp2LpFYMSki_1","repository":"backoffice/crm","branch":"renovate/lock-file-maintenance","msg":"No files to commit","time":"2022-10-28T07:04:39.065Z","v":0} ```

Have you created a minimal reproduction repository?

No reproduction repository

PhilipAbed commented 1 year ago

@bobvandevijver can you try to rollback renovate version and test it again see if it works on an older version? like renovate version 32.*? i wanna make sure this is a regression

rarkins commented 1 year ago

I'm not sure we can help when you redact the error:

{
  "name": "renovate",
  "hostname": "runner-pt6gmhxg-project-49-concurrent-0",
  "pid": 30,
  "level": 20,
  "logContext": "K3VNfOOLJp2LpFYMSki_1",
  "repository": "backoffice/crm",
  "branch": "renovate/lock-file-maintenance",
  "err": {
    "name": "ExecError",
    "cmd": "/bin/sh -c docker run --rm --name=renovate_php --label=renovate_child -v \"/cache/renovate/a2b/repos/gitlab/backoffice/crm\":\"/cache/renovate/a2b/repos/gitlab/backoffice/crm\" -v \"/cache/renovate/a2b/cache\":\"/cache/renovate/a2b/cache\" -e COMPOSER_CACHE_DIR -e COMPOSER_AUTH -e BUILDPACK_CACHE_DIR -e CONTAINERBASE_CACHE_DIR -w \"/cache/renovate/a2b/repos/gitlab/backoffice/crm\" docker.a2b-internet.com/renovate-crm/php:8.1 bash -l -c \"install-tool composer 2.4.4 && composer install --ignore-platform-req ext-apcu --ignore-platform-req ext-decimal --ignore-platform-req ext-imap --ignore-platform-req ext-intl --ignore-platform-req ext-pdo --ignore-platform-req ext-sodium --ignore-platform-req ext-zip --no-ansi --no-interaction && composer update --ignore-platform-req ext-apcu --ignore-platform-req ext-decimal --ignore-platform-req ext-imap --ignore-platform-req ext-intl --ignore-platform-req ext-pdo --ignore-platform-req ext-sodium --ignore-platform-req ext-zip --no-ansi --no-interaction\"",
    "stderr": "> **VERY LONG INCOMPLETE CONTAINER LOG**

    at ChildProcess.<anonymous> (/usr/src/app/node_modules/renovate/lib/util/exec/common.ts:99:11)
    at ChildProcess.emit (node:events:525:35)
    at ChildProcess.emit (node:domain:489:12)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:293:12)"
  },
  "msg": "rawExec err",
  "time": "2022-10-28T07:04:38.993Z",
  "v": 0
}

Ultimately it's composer failing, not Renovate directly.

bobvandevijver commented 1 year ago

@PhilipAbed The lock file maintenance was already broken for about a month, the previous run with 32.241.5 also failed to create a lockfile maintenance pr (basically ever since https://github.com/schmittjoh/JMSSerializerBundle/releases/tag/4.2.0 became available). Most probably due to the same reason, but the debug logs have already been purged unfortunately and they do not contain the real reason anyways as the stderr buffer seems to be limited in size.

@rarkins That really shouldn't matter. The log in renovate log is incomplete anyways because of the output size of a composer pre-install script, it never showed the actual error which was a cache clear issue at the very end (which I only found by duplicating the full process manually). Couldn't post the full log due to Github limitations once again, but it did not contain the real error.

I worked around the issue by updating the package that caused the cache clear issue manually, after which the expected lockfile maintenance PR was created normally.

github-actions[bot] commented 1 year ago

Hi there,

Get your issue fixed faster by creating a minimal reproduction. This means a repository dedicated to reproducing this issue with the minimal dependencies and config possible.

Before we start working on your issue we need to know exactly what's causing the current behavior. A minimal reproduction helps us with this.

To get started, please read our guide on creating a minimal reproduction.

We may close the issue if you, or someone else, haven't created a minimal reproduction within two weeks. If you need more time, or are stuck, please ask for help or more time in a comment.

Good luck,

The Renovate team

rarkins commented 1 year ago

If you can reproduce it, we can take a look

bobvandevijver commented 1 year ago

@rarkins Here you go: https://github.com/bobvandevijver/renovate-18629. Execution of the full docker command fails for me locally, but you can see that a PR is being opened for a package update which does log that error. The lock file maintenance PR is not opened at all due to "No updated lock files in branch".

Full log of the run and the config can be found in the repo as well, used 34.7.0 (4006ef466) for the run.

rarkins commented 1 year ago

@bobvandevijver do I understand this right?

bobvandevijver commented 1 year ago

@rarkins That is correct.

Also note that the default output log (info log on console) doesn't mention the failure for the lockfile maintenance at all, while it does log a warn message for the normal update PR.

WARN: artifactErrors (repository=bobvandevijver/renovate-18629, branch=renovate/major-jms-serializer)
       "artifactErrors": [
         {
           "lockFile": "composer.lock",
           "stderr": "Command failed: docker run --rm --name=renovate_php --label=renovate_child -v \"C:/Users/bobva/AppData/Local/Temp/renovate/repos/github/bobvandevijver/renovate-18629\":\"C:/Users/bobva/AppData/Local/Temp/renovate/repos/github/bobvandevijver/renovate-18629\" -v \"C:/Users/bobva/AppData/Loca
l/Temp/renovate/cache\":\"C:/Users/bobva/AppData/Local/Temp/renovate/cache\" -e COMPOSER_CACHE_DIR -e COMPOSER_AUTH -e BUILDPACK_CACHE_DIR -e CONTAINERBASE_CACHE_DIR -w \"C:/Users/bobva/AppData/Local/Temp/renovate/repos/github/bobvandevijver/renovate-18629\" docker.io/renovate/php:8.1.12 bash -l -c \"install-to
ol composer 2.4.4 && composer update jms/serializer-bundle --with-dependencies --ignore-platform-req ext-apcu --ignore-platform-req ext-decimal --ignore-platform-req ext-imap --ignore-platform-req ext-intl --ignore-platform-req ext-pdo --ignore-platform-req ext-sodium --ignore-platform-req ext-zip --no-ansi --no-interaction\"\ndocker: Error response from daemon: the working directory 'C:/Users/bobva/AppData/Local/Temp/renovate/repos/github/bobvandevijver/renovate-18629' is invalid, it needs to be an absolute path.\nSee 'docker run --help'.\n"
         }
       ]
viceice commented 1 year ago

you can't use windows mount points for renovate docker mode from windows.

run it from wsl instead or use install mode

bobvandevijver commented 1 year ago

@viceice That doesn't matter for the bug being reported here, if anything it is only convenient as it shows that the errors are being logged when renovate is processing a normal PR.

rarkins commented 1 year ago

I think the best we can do is log a WARN message. If lock file maintenance fails, it means there's no file change, and therefore nothing to raise a PR for. Sound OK?

bobvandevijver commented 1 year ago

Hmm, Gitlab allows the creation of an empty MRs (so, an MR for a source branch that has equal code content to the target branch), but I now see Github does not. That's unfortunate 😔

However, I think that just logging a warning with the runner logs is not a great DX. Not every renovate user has access to those logs.

That's why I believe Renovate should either:

  1. open an issue stating it failed to execute the lock file maintenance command to generate the changes, and therefor could not complete the lock file maintenance
  2. Record the error with the maintenance dashboard, which now just states it's pending (https://github.com/bobvandevijver/renovate-18629/issues/2)

Obviously, this should really only be about an unexpected error state. I believe all dependency managers should exit without an error state when nothing could be updated (just verified this for both composer and yarn).

This way Renovate can notify users there is something wrong with their lock file maintenance configuration, instead of users (like I did) wondering about a lock file maintenance MR that hasn't been created for some time without any clear notice. The dedicated issue would have my preference for this.

rarkins commented 1 year ago

However, I think that just logging a warning with the runner logs is not a great DX. Not every renovate user has access to those logs.

It's not just in the logs. The Dependency Dashboards will include any log warnings and I think also PRs will note that warnings have been raised now.

  1. Record the error with the maintenance dashboard, which now just states it's pending (Dependency Dashboard bobvandevijver/renovate-18629#2)

See above

This way Renovate can notify users there is something wrong with their lock file maintenance configuration, instead of users (like I did) wondering about a lock file maintenance MR that hasn't been created for some time without any clear notice. The dedicated issue would have my preference for this.

I prefer to reuse what we have, which means dashboard

rarkins commented 1 year ago

Resolution: lock file maintenance errors should produce a log warning which is then displayed in the Dependency Dashboard issue