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

np fails to publish package on verdaccio due to missing collaborators file? #581

Closed
fohletex opened this issue Nov 23, 2020 · 5 comments
Closed

Comments

@fohletex
Copy link
Contributor

fohletex commented Nov 23, 2020

I recently received some error when I tried to publish a package to Verdaccio. It durate a long time and after a while np throwed

error Couldn't publish package: "<REGISTRY_URL>/<PACKAGE>: ESOCKETTIMEDOUT"

But on verdaccio the following is logged:

verdaccio_1  | 2020-11-23T10:17:59.585151475Z  debug--- [gitlab] allow user: <USER> authenticated access to package: <PACKAGE_NAME>
verdaccio_1  | 2020-11-23T10:17:59.585185608Z  debug--- [local-storage/readPackage] read a package: <PACKAGE_NAME>
verdaccio_1  | 2020-11-23T10:17:59.586535172Z  info --> making request: 'GET https://registry.npmjs.org/<PACKAGE_NAME>'
verdaccio_1  | 2020-11-23T10:18:00.354929912Z  http --> 404, req: 'GET https://registry.npmjs.org/<PACKAGE_NAME>' (streaming)
verdaccio_1  | 2020-11-23T10:18:00.355928617Z  http --> 404, req: 'GET https://registry.npmjs.org/<PACKAGE_NAME>', bytes: 0/21
verdaccio_1  | 2020-11-23T10:18:00.357343952Z  http <-- 404, user: <USER>(<IP1> via <IP2>), req: 'GET /<PACKAGE_NAME>', error: no such package available
verdaccio_1  | 2020-11-23T10:18:00.357391018Z  http <-- 404, user: <USER>(<IP1> via <IP2>), req: 'GET /<PACKAGE_NAME>', error: no such package available
verdaccio_1  | 2020-11-23T10:18:03.996787103Z  info <-- 172.18.0.1 requested 'GET /-/whoami'
verdaccio_1  | 2020-11-23T10:18:03.997859940Z  debug--- [gitlab] user: <USER> found in cache, authenticated with groups: [object Object]
verdaccio_1  | 2020-11-23T10:18:03.998118240Z  http <-- 200, user: <USER>(<IP1> via <IP2>), req: 'GET /-/whoami', bytes: 0/28
verdaccio_1  | 2020-11-23T10:18:03.998329995Z  http <-- 200, user: <USER>(<IP1> via <IP2>), req: 'GET /-/whoami', bytes: 0/28
verdaccio_1  | 2020-11-23T10:18:04.404728850Z  info <-- <IP3> requested 'GET /-/package/<PACKAGE_NAME>/collaborators?format=cli'
verdaccio_1  | 2020-11-23T10:18:04.407178680Z  debug--- [gitlab] user: <USER> found in cache, authenticated with groups: [object Object]
verdaccio_1  | 2020-11-23T10:18:04.408458918Z  http <-- 404, user: <USER>(<IP1> via <IP2>), req: 'GET /-/package/<PACKAGE_NAME>/collaborators?format=cli', error: File not found
verdaccio_1  | 2020-11-23T10:18:04.408497470Z  http <-- 404, user: <USER>(<IP1> via <IP2>), req: 'GET /-/package/<PACKAGE_NAME>/collaborators?format=cli', error: File not found

I assume it might have to do something with this line:

const collaborators = await npm.collaborators(pkg);
when the collaborators are requested. Perhaps instead of returning a direct exception with further details might help? Or is the file really required?

Using npm publish works perfect, as seen below:

verdaccio_1  | 2020-11-23T10:25:22.105911916Z  debug--- [gitlab] user: <USER> found in cache, authenticated with groups: [object Object]
verdaccio_1  | 2020-11-23T10:25:22.117703246Z  debug--- [gitlab] user: <USER> allowed to publish package: <PACKAGE_NAME> based on package-name
verdaccio_1  | 2020-11-23T10:25:22.117829447Z  debug--- publishing or updating a new version for <PACKAGE_NAME>
verdaccio_1  | 2020-11-23T10:25:22.118037107Z  debug--- adding a new version for <PACKAGE_NAME>
verdaccio_1  | 2020-11-23T10:25:22.118255712Z  debug--- [local-storage/readPackage] read a package: <PACKAGE_NAME>
verdaccio_1  | 2020-11-23T10:25:22.123323816Z  debug--- [local-storage/writeTarball] write a tarball for package: <PACKAGE_NAME>-0.2.1.tgz
verdaccio_1  | 2020-11-23T10:25:22.128010874Z  debug--- [local-storage/savePackage] save a package: <PACKAGE_NAME>
verdaccio_1  | 2020-11-23T10:25:22.138782356Z  debug--- [local-storage/savePackage] save a package: <PACKAGE_NAME>
verdaccio_1  | 2020-11-23T10:25:22.143703511Z  debug--- [local-storage/savePackage] save a package: <PACKAGE_NAME>
verdaccio_1  | 2020-11-23T10:25:22.147840917Z  http <-- 201, user: <USER>(<IP1> via <IP2>), req: 'PUT /<PACKAGE_NAME>', bytes: 94848/53
verdaccio_1  | 2020-11-23T10:25:22.147883960Z  http <-- 201, user: <USER>(<IP1> via <IP2>), req: 'PUT /<PACKAGE_NAME>', bytes: 94848/53

Used np version: 6.3.2 - Also tested on 7.0.0 - None of them worked.
Verdaccio: 4.5.1

@fohletex fohletex changed the title Wrong error message if np-collaborators file is missing on Verdaccio? np fails to publish package on verdaccio due to missing collaborators file? Nov 23, 2020
@slhck
Copy link
Contributor

slhck commented Feb 16, 2021

@sindresorhus Any idea what is causing this?

@sindresorhus
Copy link
Owner

If you use a third-party npm registry, you're on your own. I'm happy to merge workarounds within reason, but it's not something I plan to spend time on.

@slhck
Copy link
Contributor

slhck commented Feb 16, 2021

The issue is not the registry. The package can be published with npm publish without issues.

np just hangs, apparently not handling an error in await npm.collaborators(pkg);.

@niksy
Copy link

niksy commented Oct 29, 2021

This is related to #420.

Perhaps there could be an env variable or CLI/config option to skip authentication.

Maybe this could be potential solution?

@fregante
Copy link
Collaborator

fregante commented Feb 3, 2023

Closing in favor of #420

@fregante fregante marked this as a duplicate of #420 Feb 3, 2023
@fregante fregante closed this as not planned Won't fix, can't repro, duplicate, stale Feb 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants