Npm client failed to login #5772

Closed
kuno opened this Issue Jul 23, 2014 · 15 comments

Comments

Projects
None yet
6 participants

kuno commented Jul 23, 2014

The npm client failed to login www.npmjs.org.

I can use same username/password pair to login in the browser, but the npm client failed to login use them. Here is the error logs

Username: (kuno)
Password: (or leave unchanged)
Email: (this IS public) (neokuno@gmail.com)
npm WARN adduser Incorrect username or password
npm WARN adduser You can reset your account by visiting:
npm WARN adduser
npm WARN adduser     https://npmjs.org/forgot
npm WARN adduser
npm ERR! Error: unauthorized Login first.: -/user/org.couchdb.user:kuno/-rev/10-6e0a87e126466a94adfb9307ec918edc
npm ERR!     at RegClient.<anonymous> (/Users/kuno/.nvm/v0.10.29/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:274:14)
npm ERR!     at Request._callback (/Users/kuno/.nvm/v0.10.29/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:212:65)
npm ERR!     at Request.self.callback (/Users/kuno/.nvm/v0.10.29/lib/node_modules/npm/node_modules/request/request.js:123:22)
npm ERR!     at Request.emit (events.js:98:17)
npm ERR!     at Request.<anonymous> (/Users/kuno/.nvm/v0.10.29/lib/node_modules/npm/node_modules/request/request.js:893:14)
npm ERR!     at Request.emit (events.js:117:20)
npm ERR!     at IncomingMessage.<anonymous> (/Users/kuno/.nvm/v0.10.29/lib/node_modules/npm/node_modules/request/request.js:844:12)
npm ERR!     at IncomingMessage.emit (events.js:117:20)
npm ERR!     at _stream_readable.js:929:16
npm ERR!     at process._tickCallback (node.js:419:13)
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR!     <http://github.com/npm/npm/issues>

npm ERR! System Darwin 13.3.0
npm ERR! command "/Users/kuno/.nvm/v0.10.29/bin/node" "/Users/kuno/.nvm/v0.10.29/bin/npm" "login"
npm ERR! cwd /Users/kuno/Hub/kuno/GeoIP
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.14
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/kuno/Hub/kuno/GeoIP/npm-debug.log
npm ERR! not ok code 0

I can't run npm adduser or npm login. I've tried two sets of credentials, both of which I can log into npm.org with without issue. Both sets of credentials return this same error from the command line, same as exhibited above.

npm ERR! Error: unauthorized Name or password is incorrect.: -/user/org.couchdb.user:runspired/-rev/5-01914fa220251739c9db1e953cbeb58c
npm ERR!     at RegClient.<anonymous> (/Users/runspired/.nvm/v0.11.13/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:273:14)
npm ERR!     at Request._callback (/Users/runspired/.nvm/v0.11.13/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:211:65)
npm ERR!     at Request.self.callback (/Users/runspired/.nvm/v0.11.13/lib/node_modules/npm/node_modules/request/request.js:123:22)
npm ERR!     at Request.EventEmitter.emit (events.js:110:17)
npm ERR!     at Request.<anonymous> (/Users/runspired/.nvm/v0.11.13/lib/node_modules/npm/node_modules/request/request.js:893:14)
npm ERR!     at Request.EventEmitter.emit (events.js:129:20)
npm ERR!     at IncomingMessage.<anonymous> (/Users/runspired/.nvm/v0.11.13/lib/node_modules/npm/node_modules/request/request.js:844:12)
npm ERR!     at IncomingMessage.EventEmitter.emit (events.js:129:20)
npm ERR!     at _stream_readable.js:898:16
npm ERR!     at process._tickCallback (node.js:343:11)
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR!     <http://github.com/npm/npm/issues>

npm ERR! System Darwin 13.1.0
npm ERR! command "/Users/runspired/.nvm/v0.11.13/bin/node" "/Users/runspired/.nvm/v0.11.13/bin/npm" "adduser"
npm ERR! cwd /Users/runspired/BitBucket/text2drive/grunt-phantom-svg2png
npm ERR! node -v v0.11.13
npm ERR! npm -v 1.4.9
Contributor

othiym23 commented Jul 24, 2014

Hey @runspired, could you open a separate issue for this? Having these ganged together like this makes it tough for us to make sure that everybody's issues get handled. Also, sorry you're having trouble!

@othiym23 perhaps your suggestion is an NPM community convention (I'm new to this one), but these are the same issue, shouldn't they be addressed together?

rockbot commented Jul 24, 2014

Hey @runspired and @kuno - sorry this is happening :-/

If you update your npm to the latest with sudo npm install npm -g, does that solve your issue?

@rockbot This updated me from 1.4.9 to 1.4.21, but the issue persists.

@rockbot I noticed in another thread that's been closed that some symbols are disallowed on the command line that are allowed on the website for login. I make use of -_+%#()^ regularly in passwords and some of those are in play here. Could this be affecting it? If so, is there documentation on what symbols to avoid somewhere?

UPDATE
Here's another issue that suggests my password's special characters are likely to blame. #5729

I can confirm that changing my password to one without any special characters resolved my issue. Given that this issue and at least 3 other recent tickets and several closed tickets relate to this problem, it would be nice to either update the website password creation to match usable passwords on the commandline or vice-versa.

Contributor

othiym23 commented Jul 24, 2014

@runspired, I completely agree! I'm not sure what's going on here, but I've filed #5782 to make sure this gets handled before 2.0.0 goes final release.

kuno commented Aug 19, 2014

I try to change my password on npmjs.org only contains letter and number, but I still failed to login.

kuno commented Aug 19, 2014

What about this error ???

npm ERR! publish Failed PUT 403
npm ERR! Error: no_perms Private mode enable, only admin can publish this module: geoip

kuno commented Aug 20, 2014

It turns out it my fault to cause this error, because I config npm to use a chinese register server rather than the official one.

If I commented out the the register line in my ~/.npmrc, everything gose well.

Owner

isaacs commented Aug 22, 2014

Can someone please share WHICH "special" characters they were using when they created their account?

Were you creating the account on the website, or on the cli?

I just created a user with the password )(*&^%$#@! and it worked fine. Could even star and unstar a package, so it's able to log in and do stuff on the registry.

Owner

isaacs commented Aug 22, 2014

Note that this was on 1.4.25, so it's entirely possible that there's a bug which was fixed since the original reports.

Owner

isaacs commented Aug 22, 2014

Nope, it's a legit bug. Fix coming shortly.

isaacs added a commit to npm/npm-registry-client that referenced this issue Aug 22, 2014

Handle % signs in auth properly when followed by numbers
A password like '%1234' would be broken and interpreted as '\u000034' in
the request, becuase it is interpreting the %12 as a percent-encoded
hex, and then it gets broken in the conversion to UTF-8.

Fix npm/npm#6008
Fix npm/npm#5729
Fix npm/npm#5772
Fix npm/npm#5682

Related to npm/npm#5782, but not a fix, since that issue is asking for
the npm client and website to have the *same* set of rules, and this
commit does not guarantee that that is the case.

@isaacs isaacs referenced this issue in npm/npm-registry-client Aug 22, 2014

Merged

Handle % signs in auth properly when followed by numbers #63

isaacs added a commit to npm/npm-registry-client that referenced this issue Aug 22, 2014

Handle % signs in auth properly when followed by numbers
A password like '%1234' would be broken and interpreted as '\u000034' in
the request, becuase it is interpreting the %12 as a percent-encoded
hex, and then it gets broken in the conversion to UTF-8.

Fix npm/npm#6008
Fix npm/npm#5729
Fix npm/npm#5772
Fix npm/npm#5682

Related to npm/npm#5782, but not a fix, since that issue is asking for
the npm client and website to have the *same* set of rules, and this
commit does not guarantee that that is the case.

Forward-ported from the fix on the v2.0 branch: 62f04f0

@isaacs isaacs referenced this issue in npm/npm-registry-client Aug 22, 2014

Merged

Handle % signs in auth properly when followed by numbers #64

othiym23 added a commit that referenced this issue Aug 22, 2014

npm-registry-client@2.0.7
Properly encode % in passwords. Fixes #5772 in 1.4.

@othiym23 othiym23 added the support label Sep 22, 2014

dYb commented Oct 14, 2014

I have a same problem. thanks to @kuno

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment