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

ECONNREFUSED When setting up a new token (npm token) #521

Closed
alexholliz opened this issue Jan 22, 2018 · 13 comments
Closed

ECONNREFUSED When setting up a new token (npm token) #521

alexholliz opened this issue Jan 22, 2018 · 13 comments

Comments

@alexholliz
Copy link

alexholliz commented Jan 22, 2018

My reason:

Attempting to get a new token on the NPM repository causes an ECONNREFUSED refused response.

Steps to reproduce:

npm token create --registry https://verdaccio.domainName.com

App Version:

  Latest (pulled by docker)

Config file:

  Using a default config.

Additional verbose log:

npm password:
npm ERR! code ECONNREFUSED
npm ERR! errno ECONNREFUSED
npm ERR! FetchError: request to https://verdaccio.domainName.com/-/npm/v1/tokens failed, reason: connect ECONNREFUSED 198.105.254.130:443
npm ERR! at ClientRequest.req.on.err (/usr/local/lib/node_modules/npm/node_modules/npm-profile/node_modules/make-fetch-happen/node_modules/node-fetch-npm/src/index.js:68:14)
npm ERR! at ClientRequest.emit (events.js:160:13)
npm ERR! at TLSSocket.socketErrorListener (_http_client.js:389:9)
npm ERR! at TLSSocket.emit (events.js:160:13)
npm ERR! at emitErrorNT (internal/streams/destroy.js:64:8)
npm ERR! at process._tickCallback (internal/process/next_tick.js:152:19)
npm ERR! { FetchError: request to https://verdaccio.domainName.com/-/npm/v1/tokens failed, reason: connect ECONNREFUSED 198.105.254.130:443
npm ERR! at ClientRequest.req.on.err (/usr/local/lib/node_modules/npm/node_modules/npm-profile/node_modules/make-fetch-happen/node_modules/node-fetch-npm/src/index.js:68:14)
npm ERR! at ClientRequest.emit (events.js:160:13)
npm ERR! at TLSSocket.socketErrorListener (_http_client.js:389:9)
npm ERR! at TLSSocket.emit (events.js:160:13)
npm ERR! at emitErrorNT (internal/streams/destroy.js:64:8)
npm ERR! at process._tickCallback (internal/process/next_tick.js:152:19)
npm ERR! message: 'request to https://verdaccio.domainName.com/-/npm/v1/tokens failed, reason: connect ECONNREFUSED 198.105.254.130:443',
npm ERR! type: 'system',
npm ERR! errno: 'ECONNREFUSED',
npm ERR! code: 'ECONNREFUSED',
npm ERR! stack: 'FetchError: request to https://verdaccio.domainName.com/-/npm/v1/tokens failed, reason: connect ECONNREFUSED 198.105.254.130:443\n at ClientRequest.req.on.err (/usr/local/lib/node_modules/npm/node_modules/npm-profile/node_modules/make-fetch-happen/node_modules/node-fetch-npm/src/index.js:68:14)\n at ClientRequest.emit (events.js:160:13)\n at TLSSocket.socketErrorListener (_http_client.js:389:9)\n at TLSSocket.emit (events.js:160:13)\n at emitErrorNT (internal/streams/destroy.js:64:8)\n at process._tickCallback (internal/process/next_tick.js:152:19)',
npm ERR! method: 'POST',
npm ERR! href: 'https://verdaccio.domainName.com/-/npm/v1/tokens' }
npm ERR!
npm ERR! If you are behind a proxy, please make sure that the
npm ERR! 'proxy' config is set properly. See: 'npm help config'

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/userName/.npm/_logs/2018-01-18T23_29_49_010Z-debug.log```


I will backfill this with additional information once I chat with the devs having issues.
@alexholliz
Copy link
Author

alexholliz commented Jan 22, 2018

Verbose Log:

1 verbose cli [ '/usr/local/Cellar/node/9.4.0/bin/node',
1 verbose cli   '/usr/local/bin/npm',
1 verbose cli   'token',
1 verbose cli   'create',
1 verbose cli   '--registry',
1 verbose cli   'https://verdaccio.domainName.com' ]
2 info using npm@5.6.0
3 info using node@v9.4.0
4 info token creating
5 http request → POST https://verdaccio.domainName.com/-/npm/v1/tokens
6 verbose type system
7 verbose stack FetchError: request to https://verdaccio.domainName.com/-/npm/v1/tokens failed, reason: connect ECONNREFUSED 198.105.254.130:443
7 verbose stack     at ClientRequest.req.on.err (/usr/local/lib/node_modules/npm/node_modules/npm-profile/node_modules/make-fetch-happen/node_modules/node-fetch-npm/src/index.js:68:14)
7 verbose stack     at ClientRequest.emit (events.js:160:13)
7 verbose stack     at TLSSocket.socketErrorListener (_http_client.js:389:9)
7 verbose stack     at TLSSocket.emit (events.js:160:13)
7 verbose stack     at emitErrorNT (internal/streams/destroy.js:64:8)
7 verbose stack     at process._tickCallback (internal/process/next_tick.js:152:19)
8 verbose cwd /ws/spark/dev/libraries/js/domain-navbar
9 verbose Darwin 17.3.0
10 verbose argv "/usr/local/Cellar/node/9.4.0/bin/node" "/usr/local/bin/npm" "token" "create" "--registry" "https://verdaccio.domainName.com"
11 verbose node v9.4.0
12 verbose npm  v5.6.0
13 error code ECONNREFUSED
14 error errno ECONNREFUSED
15 error FetchError: request to https://verdaccio.domainName.com/-/npm/v1/tokens failed, reason: connect ECONNREFUSED 198.105.254.130:443
15 error     at ClientRequest.req.on.err (/usr/local/lib/node_modules/npm/node_modules/npm-profile/node_modules/make-fetch-happen/node_modules/node-fetch-npm/src/index.js:68:14)
15 error     at ClientRequest.emit (events.js:160:13)
15 error     at TLSSocket.socketErrorListener (_http_client.js:389:9)
15 error     at TLSSocket.emit (events.js:160:13)
15 error     at emitErrorNT (internal/streams/destroy.js:64:8)
15 error     at process._tickCallback (internal/process/next_tick.js:152:19)
15 error  { FetchError: request to https://verdaccio.domainName.com/-/npm/v1/tokens failed, reason: connect ECONNREFUSED 198.105.254.130:443
15 error     at ClientRequest.req.on.err (/usr/local/lib/node_modules/npm/node_modules/npm-profile/node_modules/make-fetch-happen/node_modules/node-fetch-npm/src/index.js:68:14)
15 error     at ClientRequest.emit (events.js:160:13)
15 error     at TLSSocket.socketErrorListener (_http_client.js:389:9)
15 error     at TLSSocket.emit (events.js:160:13)
15 error     at emitErrorNT (internal/streams/destroy.js:64:8)
15 error     at process._tickCallback (internal/process/next_tick.js:152:19)
15 error   message: 'request to https://verdaccio.domainName.com/-/npm/v1/tokens failed, reason: connect ECONNREFUSED 198.105.254.130:443',
15 error   type: 'system',
15 error   errno: 'ECONNREFUSED',
15 error   code: 'ECONNREFUSED',
15 error   stack: 'FetchError: request to https://verdaccio.domainName.com/-/npm/v1/tokens failed, reason: connect ECONNREFUSED 198.105.254.130:443\n    at ClientRequest.req.on.err (/usr/local/lib/node_modules/npm/node_modules/npm-profile/node_modules/make-fetch-happen/node_modules/node-fetch-npm/src/index.js:68:14)\n    at ClientRequest.emit (events.js:160:13)\n    at TLSSocket.socketErrorListener (_http_client.js:389:9)\n    at TLSSocket.emit (events.js:160:13)\n    at emitErrorNT (internal/streams/destroy.js:64:8)\n    at process._tickCallback (internal/process/next_tick.js:152:19)',
15 error   method: 'POST',
15 error   href: 'https://verdaccio.domainName.com/-/npm/v1/tokens' }
16 error If you are behind a proxy, please make sure that the
16 error 'proxy' config is set properly.  See: 'npm help config'
17 verbose exit [ 1, true ]```

