Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail on git push --dry-run --no-verify: remote: HTTP Basic: Access denied #259

Closed
EvanCarroll opened this issue Jul 22, 2021 · 4 comments
Closed

Comments

@EvanCarroll
Copy link

EvanCarroll commented Jul 22, 2021

I've tried authenticating with

  • Project Access token
    • w/ just API
    • w/ API & Write Repo
  • Personal Access token with API & Write Repo

I still get failures like this,

[8:13:17 PM] [semantic-release] › ✔  Loaded plugin "publish" from "@semantic-release/gitlab"
2021-07-22T20:13:17.637Z semantic-release:get-git-auth-url Verifying ssh auth by attempting to push to  https://gitlab.awe.eco.cpanel.net/foo/bar.git
2021-07-22T20:13:18.220Z semantic-release:git Error: Command failed with exit code 128: git push --dry-run --no-verify https://gitlab.awe.eco.cpanel.net/foo/bar.git HEAD:main
remote: HTTP Basic: Access denied
fatal: Authentication failed for 'https://gitlab.awe.eco.cpanel.net/foo/bar.git/'
    at makeError (/usr/local/lib/node_modules/semantic-release/node_modules/execa/lib/error.js:60:11)
    at handlePromise (/usr/local/lib/node_modules/semantic-release/node_modules/execa/index.js:118:26)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async verifyAuth (/usr/local/lib/node_modules/semantic-release/lib/git.js:207:5)
    at async module.exports (/usr/local/lib/node_modules/semantic-release/lib/get-git-auth-url.js:91:5)
    at async run (/usr/local/lib/node_modules/semantic-release/index.js:56:27)
    at async module.exports (/usr/local/lib/node_modules/semantic-release/index.js:260:22)
    at async module.exports (/usr/local/lib/node_modules/semantic-release/cli.js:55:5)
2021-07-22T20:13:18.220Z semantic-release:get-git-auth-url SSH key auth failed, falling back to https.
2021-07-22T20:13:19.134Z semantic-release:get-tags found tags for branch main: [ { gitTag: 'v1.0.0', version: '1.0.0', channels: [ null ] } ]

However, with each one of these three tokens I can confirm it works with

git push --dry-run --no-verify https://oauth:GITLAB_TOKEN@gitlab.awe.eco.cpanel.net/foo/bar.git

I guess the questions here are why is semantic-release:git's verifyAuth being called, and why doesn't it use the GITLAB_TOKEN that I provide?

@EvanCarroll
Copy link
Author

EvanCarroll commented Jul 23, 2021

Rundown here

@EvanCarroll
Copy link
Author

If anyone else does the same thing, I would love to see you comment on here and fess up to it. I do wonder how common this is.

@mohit497
Copy link

mohit497 commented Oct 1, 2021

found the same issue today trying to setup CI on github actions

@david-shepard
Copy link

david-shepard commented Oct 14, 2021

I'm not sure if I'm having the exact issue, but definitely having a similar issue. I have GH_TOKEN set and it insists on trying SSH authentication. I see the snippet https://github.com/semantic-release/semantic-release/blob/master/lib/get-git-auth-url.js#L91 trying SSH auth and falling back - but it's causing a failure for me.

18:43:44  2021-10-14T22:43:43.950Z semantic-release:get-git-auth-url Verifying ssh auth by attempting to push to  https://github.ibm.com/<repo name>
18:43:44  2021-10-14T22:43:44.157Z semantic-release:git Error: Command failed with exit code 128: git push --dry-run --no-verify https://github.ibm.com/<repo name> HEAD:master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants