Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't publish a private package to verdaccio while offline #78

Closed
eephillip opened this issue Oct 26, 2016 · 6 comments
Closed

can't publish a private package to verdaccio while offline #78

eephillip opened this issue Oct 26, 2016 · 6 comments

Comments

@eephillip
Copy link

server log online / success

verdaccio 
 warn  --- config file  - /home/myuserid/.config/verdaccio/config.yaml
 warn  --- http address - http://localhost:4873/
 http  --> 200, req: 'GET https://registry.npmjs.org/test-package', bytes: 0/1149
 http  <-- 201, user: myuserid, req: 'PUT /test-package', bytes: 1312/68

server log offline / failed

 verdaccio 
 warn  --- config file  - /home/myuserid/.config/verdaccio/config.yaml
 warn  --- http address - http://localhost:4873/
 http  --> ERR, req: 'GET https://registry.npmjs.org/test-package', error: getaddrinfo EAI_AGAIN
 http  <-- 503, user: myuserid, req: 'PUT /test-package', error: one of the uplinks is down, refuse to publish
 http  --> ERR, req: 'GET https://registry.npmjs.org/test-package', error: getaddrinfo EAI_AGAIN
 http  <-- 503, user: myuserid, req: 'PUT /test-package', error: one of the uplinks is down, refuse to publish
 warn  --> host registry.npmjs.org is now offline
 http  <-- 503, user: myuserid, req: 'PUT /test-package', error: one of the uplinks is down, refuse to publish

npm publish --verbose

npm publish --verbose
npm info it worked if it ends with ok
npm verb cli [ '/home/myuserid/.nvm/versions/node/v4.6.1/bin/node',
npm verb cli   '/home/myuserid/.nvm/versions/node/v4.6.1/bin/npm',
npm verb cli   'publish',
npm verb cli   '--verbose' ]
npm info using [email protected]
npm info using [email protected]
npm verb publish [ '.' ]
npm verb cache add spec .
npm verb addLocalDirectory /home/myuserid/.npm/test-package/1.0.0/package.tgz not in flight; packing
npm verb correctMkdir /home/myuserid/.npm correctMkdir not in flight; initializing
npm verb tar pack [ '/home/myuserid/.npm/test-package/1.0.0/package.tgz',
npm verb tar pack   '/home/myuserid/dev/node-dev/test-package' ]
npm verb tarball /home/myuserid/.npm/test-package/1.0.0/package.tgz
npm verb folder /home/myuserid/dev/node-dev/test-package
npm info prepublish [email protected]
npm verb addLocalTarball adding from inside cache /home/myuserid/.npm/test-package/1.0.0/package.tgz
npm verb correctMkdir /home/myuserid/.npm correctMkdir not in flight; initializing
npm verb afterAdd /home/myuserid/.npm/test-package/1.0.0/package/package.json not in flight; writing
npm verb correctMkdir /home/myuserid/.npm correctMkdir not in flight; initializing
npm verb afterAdd /home/myuserid/.npm/test-package/1.0.0/package/package.json written
npm verb getPublishConfig { registry: 'http://localhost:4873' }
npm verb publish registryBase http://localhost:4873/
npm verb request uri http://localhost:4873/test-package
npm verb request sending authorization for write operation
npm info attempt registry request try #1 at 5:23:36 PM
npm verb request using bearer token for auth
npm verb request id 2cab1a228bcea447
npm http request PUT http://localhost:4873/test-package
npm http 503 http://localhost:4873/test-package
npm verb headers { 'x-powered-by': 'verdaccio/2.1.0',
npm verb headers   'content-type': 'application/json; charset=utf-8',
npm verb headers   'content-length': '63',
npm verb headers   etag: 'W/"3f-demMhYZwlqi35Jmuz+gJ3A"',
npm verb headers   vary: 'Accept-Encoding',
npm verb headers   'x-status-cat': 'http://flic.kr/p/aXYvop',
npm verb headers   date: 'Wed, 26 Oct 2016 22:23:37 GMT',
npm verb headers   connection: 'keep-alive' }
npm info retry will retry, error on last attempt: Error: one of the uplinks is down, refuse to publish : test-package
npm info attempt registry request try #2 at 5:23:47 PM
npm verb request using bearer token for auth
npm http request PUT http://localhost:4873/test-package
npm http 503 http://localhost:4873/test-package
npm verb headers { 'x-powered-by': 'verdaccio/2.1.0',
npm verb headers   'content-type': 'application/json; charset=utf-8',
npm verb headers   'content-length': '63',
npm verb headers   etag: 'W/"3f-demMhYZwlqi35Jmuz+gJ3A"',
npm verb headers   vary: 'Accept-Encoding',
npm verb headers   'x-status-cat': 'http://flic.kr/p/aXYvop',
npm verb headers   date: 'Wed, 26 Oct 2016 22:23:47 GMT',
npm verb headers   connection: 'keep-alive' }
npm info retry will retry, error on last attempt: Error: one of the uplinks is down, refuse to publish : test-package
npm info attempt registry request try #3 at 5:24:47 PM
npm verb request using bearer token for auth
npm http request PUT http://localhost:4873/test-package
npm http 503 http://localhost:4873/test-package
npm verb headers { 'x-powered-by': 'verdaccio/2.1.0',
npm verb headers   'content-type': 'application/json; charset=utf-8',
npm verb headers   'content-length': '63',
npm verb headers   etag: 'W/"3f-demMhYZwlqi35Jmuz+gJ3A"',
npm verb headers   vary: 'Accept-Encoding',
npm verb headers   'x-status-cat': 'http://flic.kr/p/aXYvop',
npm verb headers   date: 'Wed, 26 Oct 2016 22:24:47 GMT',
npm verb headers   connection: 'keep-alive' }
npm verb request invalidating /home/myuserid/.npm/localhost_4873/test-package on PUT
npm ERR! publish Failed PUT 503
npm verb stack Error: one of the uplinks is down, refuse to publish : test-package
npm verb stack     at makeError (/home/myuserid/.nvm/versions/node/v4.6.1/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:264:12)
npm verb stack     at CachingRegistryClient.<anonymous> (/home/myuserid/.nvm/versions/node/v4.6.1/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:252:14)
npm verb stack     at Request._callback (/home/myuserid/.nvm/versions/node/v4.6.1/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:172:14)
npm verb stack     at Request.self.callback (/home/myuserid/.nvm/versions/node/v4.6.1/lib/node_modules/npm/node_modules/request/request.js:200:22)
npm verb stack     at emitTwo (events.js:87:13)
npm verb stack     at Request.emit (events.js:172:7)
npm verb stack     at Request.<anonymous> (/home/myuserid/.nvm/versions/node/v4.6.1/lib/node_modules/npm/node_modules/request/request.js:1067:10)
npm verb stack     at emitOne (events.js:82:20)
npm verb stack     at Request.emit (events.js:169:7)
npm verb stack     at IncomingMessage.<anonymous> (/home/myuserid/.nvm/versions/node/v4.6.1/lib/node_modules/npm/node_modules/request/request.js:988:12)
npm verb statusCode 503
npm verb pkgid test-package
npm verb cwd /home/myuserid/dev/node-dev/test-package
npm ERR! Linux 2.6.32-642.6.1.el6.centos.plus.x86_64
npm ERR! argv "/home/myuserid/.nvm/versions/node/v4.6.1/bin/node" "/home/myuserid/.nvm/versions/node/v4.6.1/bin/npm" "publish" "--verbose"
npm ERR! node v4.6.1
npm ERR! npm  v2.15.9
npm ERR! code E503

npm ERR! one of the uplinks is down, refuse to publish : test-package
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>
npm verb exit [ 1, true ]

npm ERR! Please include the following file with any support request:
npm ERR!     /home/myuserid/dev/node-dev/test-package/npm-debug.log

npm-debug.log

