Semantic_release failing suddenly with no changes: "fatal: Authentication failed for 'https://[secure]@github.com/my account/repo/'",

Hi, yesterday the semantic_release failed after a successful test when merging a PR to our staging. The PR was a one line code change unrelated to semantic_release or anything else.

My searched so far have not come up with a solution.

Output:

#!/bin/bash -eo pipefail

npx semantic-release@17
npx: installed 573 in 13.195s
[3:24:45 AM] [semantic-release] › :information_source: Running semantic-release version 17.4.3
[3:24:45 AM] [semantic-release] › :heavy_check_mark: Loaded plugin “verifyConditions” from “@semantic-release/github”
[3:24:45 AM] [semantic-release] › :heavy_check_mark: Loaded plugin “analyzeCommits” from “@semantic-release/commit-analyzer”
[3:24:45 AM] [semantic-release] › :heavy_check_mark: Loaded plugin “generateNotes” from “@semantic-release/release-notes-generator”
[3:24:45 AM] [semantic-release] › :heavy_check_mark: Loaded plugin “publish” from “@semantic-release/github”
[3:24:45 AM] [semantic-release] › :heavy_check_mark: Loaded plugin “addChannel” from “@semantic-release/github”
[3:24:45 AM] [semantic-release] › :heavy_check_mark: Loaded plugin “success” from “@semantic-release/github”
[3:24:45 AM] [semantic-release] › :heavy_check_mark: Loaded plugin “fail” from “@semantic-release/github”
[3:24:45 AM] [semantic-release] › :heavy_multiplication_x: An error occurred while running semantic-release: Error: Command failed with exit code 128: git ls-remote --heads https://[secure]@github.com/tonydehnke/12vBiz
remote: Invalid username or password.
fatal: Authentication failed for ‘https://[secure]@github.com/tonydehnke/12vBiz/’
at makeError (/home/circleci/.npm/_npx/263/lib/node_modules/semantic-release/node_modules/execa/lib/error.js:59:11)
at handlePromise (/home/circleci/.npm/_npx/263/lib/node_modules/semantic-release/node_modules/execa/index.js:114:26)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async getBranches (/home/circleci/.npm/_npx/263/lib/node_modules/semantic-release/lib/git.js:66:11)
at async module.exports (/home/circleci/.npm/_npx/263/lib/node_modules/semantic-release/lib/branches/expand.js:6:23)
at async module.exports (/home/circleci/.npm/_npx/263/lib/node_modules/semantic-release/lib/branches/index.js:14:26)
at async run (/home/circleci/.npm/_npx/263/lib/node_modules/semantic-release/index.js:57:22)
at async module.exports (/home/circleci/.npm/_npx/263/lib/node_modules/semantic-release/index.js:260:22)
at async module.exports (/home/circleci/.npm/_npx/263/lib/node_modules/semantic-release/cli.js:55:5) {
shortMessage: ‘Command failed with exit code 128: git ls-remote --heads https://[secure]@github.com/tonydehnke/12vBiz’,
command: ‘git ls-remote --heads https://[secure]@github.com/tonydehnke/12vBiz’,
exitCode: 128,
signal: undefined,
signalDescription: undefined,
stdout: ‘’,
stderr: ‘remote: Invalid username or password.\n’ +
“fatal: Authentication failed for ‘https://[secure]@github.com/tonydehnke/12vBiz/’”,
failed: true,
timedOut: false,
isCanceled: false,
killed: false
}
Error: Command failed with exit code 128: git ls-remote --heads https://[secure]@github.com/tonydehnke/12vBiz
remote: Invalid username or password.
fatal: Authentication failed for ‘https://[secure]@github.com/tonydehnke/12vBiz/’
at makeError (/home/circleci/.npm/_npx/263/lib/node_modules/semantic-release/node_modules/execa/lib/error.js:59:11)
at handlePromise (/home/circleci/.npm/_npx/263/lib/node_modules/semantic-release/node_modules/execa/index.js:114:26)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async getBranches (/home/circleci/.npm/_npx/263/lib/node_modules/semantic-release/lib/git.js:66:11)
at async module.exports (/home/circleci/.npm/_npx/263/lib/node_modules/semantic-release/lib/branches/expand.js:6:23)
at async module.exports (/home/circleci/.npm/_npx/263/lib/node_modules/semantic-release/lib/branches/index.js:14:26)
at async run (/home/circleci/.npm/_npx/263/lib/node_modules/semantic-release/index.js:57:22)
at async module.exports (/home/circleci/.npm/_npx/263/lib/node_modules/semantic-release/index.js:260:22)
at async module.exports (/home/circleci/.npm/_npx/263/lib/node_modules/semantic-release/cli.js:55:5) {
shortMessage: ‘Command failed with exit code 128: git ls-remote --heads https://[secure]@github.com/tonydehnke/12vBiz’,
command: ‘git ls-remote --heads https://[secure]@github.com/tonydehnke/12vBiz’,
exitCode: 128,
signal: undefined,
signalDescription: undefined,
stdout: ‘’,
stderr: ‘remote: Invalid username or password.\n’ +
“fatal: Authentication failed for ‘https://[secure]@github.com/tonydehnke/12vBiz/’”,
failed: true,
timedOut: false,
isCanceled: false,
killed: false
}

Exited with code exit status 1
CircleCI received exit code 1

So was able to resolve this by regenerating the Auth Token in Github

  1. Github:(Settings → Developer settings → Personal Access Tokens → Regenate Token (kept all the settings the same).
  2. Then in Circle CI: Project → Project Settings (top right of screen) → Environment Variables → Delete old token (mine was called GH_TOKEN), and re-add GH_TOKEN with new value created in Github.
  3. Re-run failed Semantic Release and it worked.

I have no idea why the token stopped working. I had not changed it in Github or CircleCI from what it had been for months.

Perhaps the error message could be improved to say that the Token failed? Saying it’s remote: Invalid username or password.\n is not really clear when it’s a bad token.

I added this as an issue in semantic_release repo too: "fatal: Authentication failed for 'https://[secure]@github.com/user/repo/'" - Error 128 - remote: Invalid username or password. · Issue #1947 · semantic-release/semantic-release · GitHub

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.