Problem with search scoped packages since 3.42.0 - Sonatype Nexus Repository - Sonatype Community

Problem with search scoped packages since 3.42.0

post by amdorofeev on Apr 24, 2024

hello!

Has anyone encountered a problem finding scope packages in Nexus?

An example of a problematic search:

There are two packages in one repository:

“npm search mobile-test” shows only one package

“npm search @xxx/mobile-test” - no matches

I tried searching by api in nexus:

curl -X GET 'https://aaaa.bbbb/service/rest/v1/search?repository=yyyyy&name=mobile-test'

returns two packages (one has “name” : “@xxx/mobile-test”, the other “name” : “mobile-test”)

curl -X GET 'https://aaaa.bbbb/service/rest/v1/search?repository=yyyyy&name=@xxx/mobile-test'

returns null

The problem started with version 3.42.0 of nexus, before that everything was fine. Any ideas on how to fix this?

post by WeiterWeiterFertigstellen on Jun 6, 2025

@jzora Hey can you help with this? We have the same problem.

post by jzora on Jun 6, 2025

Without having more information, my first instinct would be to run the Repair - Rebuild Repository Search task.

Are you having this issue with all repositories in all formats? Have you recently done anything to your database or upgraded Nexus Repository?

post by WeiterWeiterFertigstellen on Jun 10, 2025

We created a new npm repository by following these docs: npm Registry

It works except for so called “scoped packages”.

This is what you see on the client side:

[dev-user@s051-runner01 ~]$ sudo npm --loglevel info install -g ember-cli
npm info using npm@9.2.0
npm info using node@v18.19.1
npm http fetch GET 200 https://nexus-repo.corp/repository/npm/ember-cli 24ms (cache hit)
npm http fetch GET 404 https://nexus-repo.corp/repository/npm/@pnpm%2ffind-workspace-dir 107ms (cache skip)
npm http fetch GET 404 https://nexus-repo.corp/repository/npm/@pnpm%2ffind-workspace-dir 10ms (cache skip)
npm http fetch GET 200 https://nexus-repo.corp/repository/npm/glob 265ms (cache hit)
npm http fetch GET 200 https://nexus-repo.corp/repository/npm/nopt 279ms (cache hit)
npm http fetch GET 200 https://nexus-repo.corp/repository/npm/chalk 280ms (cache hit)

...

npm http fetch GET 200 https://nexus-repo.corp/repository/npm/lodash 282ms (cache hit)
npm http fetch GET 200 https://nexus-repo.corp/repository/npm/global-modules 6ms (cache hit)
npm http fetch GET 404 https://nexus-repo.corp/repository/npm/@types%2ffs-extra 7ms (cache skip)
npm http fetch GET 404 https://nexus-repo.corp/repository/npm/@types%2frimraf 9ms (cache skip)
npm http fetch GET 404 https://nexus-repo.corp/repository/npm/@types%2ffs-extra 5ms (cache skip)
npm http fetch GET 404 https://nexus-repo.corp/repository/npm/@types%2frimraf 5ms (cache skip)

...
npm http fetch GET 200 https://nexus-repo.corp/repository/npm/base64-js 4ms (cache hit)
npm http fetch GET 200 https://nexus-repo.corp/repository/npm/ieee754 5ms (cache hit)
npm ERR! code E404
npm ERR! 404 Not Found - GET https://nexus-repo.corp/repository/npm/@pnpm%2ffind-workspace-dir
npm ERR! 404
npm ERR! 404 '@pnpm/find-workspace-dir@^1000.1.0' is not in this registry.
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2025-06-10T10_58_29_623Z-debug-0.log

post by WeiterWeiterFertigstellen on Jun 11, 2025

@jzora @amdorofeev

I fixed the problem! Cause were missing parameters in our Apache Reverse Proxy which sits in front of our Nexus Server:

Apache Reverse Proxy Documentation

post by jzora on Jun 11, 2025

Good! I apologize for not following up sooner – was trying to reproduce it on my side. I’ve marked this as the solution.