Details
-
Bug
-
Resolution: Duplicate
-
Major
-
3.34.0, 3.36.0
-
None
Description
SYMPTOM:
After rolling back from the NewDB (PostgreSQL) to OrientDB, ran the "Reconcile component database from blob store" task, then it reported ERRORs for NPM assets:
2021-11-29 11:46:17,939+1000 ERROR [quartz-10-thread-11] *SYSTEM com.sonatype.nexus.blobstore.restore.internal.orient.OrientNpmRestoreBlobStrategy - Error while restoring asset: blob store: default, repository: npm-proxy, path: /@types/lodash, blob name: /@types/lodash, blob id: ce1af3d0-d758-4b96-9ae8-17528dcf0e72 java.lang.IllegalArgumentException: Non URL-safe name: /@types/lodash at com.google.common.base.Preconditions.checkArgument(Preconditions.java:219) at com.sonatype.nexus.repository.npm.internal.NpmPackageId.<init>(NpmPackageId.java:54) at com.sonatype.nexus.repository.npm.internal.NpmPackageId.parse(NpmPackageId.java:132) at com.sonatype.nexus.repository.npm.internal.orient.NpmFacetImpl.findPackageRootAsset(NpmFacetImpl.java:91) at com.sonatype.nexus.blobstore.restore.internal.orient.OrientNpmRestoreBlobStrategy.assetExists(OrientNpmRestoreBlobStrategy.java:104) ...
REPRODUCE STEPS:
- Install new NXRM 3.36 and start (so that "default" blob store is empty)
- Copy the attached ce1af3d0-d758-4b96-9ae8-17528dcf0e72.* to default/contents/vol-33/chap-11/, for example:
mkdir -p sonatype-work/nexus3/blobs/default/content/vol-33/chap-11 cp ./ce1af3d0-d758-4b96-9ae8-17528dcf0e72.* sonatype-work/nexus3/blobs/default/content/vol-33/chap-11/
- Create "npm-proxy" repo with the remote URL https://registy.npmjs.org/ and with the "default" blob store
- Create "Reconcile component database from blob store" task and run against "default" blob store
EXPECTED BEHAVIOUR:
As NXRM3 should provide the way to reconcile assets, this should restore the files.
ACTUAL BEHAVIOUR:
It does not restore the asset and the task log reports "Error while restoring asset: ...".
POTENTIAL CAUSE:
com.sonatype.nexus.repository.npm.internal.NpmPackageId#parse decides the scope and the npm name based on the first matching "/", so that the name starts with "/" ended up generate an empty scope (eg: "") and the non modified name (eg: "/@types/lodash").
NOTE:
Also, reconciling NPM assets created by OrientDB may not work with Nexus + NewDB because org.sonatype.nexus.blobstore.restore.datastore.BaseRestoreBlobStrategy#restore always prepend "ASSET_PATH_PREFIX" into the assetPath.
Attachments
Issue Links
- is related to
-
NEXUS-29789 Reconcile component database from blob store task does not restore docker assets which name starts with "/"
-
- Closed
-
- is superceded by
-
NEXUS-30109 Repair - Reconcile component database from blob store task does not restore blobs created while running a different database type
-
- Closed
-