0 info it worked if it ends with ok
1 verbose cli [ '/home/myuserid/.nvm/versions/node/v4.6.1/bin/node',
1 verbose cli   '/home/myuserid/.nvm/versions/node/v4.6.1/bin/npm',
1 verbose cli   'publish',
1 verbose cli   '--verbose' ]
2 info using [email protected]
3 info using [email protected]
4 verbose publish [ '.' ]
5 silly cache add args [ '.', null ]
6 verbose cache add spec .
7 silly cache add parsed spec Result {
7 silly cache add   raw: '.',
7 silly cache add   scope: null,
7 silly cache add   name: null,
7 silly cache add   rawSpec: '.',
7 silly cache add   spec: '/home/myuserid/dev/node-dev/test-package',
7 silly cache add   type: 'directory' }
8 verbose addLocalDirectory /home/myuserid/.npm/test-package/1.0.0/package.tgz not in flight; packing
9 verbose correctMkdir /home/myuserid/.npm correctMkdir not in flight; initializing
10 verbose tar pack [ '/home/myuserid/.npm/test-package/1.0.0/package.tgz',
10 verbose tar pack   '/home/myuserid/dev/node-dev/test-package' ]
11 verbose tarball /home/myuserid/.npm/test-package/1.0.0/package.tgz
12 verbose folder /home/myuserid/dev/node-dev/test-package
13 info prepublish [email protected]
14 verbose addLocalTarball adding from inside cache /home/myuserid/.npm/test-package/1.0.0/package.tgz
15 verbose correctMkdir /home/myuserid/.npm correctMkdir not in flight; initializing
16 silly cache afterAdd [email protected]
17 verbose afterAdd /home/myuserid/.npm/test-package/1.0.0/package/package.json not in flight; writing
18 verbose correctMkdir /home/myuserid/.npm correctMkdir not in flight; initializing
19 verbose afterAdd /home/myuserid/.npm/test-package/1.0.0/package/package.json written
20 silly publish { name: 'test-package',
20 silly publish   version: '1.0.0',
20 silly publish   description: '"publish test package"',
20 silly publish   main: 'index.js',
20 silly publish   scripts: { test: 'echo "Error: no test specified" && exit 1' },
20 silly publish   author: { name: 'myuserid' },
20 silly publish   license: 'ISC',
20 silly publish   publishConfig: { registry: 'http://localhost:4873' },
20 silly publish   readme: 'ERROR: No README data found!',
20 silly publish   _id: '[email protected]',
20 silly publish   _shasum: '96ae3b33911f4ac620a1fba68aed9ea7b35870f7',
20 silly publish   _from: '.' }
21 verbose getPublishConfig { registry: 'http://localhost:4873' }
22 silly mapToRegistry name test-package
23 silly mapToRegistry using default registry
24 silly mapToRegistry registry http://localhost:4873
25 silly mapToRegistry data Result {
25 silly mapToRegistry   raw: 'test-package',
25 silly mapToRegistry   scope: null,
25 silly mapToRegistry   name: 'test-package',
25 silly mapToRegistry   rawSpec: '',
25 silly mapToRegistry   spec: 'latest',
25 silly mapToRegistry   type: 'tag' }
26 silly mapToRegistry uri http://localhost:4873/test-package
27 verbose publish registryBase http://localhost:4873/
28 silly publish uploading /home/myuserid/.npm/test-package/1.0.0/package.tgz
29 verbose request uri http://localhost:4873/test-package
30 verbose request sending authorization for write operation
31 info attempt registry request try #1 at 5:23:36 PM
32 verbose request using bearer token for auth
33 verbose request id 2cab1a228bcea447
34 http request PUT http://localhost:4873/test-package
35 http 503 http://localhost:4873/test-package
36 verbose headers { 'x-powered-by': 'verdaccio/2.1.0',
36 verbose headers   'content-type': 'application/json; charset=utf-8',
36 verbose headers   'content-length': '63',
36 verbose headers   etag: 'W/"3f-demMhYZwlqi35Jmuz+gJ3A"',
36 verbose headers   vary: 'Accept-Encoding',
36 verbose headers   'x-status-cat': 'http://flic.kr/p/aXYvop',
36 verbose headers   date: 'Wed, 26 Oct 2016 22:23:37 GMT',
36 verbose headers   connection: 'keep-alive' }
37 info retry will retry, error on last attempt: Error: one of the uplinks is down, refuse to publish : test-package
38 info attempt registry request try #2 at 5:23:47 PM
39 verbose request using bearer token for auth
40 http request PUT http://localhost:4873/test-package
41 http 503 http://localhost:4873/test-package
42 verbose headers { 'x-powered-by': 'verdaccio/2.1.0',
42 verbose headers   'content-type': 'application/json; charset=utf-8',
42 verbose headers   'content-length': '63',
42 verbose headers   etag: 'W/"3f-demMhYZwlqi35Jmuz+gJ3A"',
42 verbose headers   vary: 'Accept-Encoding',
42 verbose headers   'x-status-cat': 'http://flic.kr/p/aXYvop',
42 verbose headers   date: 'Wed, 26 Oct 2016 22:23:47 GMT',
42 verbose headers   connection: 'keep-alive' }
43 info retry will retry, error on last attempt: Error: one of the uplinks is down, refuse to publish : test-package
44 info attempt registry request try #3 at 5:24:47 PM
45 verbose request using bearer token for auth
46 http request PUT http://localhost:4873/test-package
47 http 503 http://localhost:4873/test-package
48 verbose headers { 'x-powered-by': 'verdaccio/2.1.0',
48 verbose headers   'content-type': 'application/json; charset=utf-8',
48 verbose headers   'content-length': '63',
48 verbose headers   etag: 'W/"3f-demMhYZwlqi35Jmuz+gJ3A"',
48 verbose headers   vary: 'Accept-Encoding',
48 verbose headers   'x-status-cat': 'http://flic.kr/p/aXYvop',
48 verbose headers   date: 'Wed, 26 Oct 2016 22:24:47 GMT',
48 verbose headers   connection: 'keep-alive' }
49 verbose request invalidating /home/myuserid/.npm/localhost_4873/test-package on PUT
50 error publish Failed PUT 503
51 verbose stack Error: one of the uplinks is down, refuse to publish : test-package
51 verbose stack     at makeError (/home/myuserid/.nvm/versions/node/v4.6.1/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:264:12)
51 verbose stack     at CachingRegistryClient.<anonymous> (/home/myuserid/.nvm/versions/node/v4.6.1/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:252:14)
51 verbose stack     at Request._callback (/home/myuserid/.nvm/versions/node/v4.6.1/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:172:14)
51 verbose stack     at Request.self.callback (/home/myuserid/.nvm/versions/node/v4.6.1/lib/node_modules/npm/node_modules/request/request.js:200:22)
51 verbose stack     at emitTwo (events.js:87:13)
51 verbose stack     at Request.emit (events.js:172:7)
51 verbose stack     at Request.<anonymous> (/home/myuserid/.nvm/versions/node/v4.6.1/lib/node_modules/npm/node_modules/request/request.js:1067:10)
51 verbose stack     at emitOne (events.js:82:20)
51 verbose stack     at Request.emit (events.js:169:7)
51 verbose stack     at IncomingMessage.<anonymous> (/home/myuserid/.nvm/versions/node/v4.6.1/lib/node_modules/npm/node_modules/request/request.js:988:12)
52 verbose statusCode 503
53 verbose pkgid test-package
54 verbose cwd /home/myuserid/dev/node-dev/test-package
55 error Linux 2.6.32-642.6.1.el6.centos.plus.x86_64
56 error argv "/home/myuserid/.nvm/versions/node/v4.6.1/bin/node" "/home/myuserid/.nvm/versions/node/v4.6.1/bin/npm" "publish" "--verbose"
57 error node v4.6.1
58 error npm  v2.15.9
59 error code E503
60 error one of the uplinks is down, refuse to publish : test-package
61 error If you need help, you may report this error at:
61 error     <https://github.com/npm/npm/issues>
62 verbose exit [ 1, true ]
@eephillip
Copy link
Author

Related
rlidwka/sinopia#356

@juanpicado juanpicado added this to the 2.2.1 milestone Jun 10, 2017
@juanpicado juanpicado self-assigned this Jun 10, 2017
@juanpicado
Copy link
Member

Thinking how to solve this is not that hard after all.

Setting this new configuration will allow publish packages if any of the uplinks fails, it will be false by default.

publish:
  allow_offline: true

@eephillip Do yo like the solution?

@juanpicado juanpicado modified the milestones: Future, 2.2.x Jul 1, 2017
@juanpicado
Copy link
Member

Closing this, seems abandoned. I'll merge. Feel free to reopen whether you have further comments.

juanpicado added a commit that referenced this issue Jul 24, 2017
Fix #78 Add new setting to allow publish when uplinks are offline
@eephillip
Copy link
Author

I just tried this out, this is great. I'll put it through some paces, but looks good so far.

@juanpicado
Copy link
Member

Thanks, @eephillip for confirming it! I'm glad it worked out.

@lock
Copy link

lock bot commented Aug 26, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot added the outdated label Aug 26, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Aug 26, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants