npm adduser Error: Document update conflict. #4361

Closed
sirrice opened this Issue Dec 21, 2013 · 3 comments

Projects

None yet

5 participants

sirrice commented Dec 21, 2013

I lost my .npmrc file and running npm adduser causes the following error.

Reopening. I have same issue. adduser runs using a new dummy account I created, however consistently fails using my existing username "sirrice". I have attempted the following solution

sh -c 'npm config set _auth $( echo "sirrice:chinawhite" | base64 )'

I have also logged in through the web interface successfully and changed my password, and waiting several hours to run adduser again.

Manually fetching my info using https://registry.npmjs.org/-/user/org.couchdb.user:sirrice/-rev/1-4b2e0e629a1196392183a7a63db2a545 returns the following:

{"error":"not_found","reason":"missing"}

The following is the error I receive with loglevel silly:

npm info it worked if it ends with ok
npm verb cli [ '/usr/local/Cellar/node/0.10.18/bin/node',
npm verb cli   '/usr/local/bin/npm',
npm verb cli   'adduser',
npm verb cli   '--loglevel',
npm verb cli   'silly' ]
npm info using npm@1.3.8
npm info using node@v0.10.18
Username: sirrice
Password:
Email: sirrice@gmail.com
npm verb adduser before first PUT { name: 'sirrice',
npm verb adduser   salt: 'XXXXX',
npm verb adduser   password_sha: 'XXXXX',
npm verb adduser   email: 'sirrice@gmail.com',
npm verb adduser   _id: 'org.couchdb.user:sirrice',
npm verb adduser   type: 'user',
npm verb adduser   roles: [],
npm verb adduser   date: '2013-12-21T05:09:01.486Z' }
npm verb url raw /-/user/org.couchdb.user:sirrice
npm verb url resolving [ 'https://registry.npmjs.org/',
npm verb url resolving   './-/user/org.couchdb.user:sirrice' ]
npm verb url resolved https://registry.npmjs.org/-/user/org.couchdb.user:sirrice
npm info trying registry request attempt 1 at 21:09:01
npm http PUT https://registry.npmjs.org/-/user/org.couchdb.user:sirrice
npm http 409 https://registry.npmjs.org/-/user/org.couchdb.user:sirrice
npm verb adduser update existing user
npm verb url raw /-/user/org.couchdb.user:sirrice
npm verb url resolving [ 'https://registry.npmjs.org/',
npm verb url resolving   './-/user/org.couchdb.user:sirrice' ]
npm verb url resolved https://registry.npmjs.org/-/user/org.couchdb.user:sirrice
npm info trying registry request attempt 1 at 21:09:02
npm http GET https://registry.npmjs.org/-/user/org.couchdb.user:sirrice
npm http 200 https://registry.npmjs.org/-/user/org.couchdb.user:sirrice
npm verb adduser userobj { name: 'sirrice',
npm verb adduser   salt: 'XXXXX',
npm verb adduser   password_sha: 'XXXXX',
npm verb adduser   email: 'sirrice@gmail.com',
npm verb adduser   _id: 'org.couchdb.user:sirrice',
npm verb adduser   type: 'user',
npm verb adduser   roles: [],
npm verb adduser   date: '2013-12-21T05:09:01.486Z' }
npm verb url raw /-/user/org.couchdb.user:sirrice/-rev/1-4b2e0e629a1196392183a7a63db2a545
npm verb url resolving [ 'https://registry.npmjs.org/',
npm verb url resolving   './-/user/org.couchdb.user:sirrice/-rev/1-4b2e0e629a1196392183a7a63db2a545' ]
npm verb url resolved https://registry.npmjs.org/-/user/org.couchdb.user:sirrice/-rev/1-4b2e0e629a1196392183a7a63db2a545
npm info trying registry request attempt 1 at 21:09:02
npm http PUT https://registry.npmjs.org/-/user/org.couchdb.user:sirrice/-rev/1-4b2e0e629a1196392183a7a63db2a545
npm http 409 https://registry.npmjs.org/-/user/org.couchdb.user:sirrice/-rev/1-4b2e0e629a1196392183a7a63db2a545
npm verb adduser back [ [Error: conflict Document update conflict.: -/user/org.couchdb.user:sirrice/-rev/1-4b2e0e629a1196392183a7a63db2a545],
npm verb adduser   { error: 'conflict', reason: 'Document update conflict.' },
npm verb adduser   '{"error":"conflict","reason":"Document update conflict."}' ]
npm ERR! Error: conflict Document update conflict.: -/user/org.couchdb.user:sirrice/-rev/1-4b2e0e629a1196392183a7a63db2a545
npm ERR!     at RegClient.<anonymous> (/usr/local/Cellar/node/0.10.18/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:272:14)
npm ERR!     at Request.self.callback (/usr/local/Cellar/node/0.10.18/lib/node_modules/npm/node_modules/request/index.js:148:22)
npm ERR!     at Request.EventEmitter.emit (events.js:98:17)
npm ERR!     at Request.<anonymous> (/usr/local/Cellar/node/0.10.18/lib/node_modules/npm/node_modules/request/index.js:891:14)
npm ERR!     at Request.EventEmitter.emit (events.js:117:20)
npm ERR!     at IncomingMessage.<anonymous> (/usr/local/Cellar/node/0.10.18/lib/node_modules/npm/node_modules/request/index.js:842:12)
npm ERR!     at IncomingMessage.EventEmitter.emit (events.js:117:20)
npm ERR!     at _stream_readable.js:920:16
npm ERR!     at process._tickCallback (node.js:415:13)
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <npm-@googlegroups.com>

