np icon indicating copy to clipboard operation
np copied to clipboard

503 Service Unavailable at step Enabling two-factor authentication

Open riccardoscalco opened this issue 5 years ago • 19 comments

Description

np stops at step Enabling two-factor authentication with error 503 Service Unavailable.

This error seems a consequence of the fact that np tells me

This scoped repo @nextbitlabs/onepunch hasn't been published. Do you want to publish it publicly?

where the repo has already been published instead.

Looking at the code, line https://github.com/sindresorhus/np/blob/master/source/ui.js#L143 seems a relevant place to start debugging, in particular condition !options.availability.isAvailable.

Please note that the error does not happen with [email protected].

Steps to reproduce

  1. Install [email protected]
  2. Use np to publish a scoped module that has been already published in npm.

Expected behavior

Step Enabling two-factor authentication should not happen, the repo has been already published with two-factor authentication enabled.

np should understand that the package is already published.

Environment

np - 6.0.0 Node.js - 12.5.0 npm - 6.13.6 Git - 2.20.0 OS - macosx 10.14.6

riccardoscalco avatar Feb 21 '20 09:02 riccardoscalco

Having the same issue, failing at Enabling two-factor authentication, but my package is still being published.

EDIT: Does work with [email protected] as stated above. :-)

Environment np - 6.1.0 node - 10.14.2 npm - 6.12.0 Git - 2.20.1 OS - macOS 10.15.3

davidohlin avatar Feb 21 '20 12:02 davidohlin

I'm having this issue too

DannyFeliz avatar Mar 03 '20 04:03 DannyFeliz

@riccardoscalco @davidohlin @DannyFeliz Can you reproduce this with np v6.2.0? This might have been fixed in #497.

itaisteinherz avatar Mar 03 '20 07:03 itaisteinherz

Same issue here!

MoKhajavi75 avatar Mar 03 '20 07:03 MoKhajavi75

@itaisteinherz the issue persists for me with 6.2.0 unfortunately

davidohlin avatar Mar 03 '20 07:03 davidohlin

I can also verify the issue still persists in 6.2.0.

astoilkov avatar Mar 12 '20 19:03 astoilkov

Any fix for this? New user here trying to use this awesome tool to publish my package. It publishes fine but I miss out on the remaining features after 2FA error.

Gibbo3771 avatar Apr 08 '20 10:04 Gibbo3771

I just ran into this issue with the latest release (6.2.0). Can I completely disable 2FA?

The package ended up being released on npm but did not push to github or create the release tags.

chrisblossom avatar Apr 09 '20 18:04 chrisblossom

I have exactly the same issue with 6.2.1. Waiting for a fix... 🙏

EDIT: on 6.2.3 -> partially fixed, it works when you previously published your lib on npm. But when it is first time, you still have same issue

Emidomenge avatar Apr 15 '20 16:04 Emidomenge

I have the same issue when trying to publish a scoped package for the first time using [email protected].

njkleiner avatar May 15 '20 13:05 njkleiner

Can someone verify if this issue is reproducible? For me, 2FA worked without a hiccup on the latest release of np

dopecodez avatar Sep 02 '20 09:09 dopecodez

Can someone verify if this issue is reproducible? For me, 2FA worked without a hiccup on the latest release of np

It is a long time since I last saw this error.

Can someone verify if this issue is reproducible? For me, 2FA worked without a hiccup on the latest release of np

Yes, verifying the error was still reproducible with [email protected]. For some reason I can see the package on npm, but 404 when I try to access under the npm package url.

Update: It just worked on the second attempt without any commits in between releases. Also the page show up now.

glennreyes avatar Sep 30 '20 21:09 glennreyes

@glennreyes that's interesting, how did it fail the first time? It worked the second time without any setup changes, right?

Do you have any additional log we can use to debug, for me its still going through successfully when I try with 2FA.

dopecodez avatar Oct 03 '20 13:10 dopecodez

0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli   '/Users/agney/.nvm/versions/node/v13.11.0/bin/node',
1 verbose cli   '/Users/agney/.nvm/versions/node/v13.11.0/bin/npm',
1 verbose cli   'access',
1 verbose cli   '2fa-required',
1 verbose cli   '@agney/react-loading'
1 verbose cli ]
2 info using [email protected]
3 info using [email protected]
4 verbose npm-session ecbd5b6d0caae905
5 http fetch POST 503 https://registry.npmjs.org/-/package/%40agney%2Freact-loading/access 544ms
6 verbose stack Error: 503 Service Unavailable - POST https://registry.npmjs.org/-/package/%40agney%2Freact-loading/access - Service Unavailable
6 verbose stack     at /Users/agney/.nvm/versions/node/v13.11.0/lib/node_modules/npm/node_modules/npm-registry-fetch/check-response.js:104:15
6 verbose stack     at processTicksAndRejections (internal/process/task_queues.js:97:5)
7 verbose statusCode 503
8 verbose pkgid @agney/react-loading@latest
9 verbose cwd /Users/agney/code/run-throughs/new-spinner
10 verbose Darwin 19.3.0
11 verbose argv "/Users/agney/.nvm/versions/node/v13.11.0/bin/node" "/Users/agney/.nvm/versions/node/v13.11.0/bin/npm" "access" "2fa-required" "@agney/react-loading"
12 verbose node v13.11.0
13 verbose npm  v6.14.2
14 error code E503
15 error 503 Service Unavailable - POST https://registry.npmjs.org/-/package/%40agney%2Freact-loading/access - Service Unavailable
16 verbose exit [ 1, true ]

This is the NPM log when it happens. The package was successfully published though.

agneym avatar Oct 04 '20 10:10 agneym

Can someone verify if this issue is reproducible? For me, 2FA worked without a hiccup on the latest release of np

I can no longer replicate the same problem with the latest release 6.5.0.

astoilkov avatar Oct 07 '20 19:10 astoilkov

Could this be an npm issue? I never experienced issues with this step, but it appears to me it has something to do with scoped packages. I keep executing the command manually but it doesn't work, constantly returning a 503.

SamVerschueren avatar Jan 04 '21 11:01 SamVerschueren

has this error image image

lishine avatar Apr 01 '22 11:04 lishine

seems like after adding node_modules into .gitignore, the error disappeared

lishine avatar Apr 01 '22 16:04 lishine

  • Use np --no-2fa if you're encountering this issue
  • Report to npm if npm access 2fa-required is failing, to understand why
  • That command is reportedly being removed by npm, so this issue is out of date

fregante avatar Feb 03 '23 10:02 fregante