semantic-release / cli

:cl::round_pushpin: Setup automated semver compliant package publishing
MIT License
367 stars 45 forks source link

ERR! 401 without further info (Travis-CI Pro) #348

Open rslemos opened 4 years ago

rslemos commented 4 years ago
$ semantic-release-cli setup
? What is your npm registry? https://registry.npmjs.org/
? What is your npm username? rslemos
? What is your npm password? [hidden]
? What is your GitHub username? rslemos
? What is your GitHub password? [hidden]
? What CI are you using? Travis CI Pro
ERR! semantic-release 401

How do I get more information to debug this issue?

Perhaps 401 is most probably HTTP 401, Unauthorized. But which site gives 401?

rslemos commented 4 years ago

After npm config set loglevel silly,

$ semantic-release-cli setup
verb semantic-release Detected git url: https://github.com/rslemos/http-load.git
? What is your npm registry? https://registry.npmjs.org/
? What is your npm username? rslemos
? What is your npm password? [hidden]
npm verb login before first PUT {
npm verb login   _id: 'org.couchdb.user:rslemos',
npm verb login   name: 'rslemos',
npm verb login   password: 'XXXXX',
npm verb login   type: 'user',
npm verb login   roles: [],
npm verb login   date: '2020-10-18T16:20:03.114Z'
npm verb login }
info semantic-release Successfully created npm token. [redacted]
? What is your GitHub username? rslemos
? What is your GitHub password? [hidden]
info semantic-release Successfully created GitHub token.
? What CI are you using? Travis CI Pro
info semantic-release Could not load Travis CI config for endpoint.
ERR! semantic-release 401
verb semantic-release Writing `package.json`.
info semantic-release Done.

How can I get further info about this error?

exbotanical commented 4 years ago

I experienced this exact issue last night. You'll need to run semantic-release, not semantic-release-cli setup. Grab the package and pass your tokens via the CLI options.

Note: This method won't prompt you with a CI option (it didn't for me, anyway); you'll need to:

  1. Write (or copy over) your own Travis yaml config
  2. Enable your repo on Travis
  3. Add any necessary token variables (e.g. NPM email and token) to said repo/build on Travis before you trigger a build

How do I get more information to debug this issue?

https://github.com/semantic-release/cli/blob/master/src/lib/travis.js#L84

gr2m commented 4 years ago

pretty user it's the same problem as described at https://github.com/semantic-release/cli/issues/351