npm ERR! System Darwin 12.5.0
npm ERR! command "/usr/local/Cellar/node/0.10.18/bin/node" "/usr/local/bin/npm" "adduser" "--loglevel" "silly"
npm ERR! cwd /Users/sirrice/mitnotes/research/gg/data
npm ERR! node -v v0.10.18
npm ERR! npm -v 1.3.8
npm verb exit [ 1, true ]
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/sirrice/mitnotes/research/gg/data/npm-debug.log
npm ERR! not ok code 0
index0h commented Dec 21, 2013

Have same problem

Prepare .npmrc (from #4090)

index0h@index0h:~$ echo -n "_auth = " > ~/.npmrc
index0h@index0h:~$ echo "index0h:*****" | base64 >> ~/.npmrc
index0h@index0h:~$ echo "email = index.0h@gmail.com" >> ~/.npmrc

Trying to login

index0h@index0h:~$ npm login
Username: (index0h) 
Email: (index.0h@gmail.com) 
npm http PUT https://registry.npmjs.org/-/user/org.couchdb.user:index0h
npm http 409 https://registry.npmjs.org/-/user/org.couchdb.user:index0h
npm http GET https://registry.npmjs.org/-/user/org.couchdb.user:index0h
npm http 200 https://registry.npmjs.org/-/user/org.couchdb.user:index0h
npm http PUT https://registry.npmjs.org/-/user/org.couchdb.user:index0h/-rev/6-1e60ddb3a3647448c149eb6286f6e082
npm http 409 https://registry.npmjs.org/-/user/org.couchdb.user:index0h/-rev/6-1e60ddb3a3647448c149eb6286f6e082
npm ERR! Error: conflict Document update conflict.: -/user/org.couchdb.user:index0h/-rev/6-1e60ddb3a3647448c149eb6286f6e082
npm ERR!     at RegClient.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:275:14)
npm ERR!     at Request.self.callback (/usr/lib/node_modules/npm/node_modules/request/request.js:123:22)
npm ERR!     at Request.EventEmitter.emit (events.js:98:17)
npm ERR!     at Request.<anonymous> (/usr/lib/node_modules/npm/node_modules/request/request.js:893:14)
npm ERR!     at Request.EventEmitter.emit (events.js:117:20)
npm ERR!     at IncomingMessage.<anonymous> (/usr/lib/node_modules/npm/node_modules/request/request.js:844:12)
npm ERR!     at IncomingMessage.EventEmitter.emit (events.js:117:20)
npm ERR!     at _stream_readable.js:920:16
npm ERR!     at process._tickCallback (node.js:415: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/isaacs/npm/issues>

npm ERR! System Linux 3.11.0-14-generic
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "login"
npm ERR! cwd /home/index0h
npm ERR! node -v v0.10.24
npm ERR! npm -v 1.3.21
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/index0h/npm-debug.log
npm ERR! not ok code 0

Detailed log

index0h@index0h:~$ cat npm-debug.log 
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'login' ]
2 info using npm@1.3.21
3 info using node@v0.10.24
4 verbose node symlink /usr/bin/node
5 verbose adduser before first PUT { name: 'index0h',
5 verbose adduser   salt: 'XXXXX',
5 verbose adduser   password_sha: 'XXXXX',
5 verbose adduser   email: 'index.0h@gmail.com',
5 verbose adduser   _id: 'org.couchdb.user:index0h',
5 verbose adduser   type: 'user',
5 verbose adduser   roles: [],
5 verbose adduser   date: '2013-12-21T14:39:07.116Z' }
6 verbose url raw /-/user/org.couchdb.user:index0h
7 verbose url resolving [ 'https://registry.npmjs.org/',
7 verbose url resolving   './-/user/org.couchdb.user:index0h' ]
8 verbose url resolved https://registry.npmjs.org/-/user/org.couchdb.user:index0h
9 info trying registry request attempt 1 at 16:39:07
10 http PUT https://registry.npmjs.org/-/user/org.couchdb.user:index0h
11 http 409 https://registry.npmjs.org/-/user/org.couchdb.user:index0h
12 verbose adduser update existing user
13 verbose url raw /-/user/org.couchdb.user:index0h
14 verbose url resolving [ 'https://registry.npmjs.org/',
14 verbose url resolving   './-/user/org.couchdb.user:index0h' ]
15 verbose url resolved https://registry.npmjs.org/-/user/org.couchdb.user:index0h
16 info trying registry request attempt 1 at 16:39:08
17 http GET https://registry.npmjs.org/-/user/org.couchdb.user:index0h
18 http 200 https://registry.npmjs.org/-/user/org.couchdb.user:index0h
19 verbose adduser userobj { name: 'index0h',
19 verbose adduser   salt: 'XXXXX',
19 verbose adduser   password_sha: 'XXXXX',
19 verbose adduser   email: 'index.0h@gmail.com',
19 verbose adduser   _id: 'org.couchdb.user:index0h',
19 verbose adduser   type: 'user',
19 verbose adduser   roles: [],
19 verbose adduser   date: '2013-12-21T14:39:07.116Z' }
20 verbose url raw /-/user/org.couchdb.user:index0h/-rev/6-1e60ddb3a3647448c149eb6286f6e082
21 verbose url resolving [ 'https://registry.npmjs.org/',
21 verbose url resolving   './-/user/org.couchdb.user:index0h/-rev/6-1e60ddb3a3647448c149eb6286f6e082' ]
22 verbose url resolved https://registry.npmjs.org/-/user/org.couchdb.user:index0h/-rev/6-1e60ddb3a3647448c149eb6286f6e082
23 info trying registry request attempt 1 at 16:39:10
24 http PUT https://registry.npmjs.org/-/user/org.couchdb.user:index0h/-rev/6-1e60ddb3a3647448c149eb6286f6e082
25 http 409 https://registry.npmjs.org/-/user/org.couchdb.user:index0h/-rev/6-1e60ddb3a3647448c149eb6286f6e082
26 verbose adduser back [ [Error: conflict Document update conflict.: -/user/org.couchdb.user:index0h/-rev/6-1e60ddb3a3647448c149eb6286f6e082],
26 verbose adduser   { error: 'conflict', reason: 'Document update conflict.' },
26 verbose adduser   '{"error":"conflict","reason":"Document update conflict."}' ]
27 error Error: conflict Document update conflict.: -/user/org.couchdb.user:index0h/-rev/6-1e60ddb3a3647448c149eb6286f6e082
27 error     at RegClient.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:275:14)
27 error     at Request.self.callback (/usr/lib/node_modules/npm/node_modules/request/request.js:123:22)
27 error     at Request.EventEmitter.emit (events.js:98:17)
27 error     at Request.<anonymous> (/usr/lib/node_modules/npm/node_modules/request/request.js:893:14)
27 error     at Request.EventEmitter.emit (events.js:117:20)
27 error     at IncomingMessage.<anonymous> (/usr/lib/node_modules/npm/node_modules/request/request.js:844:12)
27 error     at IncomingMessage.EventEmitter.emit (events.js:117:20)
27 error     at _stream_readable.js:920:16
27 error     at process._tickCallback (node.js:415:13)
28 error If you need help, you may report this *entire* log,
28 error including the npm and node versions, at:
28 error     <http://github.com/isaacs/npm/issues>
29 error System Linux 3.11.0-14-generic
30 error command "/usr/bin/node" "/usr/bin/npm" "login"
31 error cwd /home/index0h
32 error node -v v0.10.24
33 error npm -v 1.3.21
34 verbose exit [ 1, true ]
Contributor
smikes commented Jan 6, 2015

Is this still a problem for you?

There have been a lot of improvements to npm -- especially around conflicts and race conditions during install -- since 1.3.21. Can you try updating your npm installation?

To update npm, run npm -g install npm@latest

For some Linux distributions (Debian/Ubuntu and RedHat/CentOS), the latest node version provided by the distribution may lag behind the stable version. Here are instructions from NodeSource on getting the latest node.

We are trying to clean up older npm issues, so if we don't hear back from you within a week, we will close this issue. (Don't worry -- you can always come back again and open a new issue!)

Thanks!

Contributor

This has been fixed in several different ways over the course of the last year, and I would certainly like to hear if people are still running into variants of this problem. But I'm going to call this issue resolved / abandoned. Future people who read this: please open a new issue instead of commenting on this one. Thanks!

@othiym23 othiym23 closed this Jan 15, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment