question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot read property "statusCode" of undefined

See original GitHub issue

Hello 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:closed
  • Created 3 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
hahnartefaktcommented, Feb 11, 2021

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.

0reactions
nfriendcommented, Feb 11, 2021

It seems like I get redirected to our Workbench’s" login page Location: https://workbench.something.de/deeplinklogin

@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!

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: Cannot read property 'statusCode' of undefined
The response object might be undefined if no response was received so you have to check that it exists before accessing statusCode ....
Read more >
Cannot read property 'statusCode' of undefined in Synthetic ...
Hi @Sainath.Bommisetty - The error message is stating that response is undefined, which is why it cannot read the statusCode property. It is ......
Read more >
TypeError: Cannot read property 'statusCode' of undefined #6
Does anybody know what might be triggering the error below? My app is not on the call stack when the error occurs, so...
Read more >
Bulk delete recordings, Cannot read property 'statusCode' of ...
Bulk delete recordings, Cannot read property 'statusCode' of undefined ... Hello! I'm trying to use this method https://developer.genesys.cloud/ ...
Read more >
Kibana "cannot read property 'statusCodes' of undefined ...
I'm trying to access my server's kibana dashboard (that works perfectly locally) through an IIS reverse proxy with URL rewrite. Thank you!
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found