@juanpicado
Copy link
Member

I do not see any indication you are hitting Verdaccio in the log. Also I see https. How is your environment? Conf file ?

@alexholliz
Copy link
Author

I just re-did our verdaccio+nginx setup to remove SSL. As it stands now, it's default verdaccio, along with an nginx reverse proxy in a docker-compose file. I can paste the config from nginx, if that will help.

@juanpicado
Copy link
Member

Please :)

@alexholliz
Copy link
Author

alexholliz commented Jan 29, 2018

server {
  listen 80 default_server;
        access_log /var/log/nginx/verdaccio.log;
        charset utf-8;
  location / {
    proxy_pass              http://verdaccio:4873/;
    proxy_set_header        Host $host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-NginX-Proxy true;
    proxy_ssl_session_reuse off;
    proxy_set_header Host $http_host;
    proxy_redirect off;
  }

Pretty basic stuff.

@juanpicado
Copy link
Member

How do you handle SSL now ?

@alexholliz
Copy link
Author

alexholliz commented Jan 29, 2018

SSL is removed from the equation, I am still getting 404 errors when attempting to connect and register a token:

npm token create --verbose --registry http://verdaccio.secretdomain.com
npm info it worked if it ends with ok
npm verb cli [ '/usr/local/Cellar/node/9.4.0/bin/node',
npm verb cli   '/usr/local/bin/npm',
npm verb cli   'token',
npm verb cli   'create',
npm verb cli   '--verbose',
npm verb cli   '--registry',
npm verb cli   'http://verdaccio.secretdomain.com' ]
npm info using npm@5.6.0
npm info using node@v9.4.0
npm verb config Skipping project config: /Users/ahollis/.npmrc. (matches userconfig)
npm password: 
npm info token creating
npm http request → POST http://verdaccio.secretdomain.com/-/npm/v1/tokens
npm http 404 ← Not Found (http://verdaccio.secretdomain.com/-/npm/v1/tokens)
npm verb stack Error: Registry returned 404 for POST on undefined
npm verb stack     at fetch.defaults.catch.then.then.result (/usr/local/lib/node_modules/npm/node_modules/npm-profile/index.js:236:15)
npm verb stack     at <anonymous>
npm verb stack     at process._tickCallback (internal/process/next_tick.js:160:7)
npm verb statusCode 404
npm verb cwd /Users/ahollis
npm verb Darwin 17.4.0
npm verb argv "/usr/local/Cellar/node/9.4.0/bin/node" "/usr/local/bin/npm" "token" "create" "--verbose" "--registry" "http://verdaccio.secretdomain.com"
npm verb node v9.4.0
npm verb npm  v5.6.0
npm ERR! code E404
npm ERR! 404 Registry returned 404 for POST on undefined
npm verb exit [ 1, true ]

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/ahollis/.npm/_logs/2018-01-29T17_23_39_006Z-debug.log

@juanpicado
Copy link
Member

Could you describe which command are you using?

@alexholliz
Copy link
Author

alexholliz commented Jan 29, 2018

Just updated my comment, the first line got truncated for some reason.

All I am able to pull from the verdaccio logs while attempting to create a token is this:

verdaccio    |  http <-- 404, user: undefined(172.16.72.34 via 172.18.0.3), req: 'POST /-/npm/v1/tokens', bytes: 60/155
verdaccio    |  http <-- 404, user: undefined(172.16.72.34 via 172.18.0.3), req: 'POST /-/npm/v1/tokens', bytes: 60/155

@juanpicado
Copy link
Member

I meant ... which npm/yarn command are you using? I'd guess npm token and that is not supported yet. #541

@juanpicado juanpicado changed the title ECONNREFUSED When setting up a new token ECONNREFUSED When setting up a new token (npm token) Jan 29, 2018
@alexholliz
Copy link
Author

Aha! That would explain it.

@juanpicado
Copy link
Member

I close this one as duplicate, let's follow up on #541.

@lock
Copy link

lock bot commented Jan 18, 2019

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 Jan 18, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jan 18, 2019
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