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.58k stars 2.31k forks source link

Failed to update container image in gitlab-ci file #10949

Closed AKorezin closed 1 year ago

AKorezin commented 3 years ago

How are you running Renovate?

If using the hosted app, please skip to the next section. Otherwise, if self-hosted, please complete the following:

Please select which platform you are using:

Renovate version: 25.26.10

Describe the bug

Renovate bot fails to update container image version in .gitlab-ci.yml if file is included multiple times in other .gitlab-ci.yml. Maybe this issue is related only to services: part, because previously there was successful update of image:.

Relevant debug logs

Click me to see logs ``` DEBUG: Using RE2 as regex engine DEBUG: Parsing configs DEBUG: Checking for config file in /builds/AKorezin-renovate-bot/renovate-runner/config DEBUG: No config file found on disk - skipping DEBUG: Enabling debug logging to renovate-log.ndjson DEBUG: File config "config": {} DEBUG: CLI config "config": {"repositories": ["AKorezin/renovate-docker-dind-gitlab-ci"]} DEBUG: Env config "config": { "hostRules": [ {"hostType": "github", "matchHost": "github.com", "token": "***********"}, { "hostType": "docker", "matchHost": "env.ci.runner.short", "token": "***********" } ], "extends": ["github>whitesource/merge-confidence:beta"], "repositoryCache": "true", "binarySource": "docker", "baseDir": "/builds/AKorezin-renovate-bot/renovate-runner/renovate", "logFile": "renovate-log.ndjson", "logFileLevel": "debug", "onboarding": false, "onboardingConfig": { "$schema": "https://docs.renovatebot.com/renovate-schema.json", "extends": ["config:base"] }, "requireConfig": true, "optimizeForDisabled": true, "platform": "gitlab", "endpoint": "https://gitlab.com/api/v4", "token": "***********", "gitAuthor": "Renovate Bot ", "ignorePrAuthor": true } DEBUG: Combined config "config": { "hostRules": [ {"hostType": "github", "matchHost": "github.com", "token": "***********"}, { "hostType": "docker", "matchHost": "env.ci.runner.short", "token": "***********" } ], "extends": ["github>whitesource/merge-confidence:beta"], "repositoryCache": "true", "binarySource": "docker", "baseDir": "/builds/AKorezin-renovate-bot/renovate-runner/renovate", "logFile": "renovate-log.ndjson", "logFileLevel": "debug", "onboarding": false, "onboardingConfig": { "$schema": "https://docs.renovatebot.com/renovate-schema.json", "extends": ["config:base"] }, "requireConfig": true, "optimizeForDisabled": true, "platform": "gitlab", "endpoint": "https://gitlab.com/api/v4", "token": "***********", "gitAuthor": "Renovate Bot ", "ignorePrAuthor": true, "repositories": ["AKorezin/renovate-docker-dind-gitlab-ci"] } DEBUG: Adding trailing slash to endpoint DEBUG: GitLab version is: 14.2.0 DEBUG: Using configured gitAuthor (Renovate Bot ) DEBUG: Adding token authentication for gitlab.com to hostRules DEBUG: Using configured baseDir: /builds/AKorezin-renovate-bot/renovate-runner/renovate DEBUG: Using cacheDir: /builds/AKorezin-renovate-bot/renovate-runner/renovate/cache DEBUG: Initializing Renovate internal cache into /builds/AKorezin-renovate-bot/renovate-runner/renovate/cache/renovate/renovate-cache-v1 DEBUG: Commits limit = null DEBUG: Clearing hostRules DEBUG: Adding token authentication for github.com to hostRules DEBUG: Adding token authentication for env.ci.runner.short to hostRules DEBUG: Adding token authentication for gitlab.com to hostRules DEBUG: No dangling containers to remove INFO: Repository started (repository=AKorezin/renovate-docker-dind-gitlab-ci) "renovateVersion": "25.56.10" DEBUG: Using localDir: /builds/AKorezin-renovate-bot/renovate-runner/renovate/repos/gitlab/AKorezin/renovate-docker-dind-gitlab-ci (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: AKorezin/renovate-docker-dind-gitlab-ci default branch = master (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Enabling Git FS (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: AKorezin/renovate-docker-dind-gitlab-ci http URL = https://gitlab.com/AKorezin/renovate-docker-dind-gitlab-ci.git (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: GitLab API 404 (repository=AKorezin/renovate-docker-dind-gitlab-ci) "url": "https://gitlab.com/api/v4/projects/AKorezin%2Frenovate-docker-dind-gitlab-ci/repository/files/renovate.json?ref=HEAD" DEBUG: resetMemCache() (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Resetting npmrc (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: checkOnboarding() (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: isOnboarded() (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: findFile(renovate.json) (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Initializing git repository into /builds/AKorezin-renovate-bot/renovate-runner/renovate/repos/gitlab/AKorezin/renovate-docker-dind-gitlab-ci (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: git clone completed (repository=AKorezin/renovate-docker-dind-gitlab-ci) "durationMs": 479 DEBUG: latest repository commit (repository=AKorezin/renovate-docker-dind-gitlab-ci) "latestCommit": { "hash": "44463bb893e1b369ce836f0c16c22bb44829150a", "date": "2021-07-24T11:15:43+03:00", "message": "Optimize test repo", "refs": "HEAD -> master, origin/master, origin/HEAD", "body": "", "author_name": "AKorezin", "author_email": "3751653-AKorezin@users.noreply.gitlab.com" } DEBUG: Setting git author name (repository=AKorezin/renovate-docker-dind-gitlab-ci) "gitAuthorName": "Renovate Bot" DEBUG: Setting git author email (repository=AKorezin/renovate-docker-dind-gitlab-ci) "gitAuthorEmail": "bot@renovateapp.com" DEBUG: findFile(renovate.json5) (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: findFile(.github/renovate.json) (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: findFile(.github/renovate.json5) (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: findFile(.gitlab/renovate.json) (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Config file exists (repository=AKorezin/renovate-docker-dind-gitlab-ci) "fileName": ".gitlab/renovate.json" DEBUG: ensureIssueClosing() (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Repo is onboarded (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Found .gitlab/renovate.json config file (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Repository config (repository=AKorezin/renovate-docker-dind-gitlab-ci) "fileName": ".gitlab/renovate.json", "config": { "extends": [ "config:base", ":pinAllExceptPeerDependencies", ":dependencyDashboard" ], "pinDigests": true, "separateMinorPatch": true } DEBUG: migrateAndValidate() (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: No config migration necessary (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: massaged config (repository=AKorezin/renovate-docker-dind-gitlab-ci) "config": { "extends": [ "github>whitesource/merge-confidence:beta", "config:base", ":pinAllExceptPeerDependencies", ":dependencyDashboard" ], "pinDigests": true, "separateMinorPatch": true } DEBUG: migrated config (repository=AKorezin/renovate-docker-dind-gitlab-ci) "config": { "extends": [ "github>whitesource/merge-confidence:beta", "config:base", ":pinAllExceptPeerDependencies", ":dependencyDashboard" ], "pinDigests": true, "separateMinorPatch": true } DEBUG: Setting hostRules from config (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Found repo ignorePaths (repository=AKorezin/renovate-docker-dind-gitlab-ci) "ignorePaths": [ "**/node_modules/**", "**/bower_components/**", "**/vendor/**", "**/examples/**", "**/__tests__/**", "**/test/**", "**/tests/**", "**/__fixtures__/**" ] DEBUG: detectSemanticCommits() (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: getCommitMessages (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Semantic commits detection: unknown (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: No semantic commits detected (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Setting branchPrefix: renovate/ (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: No vulnerability alerts found (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: findIssue(Dependency Dashboard) (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: No baseBranches (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: extract() (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Setting current branch to master (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: latest commit (repository=AKorezin/renovate-docker-dind-gitlab-ci) "branchName": "master", "latestCommitDate": "2021-07-24T11:15:43+03:00" DEBUG: Using file match: (^|/)tasks/[^/]+\.ya?ml$ for manager ansible (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Using file match: (^|/)requirements\.ya?ml$ for manager ansible-galaxy (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Using file match: (^|/)galaxy\.ya?ml$ for manager ansible-galaxy (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Using file match: azure.*pipelines?.*\.ya?ml$ for manager azure-pipelines (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Using file match: (^|/)batect(-bundle)?\.yml$ for manager batect (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Using file match: (^|/)batect$ for manager batect-wrapper (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Using file match: (^|/)WORKSPACE(|\.bazel)$ for manager bazel (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Using file match: \.bzl$ for manager bazel (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Using file match: buildkite\.ya?ml for manager buildkite (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Using file match: \.buildkite/.+\.ya?ml$ for manager buildkite (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Using file match: (^|/)Gemfile$ for manager bundler (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Using file match: \.cake$ for manager cake (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Using file match: (^|/)Cargo.toml$ for manager cargo (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Using file match: (^|/).circleci/config.yml$ for manager circleci (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Using file match: (^|/)cloudbuild.ya?ml for manager cloudbuild (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Using file match: (^|/)Podfile$ for manager cocoapods (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Using file match: (^|/)([\w-]*)composer.json$ for manager composer (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Using file match: (^|/)deps\.edn$ for manager deps-edn (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Using file match: (^|/)docker-compose[^/]*\.ya?ml$ for manager docker-compose (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Using file match: (^|/|\.)Dockerfile$ for manager dockerfile (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Using file match: (^|/)Dockerfile\.[^/]*$ for manager dockerfile (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Using file match: (^|/).drone.yml$ for manager droneci (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Using file match: (^|/).gitmodules$ for manager git-submodules (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Using file match: ^(workflow-templates|\.github\/workflows)\/[^/]+\.ya?ml$ for manager github-actions (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Using file match: \.gitlab-ci\.yml$ for manager gitlabci (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Using file match: ^\.gitlab-ci\.yml$ for manager gitlabci-include (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Using file match: (^|/)go.mod$ for manager gomod (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Using file match: \.gradle(\.kts)?$ for manager gradle (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Using file match: (^|/)gradle.properties$ for manager gradle (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Using file match: (^|/)gradle.properties$ for manager gradle-lite (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Using file match: \.gradle(\.kts)?$ for manager gradle-lite (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Using file match: (^|/)gradle/wrapper/gradle-wrapper.properties$ for manager gradle-wrapper (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Using file match: (^|/)requirements\.yaml$ for manager helm-requirements (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Using file match: (^|/)values.yaml$ for manager helm-values (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Using file match: (^|/)helmfile.yaml$ for manager helmfile (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Using file match: (^|/)Chart.yaml$ for manager helmv3 (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Using file match: ^Formula/[^/]+[.]rb$ for manager homebrew (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Using file match: \.html?$ for manager html (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Using file match: (^|/)plugins\.(txt|ya?ml)$ for manager jenkins (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Using file match: (^|/)kustomization\.yaml for manager kustomize (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Using file match: (^|/)project\.clj$ for manager leiningen (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Using file match: \.pom\.xml$ for manager maven (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Using file match: (^|/)pom\.xml$ for manager maven (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Using file match: (^|/)package.js$ for manager meteor (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Using file match: (^|/)mix\.exs$ for manager mix (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Using file match: (^|/).node-version$ for manager nodenv (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Using file match: (^|/)package.json$ for manager npm (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Using file match: \.(?:cs|fs|vb)proj$ for manager nuget (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Using file match: \.(?:props|targets)$ for manager nuget (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Using file match: \.config\/dotnet-tools\.json$ for manager nuget (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Using file match: (^|/)\.nvmrc$ for manager nvm (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Using file match: (^|/)([\w-]*)requirements\.(txt|pip)$ for manager pip_requirements (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Using file match: (^|/)setup.py$ for manager pip_setup (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Using file match: (^|/)Pipfile$ for manager pipenv (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Using file match: (^|/)pyproject\.toml$ for manager poetry (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Using file match: (^|/)\.pre-commit-config\.yaml$ for manager pre-commit (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Using file match: (^|/)pubspec\.ya?ml$ for manager pub (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Using file match: (^|/).python-version$ for manager pyenv (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Using file match: (^|/)\.ruby-version$ for manager ruby-version (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Using file match: \.sbt$ for manager sbt (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Using file match: project/[^/]*.scala$ for manager sbt (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Using file match: (^|/)setup\.cfg$ for manager setup-cfg (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Using file match: (^|/)Package\.swift for manager swift (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Using file match: \.tf$ for manager terraform (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Using file match: (^|/)\.terraform-version$ for manager terraform-version (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Using file match: (^|/)terragrunt\.hcl$ for manager terragrunt (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Using file match: (^|/)\.terragrunt-version$ for manager terragrunt-version (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Using file match: ^.travis.yml$ for manager travis (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Matched 2 file(s) for manager gitlabci: 1/.gitlab-ci.yml, 2/.gitlab-ci.yml (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Found gitlabci package files (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Found 2 package file(s) (repository=AKorezin/renovate-docker-dind-gitlab-ci) INFO: Dependency extraction complete (repository=AKorezin/renovate-docker-dind-gitlab-ci) "baseBranch": "master", "stats": { "managers": {"gitlabci": {"fileCount": 2, "depCount": 4}}, "total": {"fileCount": 2, "depCount": 4} } DEBUG: getLabels(https://index.docker.io, library/docker, latest) (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: getManifestResponse(https://index.docker.io, library/docker, latest) (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: getManifestResponse(https://index.docker.io, library/docker, sha256:63cb2df6dfe1fb041b952ddb9f75c69569331fa39577bc41a3e56cf8f79f7e2e) (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: getDigest(https://index.docker.io, library/docker, 20.10.7) (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: getDigest(https://index.docker.io, library/docker, 20.10.7-dind) (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: getDigest(https://index.docker.io, library/docker, 20.10.7) (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: getDigest(https://index.docker.io, library/docker, 20.10.7-dind) (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: getManifestResponse(https://index.docker.io, library/docker, 20.10.7) (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: getManifestResponse(https://index.docker.io, library/docker, 20.10.7) (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: getManifestResponse(https://index.docker.io, library/docker, 20.10.7-dind) (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: getManifestResponse(https://index.docker.io, library/docker, 20.10.7-dind) (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Got docker digest (repository=AKorezin/renovate-docker-dind-gitlab-ci) "digest": "sha256:b36fdccb118bfaa8d5026da5183a077b87bc790051fcd2c5686bfb8f7fa2563c" DEBUG: Got docker digest (repository=AKorezin/renovate-docker-dind-gitlab-ci) "digest": "sha256:b36fdccb118bfaa8d5026da5183a077b87bc790051fcd2c5686bfb8f7fa2563c" DEBUG: Got docker digest (repository=AKorezin/renovate-docker-dind-gitlab-ci) "digest": "sha256:bfc499cef26daa22da31b76be1752813a6921ee1fa1dd1f56d4fdf19c701d332" DEBUG: Got docker digest (repository=AKorezin/renovate-docker-dind-gitlab-ci) "digest": "sha256:bfc499cef26daa22da31b76be1752813a6921ee1fa1dd1f56d4fdf19c701d332" DEBUG: Package releases lookups complete (repository=AKorezin/renovate-docker-dind-gitlab-ci) "baseBranch": "master" DEBUG: branchifyUpgrades (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: 2 flattened updates found: docker, docker (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Returning 1 branch(es) (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: config.repoIsOnboarded=true (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: packageFiles with updates (repository=AKorezin/renovate-docker-dind-gitlab-ci) "config": { "gitlabci": [ { "packageFile": "2/.gitlab-ci.yml", "deps": [ { "depName": "docker", "currentValue": "20.10.7", "currentDigest": "sha256:bfc499cef26daa22da31b76be1752813a6921ee1fa1dd1f56d4fdf19c701d332", "replaceString": "docker:20.10.7@sha256:bfc499cef26daa22da31b76be1752813a6921ee1fa1dd1f56d4fdf19c701d332", "autoReplaceStringTemplate": "{{depName}}{{#if newValue}}:{{newValue}}{{/if}}{{#if newDigest}}@{{newDigest}}{{/if}}", "datasource": "docker", "depType": "image", "depIndex": 0, "updates": [], "warnings": [], "versioning": "docker", "currentVersion": "20.10.7", "fixedVersion": "20.10.7" }, { "depName": "docker", "currentValue": "20.10.7-dind", "currentDigest": "sha256:4e1e22f471afc7ed5e024127396f56db392c1b6fc81fc0c05c0e072fb51909fe", "replaceString": "docker:20.10.7-dind@sha256:4e1e22f471afc7ed5e024127396f56db392c1b6fc81fc0c05c0e072fb51909fe", "autoReplaceStringTemplate": "{{depName}}{{#if newValue}}:{{newValue}}{{/if}}{{#if newDigest}}@{{newDigest}}{{/if}}", "datasource": "docker", "depType": "service-image", "depIndex": 1, "updates": [ { "updateType": "digest", "newValue": "20.10.7-dind", "newDigest": "sha256:b36fdccb118bfaa8d5026da5183a077b87bc790051fcd2c5686bfb8f7fa2563c", "branchName": "renovate/docker-20.10.7-dind" } ], "warnings": [], "versioning": "docker", "currentVersion": "20.10.7", "fixedVersion": "20.10.7-dind" } ] }, { "packageFile": "/2/.gitlab-ci.yml", "deps": [ { "depName": "docker", "currentValue": "20.10.7", "currentDigest": "sha256:bfc499cef26daa22da31b76be1752813a6921ee1fa1dd1f56d4fdf19c701d332", "replaceString": "docker:20.10.7@sha256:bfc499cef26daa22da31b76be1752813a6921ee1fa1dd1f56d4fdf19c701d332", "autoReplaceStringTemplate": "{{depName}}{{#if newValue}}:{{newValue}}{{/if}}{{#if newDigest}}@{{newDigest}}{{/if}}", "datasource": "docker", "depType": "image", "depIndex": 0, "updates": [], "warnings": [], "versioning": "docker", "currentVersion": "20.10.7", "fixedVersion": "20.10.7" }, { "depName": "docker", "currentValue": "20.10.7-dind", "currentDigest": "sha256:4e1e22f471afc7ed5e024127396f56db392c1b6fc81fc0c05c0e072fb51909fe", "replaceString": "docker:20.10.7-dind@sha256:4e1e22f471afc7ed5e024127396f56db392c1b6fc81fc0c05c0e072fb51909fe", "autoReplaceStringTemplate": "{{depName}}{{#if newValue}}:{{newValue}}{{/if}}{{#if newDigest}}@{{newDigest}}{{/if}}", "datasource": "docker", "depType": "service-image", "depIndex": 1, "updates": [ { "updateType": "digest", "newValue": "20.10.7-dind", "newDigest": "sha256:b36fdccb118bfaa8d5026da5183a077b87bc790051fcd2c5686bfb8f7fa2563c", "branchName": "renovate/docker-20.10.7-dind" } ], "warnings": [], "versioning": "docker", "currentVersion": "20.10.7", "fixedVersion": "20.10.7-dind" } ] } ] } DEBUG: processRepo() (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Processing 1 branch: renovate/docker-20.10.7-dind (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Calculating hourly PRs remaining (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: currentHourStart=2021-07-24T08:00:00.000+00:00 (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: PR hourly limit remaining: 2 (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Calculating prConcurrentLimit (20) (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: getBranchPr(renovate/docker-20.10.7-dind) (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: findPr(renovate/docker-20.10.7-dind, undefined, open) (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: 0 PRs are currently open (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: PR concurrent limit remaining: 20 (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Calculated maximum PRs remaining this run (repository=AKorezin/renovate-docker-dind-gitlab-ci) "prsRemaining": 2 DEBUG: PullRequests limit = 2 (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Calculating hourly PRs remaining (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: currentHourStart=2021-07-24T08:00:00.000+00:00 (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: PR hourly limit remaining: 2 (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Calculating branchConcurrentLimit (20) (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: 0 already existing branches found: (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Branch concurrent limit remaining: 20 (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Calculated maximum branches remaining this run (repository=AKorezin/renovate-docker-dind-gitlab-ci) "branchesRemaining": 2 DEBUG: Branches limit = 2 (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Setting current branch to master (repository=AKorezin/renovate-docker-dind-gitlab-ci, branch=renovate/docker-20.10.7-dind) DEBUG: latest commit (repository=AKorezin/renovate-docker-dind-gitlab-ci, branch=renovate/docker-20.10.7-dind) "branchName": "master", "latestCommitDate": "2021-07-24T11:15:43+03:00" DEBUG: getBranchPr(renovate/docker-20.10.7-dind) (repository=AKorezin/renovate-docker-dind-gitlab-ci, branch=renovate/docker-20.10.7-dind) DEBUG: findPr(renovate/docker-20.10.7-dind, undefined, open) (repository=AKorezin/renovate-docker-dind-gitlab-ci, branch=renovate/docker-20.10.7-dind) DEBUG: branchExists=false (repository=AKorezin/renovate-docker-dind-gitlab-ci, branch=renovate/docker-20.10.7-dind) DEBUG: dependencyDashboardCheck=undefined (repository=AKorezin/renovate-docker-dind-gitlab-ci, branch=renovate/docker-20.10.7-dind) DEBUG: recreateClosed is false (repository=AKorezin/renovate-docker-dind-gitlab-ci, branch=renovate/docker-20.10.7-dind) DEBUG: findPr(renovate/docker-20.10.7-dind, Update docker:20.10.7-dind Docker digest to b36fdcc, !open) (repository=AKorezin/renovate-docker-dind-gitlab-ci, branch=renovate/docker-20.10.7-dind) DEBUG: prAlreadyExisted=false (repository=AKorezin/renovate-docker-dind-gitlab-ci, branch=renovate/docker-20.10.7-dind) DEBUG: Checking schedule(at any time, null) (repository=AKorezin/renovate-docker-dind-gitlab-ci, branch=renovate/docker-20.10.7-dind) DEBUG: No schedule defined (repository=AKorezin/renovate-docker-dind-gitlab-ci, branch=renovate/docker-20.10.7-dind) DEBUG: Branch needs creating (repository=AKorezin/renovate-docker-dind-gitlab-ci, branch=renovate/docker-20.10.7-dind) DEBUG: Using reuseExistingBranch: false (repository=AKorezin/renovate-docker-dind-gitlab-ci, branch=renovate/docker-20.10.7-dind) DEBUG: manager.getUpdatedPackageFiles() reuseExistinbranch=false (repository=AKorezin/renovate-docker-dind-gitlab-ci, branch=renovate/docker-20.10.7-dind) WARN: Error updating branch (repository=AKorezin/renovate-docker-dind-gitlab-ci, branch=renovate/docker-20.10.7-dind) "err": { "message": "Cannot read property 'indexOf' of null", "stack": "TypeError: Cannot read property 'indexOf' of null\n at Object.doAutoReplace (/usr/src/app/node_modules/renovate/lib/workers/branch/auto-replace.ts:143:37)\n at Object.getUpdatedPackageFiles (/usr/src/app/node_modules/renovate/lib/workers/branch/get-updated.ts:99:25)\n at processTicksAndRejections (internal/process/task_queues.js:95:5)\n at Object.processBranch (/usr/src/app/node_modules/renovate/lib/workers/branch/index.ts:350:17)\n at Object.writeUpdates (/usr/src/app/node_modules/renovate/lib/workers/repository/process/write.ts:38:17)\n at Object.update (/usr/src/app/node_modules/renovate/lib/workers/repository/process/extract-update.ts:129:11)\n at Object.renovateRepository (/usr/src/app/node_modules/renovate/lib/workers/repository/index.ts:50:17)\n at Object.start (/usr/src/app/node_modules/renovate/lib/workers/global/index.ts:111:7)\n at /usr/src/app/node_modules/renovate/lib/renovate.ts:16:22" } DEBUG: Ensuring Dependency Dashboard (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: ensureIssue() (repository=AKorezin/renovate-docker-dind-gitlab-ci) INFO: Issue created (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Removing any stale branches (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: config.repoIsOnboarded=true (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: No renovate branches found (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: ensureIssueClosing() (repository=AKorezin/renovate-docker-dind-gitlab-ci) DEBUG: Repository timing splits (milliseconds) (repository=AKorezin/renovate-docker-dind-gitlab-ci) "splits": {"init": 2350, "extract": 765, "lookup": 1477, "update": 220}, "total": 6176 DEBUG: http statistics (repository=AKorezin/renovate-docker-dind-gitlab-ci) "hostStats": [ "api.github.com, 1 request, 120ms request average, 0ms queue average", "auth.docker.io, 1 request, 105ms request average, 1ms queue average", "gitlab.com, 5 requests, 352ms request average, 0ms queue average", "index.docker.io, 7 requests, 126ms request average, 0ms queue average" ], "totalRequests": 14 INFO: Repository finished (repository=AKorezin/renovate-docker-dind-gitlab-ci) "durationMs": 6176 DEBUG: Renovate exiting ```

Have you created a minimal reproduction repository?

https://gitlab.com/AKorezin/renovate-docker-dind-gitlab-ci

Additional context

I use multiple includes hack described here. I also tested this bug with local container with this command docker run -it -e RENOVATE_PLATFORM=gitlab -e LOG_LEVEL=debug -e RENOVATE_TOKEN=token renovate/renovate:25.56-slim renovate AKorezin/renovate-docker-dind-gitlab-ci

viceice commented 3 years ago

Very strange, it failes here: https://github.com/renovatebot/renovate/blob/48c33bee7df993923674da95d9d1a170434b82b2/lib/workers/branch/auto-replace.ts#L143-L143

So existingContent is null | undefined and is passed from here: https://github.com/renovatebot/renovate/blob/3be44469bb98600a8f839887f9cb3c5c6bf975f3/lib/workers/branch/get-updated.ts#L98-L103

viceice commented 3 years ago

i think it because the leading slash at /2/.gitlab-ci.yml.

{
             "packageFile": "/2/.gitlab-ci.yml",
             "deps": [
               {
                 "depName": "docker",
                 "currentValue": "20.10.7",
                 "currentDigest": "sha256:bfc499cef26daa22da31b76be1752813a6921ee1fa1dd1f56d4fdf19c701d332",
                 "replaceString": "docker:20.10.7@sha256:bfc499cef26daa22da31b76be1752813a6921ee1fa1dd1f56d4fdf19c701d332",
                 "autoReplaceStringTemplate": "{{depName}}{{#if newValue}}:{{newValue}}{{/if}}{{#if newDigest}}@{{newDigest}}{{/if}}",
                 "datasource": "docker",
                 "depType": "image",
                 "depIndex": 0,
                 "updates": [],
                 "warnings": [],
                 "versioning": "docker",
                 "currentVersion": "20.10.7",
                 "fixedVersion": "20.10.7"
               },
               {
                 "depName": "docker",
                 "currentValue": "20.10.7-dind",
                 "currentDigest": "sha256:4e1e22f471afc7ed5e024127396f56db392c1b6fc81fc0c05c0e072fb51909fe",
                 "replaceString": "docker:20.10.7-dind@sha256:4e1e22f471afc7ed5e024127396f56db392c1b6fc81fc0c05c0e072fb51909fe",
                 "autoReplaceStringTemplate": "{{depName}}{{#if newValue}}:{{newValue}}{{/if}}{{#if newDigest}}@{{newDigest}}{{/if}}",
                 "datasource": "docker",
                 "depType": "service-image",
                 "depIndex": 1,
                 "updates": [
                   {
                     "updateType": "digest",
                     "newValue": "20.10.7-dind",
                     "newDigest": "sha256:b36fdccb118bfaa8d5026da5183a077b87bc790051fcd2c5686bfb8f7fa2563c",
                     "branchName": "renovate/docker-20.10.7-dind"
                   }
                 ],
                 "warnings": [],
                 "versioning": "docker",
                 "currentVersion": "20.10.7",
                 "fixedVersion": "20.10.7-dind"
               }
             ]

@AKorezin Is the leading slash supported by gitlab-ci?

viceice commented 3 years ago

So getFile fails: https://github.com/renovatebot/renovate/blob/3be44469bb98600a8f839887f9cb3c5c6bf975f3/lib/workers/branch/get-updated.ts#L36-L42

https://github.com/renovatebot/renovate/blob/42f6c5b29549f79431e5ce5d619fbd5453800bfb/lib/util/git/index.ts#L638-L652 as git doesn't know about leading slashes

AKorezin commented 3 years ago

@viceice

I use multiple includes hack described here https://gitlab.com/gitlab-org/gitlab/-/issues/28987.

Yes it is valid syntax. Multiple successive / symbols should be translated to single /. I think this should work like in linux. ls // is equivalent to ls /. Except / path is root of git repo. Also here https://docs.gitlab.com/ee/ci/yaml/includes.html

But if / is used in gitlab-ci script, then it would point to executor root. CI_PROJECT_DIR environment variable points to cloned repository root.

AKorezin commented 3 years ago

Also my small repo is a simplified version of a large repo.

I use the same pattern here. In file /containers/container.gitlab-ci.yml

include:
  - local: "//containers/docker.gitlab-ci.yml"

And include them like in this tests. In file /.gitlab/tests/containers/container.gitlab-ci.yml

include:
  - local: "/containers/container.gitlab-ci.yml"

And the result of such include can be observed in this sub pipeline.

viceice commented 3 years ago

So we just need to trim the leading slash as workaround?

AKorezin commented 3 years ago

And also check other variants of multiple / symbols in different parts of include string. Maybe other sequences like /./ should be also checked.

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

AKorezin commented 1 year ago

Updated reproduction repository at gitlab.com because #17132 fixed leading slashes.