CanuckT
CanuckT

Reputation: 371

semantic_release failing suddenly on CircleCI - remote: Invalid username or password

When running a check and release on CircleCI, the process started to fail on the release stage using semantic_release. It had been working fine for months.

The error message was:

[3:24:45 AM] [semantic-release] › ✖ An error occurred while running semantic-release: Error: Command failed with exit code 128: git ls-remote --heads https://[secure]@github.com/your_name/repo_name
remote: Invalid username or password.
fatal: Authentication failed for 'https://[secure]@github.com/your_name/repo_name/'

Upvotes: 0

Views: 1794

Answers (1)

CanuckT
CanuckT

Reputation: 371

The error message is a bit misleading here as checking the link to CircleCI and Github showed things were fine.

What was actually failing was the Token used in the environment variables for the project in Circle CI.

We were able to get it working again by:

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 opened a ticket in the semantic-release repo about it: https://github.com/semantic-release/semantic-release/issues/1947

Not sure why it stopped working, but at least it's working again :)

Upvotes: 2

Related Questions