gitlab: git ls-remote --heads https://gitlab-ci-token:... request fails
I’ve followed the tutorial for Gitlab over at https://docs.gitlab.com/ee/ci/examples/semantic-release.html. When running our pipeline, we’re receiving an authentication error. I’ve defined a GITLAB_TOKEN variable with the value set to my Project Access Token value. I’ve defined a NPM_TOKEN variable with the value set to my Personal Access Token value. I’ve defined a GITLAB_URL variable with the value set to ‘https://gitlab.atsgroep.be/’. I’ve defined a GITLAB_PREFIX variable with the value set to ‘/api/v4’.
Gitlab version: 13.3.6-ee (d7bc82f4b06) Gitlab shell version: 13.6.0
semantic-release --debug [7:36:14 AM] [semantic-release] › ℹ Running semantic-release version 17.3.0 2020-12-11T07:36:14.878Z semantic-release:config load config from: /builds/DEV/vanguard/.releaserc.json 2020-12-11T07:36:14.893Z semantic-release:config options values: { branches: [ ‘master’ ], repositoryUrl: ‘https://gitlab-ci-token:[secure]@gitlab.atsgroep.be/DEV/vanguard.git’, tagFormat: ‘v${version}’, plugins: [ ‘@semantic-release/commit-analyzer’, ‘@semantic-release/release-notes-generator’, ‘@semantic-release/gitlab’, ‘@semantic-release/npm’, [ ‘@semantic-release/git’, [Object] ] ], _: [], debug: true, ‘$0’: ‘node_modules/.bin/semantic-release’ } 2020-12-11T07:36:15.386Z semantic-release:plugins options for @semantic-release/gitlab/verifyConditions: {} [7:36:15 AM] [semantic-release] › ✔ Loaded plugin “verifyConditions” from “@semantic-release/gitlab” 2020-12-11T07:36:15.392Z semantic-release:plugins options for @semantic-release/npm/verifyConditions: {} [7:36:15 AM] [semantic-release] › ✔ Loaded plugin “verifyConditions” from “@semantic-release/npm” 2020-12-11T07:36:15.393Z semantic-release:plugins options for @semantic-release/git/verifyConditions: { assets: [ ‘package.json’ ], message: ‘chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}’ } [7:36:15 AM] [semantic-release] › ✔ Loaded plugin “verifyConditions” from “@semantic-release/git” 2020-12-11T07:36:15.394Z semantic-release:plugins options for @semantic-release/commit-analyzer/analyzeCommits: {} [7:36:15 AM] [semantic-release] › ✔ Loaded plugin “analyzeCommits” from “@semantic-release/commit-analyzer” 2020-12-11T07:36:15.395Z semantic-release:plugins options for @semantic-release/release-notes-generator/generateNotes: {} [7:36:15 AM] [semantic-release] › ✔ Loaded plugin “generateNotes” from “@semantic-release/release-notes-generator” 2020-12-11T07:36:15.396Z semantic-release:plugins options for @semantic-release/npm/prepare: {} [7:36:15 AM] [semantic-release] › ✔ Loaded plugin “prepare” from “@semantic-release/npm” 2020-12-11T07:36:15.397Z semantic-release:plugins options for @semantic-release/git/prepare: { assets: [ ‘package.json’ ], message: ‘chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}’ } [7:36:15 AM] [semantic-release] › ✔ Loaded plugin “prepare” from “@semantic-release/git” 2020-12-11T07:36:15.398Z semantic-release:plugins options for @semantic-release/gitlab/publish: {} [7:36:15 AM] [semantic-release] › ✔ Loaded plugin “publish” from “@semantic-release/gitlab” 2020-12-11T07:36:15.399Z semantic-release:plugins options for @semantic-release/npm/publish: {} [7:36:15 AM] [semantic-release] › ✔ Loaded plugin “publish” from “@semantic-release/npm” 2020-12-11T07:36:15.399Z semantic-release:plugins options for @semantic-release/npm/addChannel: {} [7:36:15 AM] [semantic-release] › ✔ Loaded plugin “addChannel” from “@semantic-release/npm” 2020-12-11T07:36:15.426Z semantic-release:get-git-auth-url Verifying ssh auth by attempting to push to https://gitlab-ci-token:[secure]@gitlab.atsgroep.be/DEV/vanguard.git 2020-12-11T07:36:15.655Z semantic-release:git Error: Command failed with exit code 128: git push --dry-run --no-verify https://gitlab-ci-token:[secure]@gitlab.atsgroep.be/DEV/vanguard.git HEAD:master remote: You are not allowed to upload code. fatal: unable to access ‘https://gitlab.atsgroep.be/DEV/vanguard.git/’: The requested URL returned error: 403 at makeError (/builds/DEV/vanguard/node_modules/semantic-release/node_modules/execa/lib/error.js:59:11) at handlePromise (/builds/DEV/vanguard/node_modules/semantic-release/node_modules/execa/index.js:114:26) at process._tickCallback (internal/process/next_tick.js:68:7) 2020-12-11T07:36:15.655Z semantic-release:get-git-auth-url SSH key auth failed, falling back to https. [7:36:15 AM] [semantic-release] › ✖ An error occurred while running semantic-release: { Error: Command failed with exit code 128: git ls-remote --heads https://gitlab-ci-token:[secure]@gitlab.atsgroep.be/DEV/vanguard.git remote: HTTP Basic: Access denied fatal: Authentication failed for ‘https://gitlab.atsgroep.be/DEV/vanguard.git/’ at makeError (/builds/DEV/vanguard/node_modules/semantic-release/node_modules/execa/lib/error.js:59:11) at handlePromise (/builds/DEV/vanguard/node_modules/semantic-release/node_modules/execa/index.js:114:26) at process._tickCallback (internal/process/next_tick.js:68:7) shortMessage: ‘Command failed with exit code 128: git ls-remote --heads https://gitlab-ci-token:[secure]@gitlab.atsgroep.be/DEV/vanguard.git’, command: ‘git ls-remote --heads https://gitlab-ci-token:[secure]@gitlab.atsgroep.be/DEV/vanguard.git’, exitCode: 128, signal: undefined, signalDescription: undefined, stdout: ‘’, stderr: ‘remote: HTTP Basic: Access denied\nfatal: Authentication failed for 'https://gitlab.atsgroep.be/DEV/vanguard.git/\’‘, failed: true, timedOut: [secure], isCanceled: [secure], killed: [secure] } { Error: Command failed with exit code 128: git ls-remote --heads https://gitlab-ci-token:[secure]@gitlab.atsgroep.be/DEV/vanguard.git remote: HTTP Basic: Access denied fatal: Authentication failed for ‘https://gitlab.atsgroep.be/DEV/vanguard.git/’ at makeError (/builds/DEV/vanguard/node_modules/semantic-release/node_modules/execa/lib/error.js:59:11) at handlePromise (/builds/DEV/vanguard/node_modules/semantic-release/node_modules/execa/index.js:114:26) at process._tickCallback (internal/process/next_tick.js:68:7) shortMessage: ‘Command failed with exit code 128: git ls-remote --heads https://gitlab-ci-token:[secure]@gitlab.atsgroep.be/DEV/vanguard.git’, command: ‘git ls-remote --heads https://gitlab-ci-token:[secure]@gitlab.atsgroep.be/DEV/vanguard.git’, exitCode: 128, signal: undefined, signalDescription: undefined, stdout: ‘’, stderr: ‘remote: HTTP Basic: Access denied\nfatal: Authentication failed for 'https://gitlab.atsgroep.be/DEV/vanguard.git/\’’, failed: true, timedOut: [secure], isCanceled: [secure], killed: [secure] }npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! @DEV/vanguard@0.0.1 semantic-release:
semantic-release --debug
npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the @DEV/vanguard@0.0.1 semantic-release script.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 5
- Comments: 20 (8 by maintainers)
I’ve encountered the same issue. Locally, I am not able to successfully run
git ls-remote --heads $url
unless the token is added to the URL as follows:How can I fix this in the config? Without fixing this I am not able to use
semantic-release
with Gitlab CI successfully.Finally got docker working again after it gave up the ghost… Seems to be an issue with certificates, indeed.
Will pass it along to our network/system admin.
@aldrashan Nice, at least that error message is much more informative 👍
I’ll update it first thing tomorrow and try it out. Will report back.