NPM 404 for some hosted packages

229 views
Skip to first unread message

Daniel Koch

unread,
Dec 27, 2018, 2:20:46 PM12/27/18
to Nexus Users
Hi everybody,

I "accidentally" created a JIRA issue for my problem: https://issues.sonatype.org/browse/NEXUS-18744

The problem is described there. Peter Lynch already commented some first thoughts on it.

I'm not quite sure if this is a problem with the Apache Proxy neither with Nexus permissions.

In general I can install NPM packages proxied by https://www.npmjs.org (remote: https://registry.npmjs.org) but not this one: unicode-match-property-ecmascript (maybe more).

I can also not browse/find the package in my Nexus. It looks like the synchronization of the NPM packages is not complete.

Any more ideas on that?

msu...@sonatype.com

unread,
Dec 28, 2018, 10:57:38 AM12/28/18
to Nexus Users
Hi Daniel,

As Peter had suggested, have you tried the following?

  • trying hitting Nexus proxy repository URL directly instead of the going through the reverse proxy
Regards,
Mahendra

Daniel Koch

unread,
Dec 28, 2018, 11:19:45 AM12/28/18
to Nexus Users
Hi Mahendra,

yes. Same result.

And this makes sense for me because the package is not there. It seems the NPM proxy is not fully in-sync/complete.

Daniel

Peter Lynch

unread,
Dec 28, 2018, 11:37:29 AM12/28/18
to Daniel Koch, Nexus Users
Use silly npm log levels ( -ddd ) while accessing the npm proxy repository URL combined with some additional logging inside Nexus:

1. Click the Invalidate Cache on the npm proxy repo inside the repo config screen
2. Go to Adminisitration -> Support -> Logging. Change the logger org.sonatype.nexus.httpclient.outbound  level to DEBUG
3. Example: npm install -ddd --registry http://localhost:8081/repository/npm-proxy unicode-match-property-ecmascript@latest

Examine the nexus.log messages and the silly npm client log messages closely and you will find your answer.

--
You received this message because you are subscribed to the Google Groups "Nexus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nexus-users...@glists.sonatype.com.
To post to this group, send email to nexus...@glists.sonatype.com.
To view this discussion on the web visit https://groups.google.com/a/glists.sonatype.com/d/msgid/nexus-users/91c7b0a2-ca97-4762-8cc5-5447f8ec3a37%40glists.sonatype.com.
For more options, visit https://groups.google.com/a/glists.sonatype.com/d/optout.

Daniel Koch

unread,
Dec 31, 2018, 4:02:42 AM12/31/18
to Nexus Users, daniel....@gmail.com
Did it. But nothing helpful in the logs (at least for me). Still get 404 for the mentioned package. And the package is not in my Nexus (I searched with the UI with admin rights).

Is there a way to re-trigger the npm proxy sync?

I tried to set the cache times to -1 or 0.

msu...@sonatype.com

unread,
Dec 31, 2018, 4:23:47 AM12/31/18
to Nexus Users, daniel....@gmail.com
Hi Daniel,

Take a look at the org.sonatype.nexus.httpclient.outbound debug output (in the nexus.log) for the request for  unicode-match-property-ecmascript is made and see what the http response code is returned. It most likely the case that requests to https://registry.npmjs.org is blocked by some firewall/proxy. If you have configured Nexus to use a http proxy for outbound connections, then check the access logs of the http proxy for requests to https://registry.npmjs.org and unicode-match-property-ecmascript.

Regards,
Mahendra

Daniel Koch

unread,
Dec 31, 2018, 7:40:46 AM12/31/18
to Nexus Users, daniel....@gmail.com
Hi Mahendra,

thanks for your respond and your hint with the firewall/proxy.

I double checked everything, especially the logs from the webserver/proxy.

It turns out that some requests where blocked by an WAF. I added a rule for such calls and now it works!

Thank you all!

Best,
Daniel
Reply all
Reply to author
Forward
0 new messages