Can't publish: Invalida data in registry, non-deterministically #4426

Closed
karpathy opened this Issue Jan 7, 2014 · 6 comments

Comments

Projects
None yet
3 participants

karpathy commented Jan 7, 2014

When I do npm publish (or even npm unpublish), I get the following error non-deterministically, and very often:

npm http PUT https://registry.npmjs.org/convnetjs
npm http 409 https://registry.npmjs.org/convnetjs
npm http GET https://registry.npmjs.org/convnetjs
npm http 200 https://registry.npmjs.org/convnetjs
npm http PUT https://registry.npmjs.org/convnetjs/0.1.2/-tag/latest
npm http 201 https://registry.npmjs.org/convnetjs/0.1.2/-tag/latest
npm http GET https://registry.npmjs.org/convnetjs
npm http 200 https://registry.npmjs.org/convnetjs
npm http PUT https://registry.npmjs.org/convnetjs/-/convnetjs-0.1.2.tgz/-rev/51-50095f7c4ceb903d989d3d8c4a9efd06
npm http 409 https://registry.npmjs.org/convnetjs/-/convnetjs-0.1.2.tgz/-rev/51-50095f7c4ceb903d989d3d8c4a9efd06
npm ERR! publish failed 409 Conflict
npm http GET https://registry.npmjs.org/convnetjs
npm http 200 https://registry.npmjs.org/convnetjs
npm http PUT https://registry.npmjs.org/convnetjs/-rev/52-9b503a2a365257920ddc28efee338eba
npm http 201 https://registry.npmjs.org/convnetjs/-rev/52-9b503a2a365257920ddc28efee338eba
npm http GET https://registry.npmjs.org/convnetjs
npm http 200 https://registry.npmjs.org/convnetjs
npm http DELETE https://registry.npmjs.org/convnetjs/-/convnetjs-0.1.2.tgz/-rev/52-9b503a2a365257920ddc28efee338eba
npm http 409 https://registry.npmjs.org/convnetjs/-/convnetjs-0.1.2.tgz/-rev/52-9b503a2a365257920ddc28efee338eba
npm ERR! rollback failed Error: conflict Document update conflict.: convnetjs/-/convnetjs-0.1.2.tgz/-rev/52-9b503a2a365257920ddc28efee338eba
npm ERR! rollback failed at Request._callback (/usr/share/npm/lib/utils/npm-registry-client/request.js:181:12)
npm ERR! rollback failed at Request.callback (/usr/lib/nodejs/request/main.js:119:22)
npm ERR! rollback failed at Request. (/usr/lib/nodejs/request/main.js:525:16)
npm ERR! rollback failed at Request.emit (events.js:67:17)
npm ERR! rollback failed at IncomingMessage. (/usr/lib/nodejs/request/main.js:484:14)
npm ERR! rollback failed at IncomingMessage.emit (events.js:88:20)
npm ERR! rollback failed at HTTPParser.onMessageComplete (http.js:137:23)
npm ERR! rollback failed at CleartextStream.ondata (http.js:1150:24)
npm ERR! rollback failed at CleartextStream._push (tls.js:375:27)
npm ERR! rollback failed at SecurePair.cycle (tls.js:734:20)
npm ERR! rollback failed Invalid data in registry! Please report this.
npm ERR! 409 Conflict
npm not ok

In short, I can't seem to push an updated version because while unpublish works most of the time, publish almost never works. But the publish does do something, because if i try to npm publish again i get

npm ERR! publish fail Cannot publish over existing version.

and if I do append a --force as I am instructed, so npm publish --force, I get the exact same message telling me to append --force.

Member

timoxley commented Jan 7, 2014

@karpathy can you try again and report back and/or close this? possible this was related to recent npm server glitches perhaps.

#4430

karpathy commented Jan 8, 2014

I still get the exact same error...Although I noticed that the npm site (when I log in) does report eventually that the library was installed "a day ago". So maybe the error happens after it's correctly updated? I tried again but now the npm site doesn't report the new version is 0.1.3. Maybe it takes a while to update.

Owner

isaacs commented Jan 8, 2014

@karpathy It looks like you're not using the most recent version of npm. What does npm -v report?

If it's not 1.3.23, then can you please do npm i npm -g and see if that fixes the issue?

karpathy commented Jan 8, 2014

strange, I just got npm through apt-get install. It was at 1.1.4
I tried running the command you gave and got:

EEXIST, file already exists '../../../lib/node_modules/npm/man/man1/npm-repo.1'
npm ERR! File exists: ../../../lib/node_modules/npm/man/man1/npm-repo.1
npm ERR! Move it away, and try again.

except I swear there is no such file on my system and there was no node_modules in my /lib. Also it seems like a strange error, I've never had an install script demand that I do some manual operations on moving files/folders.

So I did apt-get purge npm and instead went with install.sh script from your Readme (https://npmjs.org/doc/README.html)

Which installed npm 1.1.71, and the publish now works.
Thanks

Member

timoxley commented Jan 8, 2014

@karpathy yeah package managers like apt can lag significantly behind the latest, thus they're really not ideal for fast-changing software like node/npm. You might consider isaacs/nave for easily keeping up to date with the latest npm/node.

Member

timoxley commented Jan 8, 2014

@karpathy you could also consider closing this if your issue is resolved :D

karpathy closed this Jan 8, 2014

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