Cannot read property "statusCode" of undefined
See original GitHub issueHello everyone,
i tried to install semantic release with the gitlab pluging but everytime i try to run my container it fails at the “verifyConditions” stage. I already added the GITLAB_TOKEN (Gitlab environment variable), HTTP_PROXY (Gitlab EV), the package.json as well as a stage for my CI/CD Pipeline. I just found one issue where no answer was given. I think at the end it has something to do with the many regulations of my company environment but maybe you can help me.
I work with the gitlab runner, which starts a docker container with all dependencies. If I manipulate the Gitlab project manually with the “git” command it works. Which means the GITLAB_TOKEN works properly.
Pipeline Job:
[10:58:01 AM] [semantic-release] › ℹ Running semantic-release version 15.14.0
2021-02-05T10:58:01.780Z semantic-release:config load config from: /builds/gitlab/andre.kohls/test-automation-template/package.json
2021-02-05T10:58:01.820Z semantic-release:config options values: {
branch: 'master',
repositoryUrl: 'https://gitlab-ci-token:[secure]@[company_workbench_url].de/gitlab/andre.kohls/test-automation-template.git',
tagFormat: 'v${version}',
plugins: [
'@semantic-release/commit-analyzer',
'@semantic-release/release-notes-generator',
'@semantic-release/gitlab'
],
branches: [ 'master', 'versioning', 'next' ],
_: [],
debug: true,
'$0': 'node_modules/.bin/semantic-release'
}
2021-02-05T10:58:02.026Z semantic-release:plugins options for @semantic-release/gitlab/verifyConditions: {}
[10:58:02 AM] [semantic-release] › ✔ Loaded plugin "verifyConditions" from "@semantic-release/gitlab"
2021-02-05T10:58:02.028Z semantic-release:plugins options for @semantic-release/commit-analyzer/analyzeCommits: {}
2021-02-05T10:58:02.028Z semantic-release:plugins options for @semantic-release/release-notes-generator/generateNotes: {}
[10:58:02 AM] [semantic-release] › ✔ Loaded plugin "analyzeCommits" from "@semantic-release/commit-analyzer"
[10:58:02 AM] [semantic-release] › ✔ Loaded plugin "generateNotes" from "@semantic-release/release-notes-generator"
[10:58:02 AM] [semantic-release] › ✔ Loaded plugin "publish" from "@semantic-release/gitlab"
2021-02-05T10:58:02.028Z semantic-release:plugins options for @semantic-release/gitlab/publish: {}
[10:58:02 AM] [semantic-release] › ✔ Run automated release from branch master
2021-02-05T10:58:02.422Z semantic-release:git Error: Command failed with exit code 128: git push --dry-run https://gitlab-ci-token:[secure]@[company_workbench_url]/gitlab/andre.kohls/test-automation-template.git HEAD:master
at makeError (/builds/gitlab/andre.kohls/test-automation-template/node_modules/execa/lib/error.js:56:11)
at handlePromise (/builds/gitlab/andre.kohls/test-automation-template/node_modules/execa/index.js:114:26)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async verifyAuth (/builds/gitlab/andre.kohls/test-automation-template/node_modules/semantic-release/lib/git.js:123:5)
at async module.exports (/builds/gitlab/andre.kohls/test-automation-template/node_modules/semantic-release/lib/get-git-auth-url.js:43:5)
at async run (/builds/gitlab/andre.kohls/test-automation-template/node_modules/semantic-release/index.js:62:27)
at async module.exports (/builds/gitlab/andre.kohls/test-automation-template/node_modules/semantic-release/index.js:176:22)
at async module.exports (/builds/gitlab/andre.kohls/test-automation-template/node_modules/semantic-release/cli.js:55:5)
[10:58:02 AM] [semantic-release] › ✔ Allowed to push to the Git repository
[10:58:02 AM] [semantic-release] › ℹ Start step "verifyConditions" of plugin "@semantic-release/gitlab"
2021-02-05T10:58:02.773Z semantic-release:gitlab apiUrl: 'https://[company_workbench_url]/gitlab/api/v4'
2021-02-05T10:58:02.773Z semantic-release:gitlab repoId: 'andre.kohls/test-automation-template'
[10:58:02 AM] [semantic-release] [@semantic-release/gitlab] › ℹ Verify GitLab authentication (https://[company_workbench_url]/gitlab/api/v4)
[10:58:02 AM] [semantic-release] › ✖ Failed step "verifyConditions" of plugin "@semantic-release/gitlab"
[10:58:02 AM] [semantic-release] › ✖ An error occurred while running semantic-release: TypeError: Cannot read property 'statusCode' of undefined
at module.exports (/builds/gitlab/andre.kohls/test-automation-template/node_modules/@semantic-release/gitlab/lib/verify.js:62:26)
at processTicksAndRejections (internal/process/task_queues.js:97:5) {
pluginName: '@semantic-release/gitlab'
}
AggregateError:
TypeError: Cannot read property 'statusCode' of undefined
at module.exports (/builds/gitlab/andre.kohls/test-automation-template/node_modules/@semantic-release/gitlab/lib/verify.js:62:26)
at /builds/gitlab/andre.kohls/test-automation-template/node_modules/semantic-release/lib/plugins/pipeline.js:54:11
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async Object.pluginsConf.<computed> [as verifyConditions] (/builds/gitlab/andre.kohls/test-automation-template/node_modules/semantic-release/lib/plugins/index.js:80:11)
at async run (/builds/gitlab/andre.kohls/test-automation-template/node_modules/semantic-release/index.js:84:3)
at async module.exports (/builds/gitlab/andre.kohls/test-automation-template/node_modules/semantic-release/index.js:176:22)
at async module.exports (/builds/gitlab/andre.kohls/test-automation-template/node_modules/semantic-release/cli.js:55:5)
Cleaning up file based variables
00:01
ERROR: Job failed: exit code 1
package.json:
{
"name": "semantic-release-config",
"release": {
"branches": ["master", "next"],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/gitlab"
]
}
}
gitlab-ci.yml:
release:
image: node:13
stage: release
tags:
- run_docker
before_script:
- npm install semantic-release@15.14.0 @semantic-release/gitlab@6.0.8
script:
- npx semantic-release --debug
I already tried to run semantic-release with the latest version, as well as for each plugin.
I hope you can help me and thanks in advance.
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (4 by maintainers)
Thought so 😕 But I appreciate the help. I already contacted the network admins 😃
Thank you for your help until this point 😉
I’ll close this issue as it seems like the problem lies on our (company) end.
@hahnartefakt Ah, that looks like the root cause to me! The plugin won’t know how to make an API request through the extra layer of authentication imposed by your network.
Unfortunately, I’m not sure the best way to go about solving this 🤔. Perhaps your network admins might have some ideas on how to allow these requests to go through? Sorry I can’t be of more help!