Details
-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
3.37.3
-
3
-
NXRM Sentinels Sprint 57
-
2
-
2
Description
SYMPTOM:
Running the "Repair - Reconcile component database from blob store" task against New DB (PostgreSQL) and against a blob store which is used by Nuget hosted repositories generated the following ERROR:
2022-02-07 21:29:35,391+1000 ERROR [quartz-11-thread-5] *SYSTEM com.sonatype.nexus.blobstore.restore.nuget.internal.NugetRestoreBlobStrategy - Error while restoring asset: blob store: default, repository: nuget-v3-hosted, path: /Test-2.0.1.1.nupkg, blob name: /Test-2.0.1.1.nupkg, blob id: 65a45bff-4035-4fd8-b9c2-94ff12e2956f java.lang.IllegalArgumentException: /Test-2.0.1.1.nupkg at com.sonatype.nexus.blobstore.restore.nuget.internal.NugetRestoreBlobStrategy.getPackageIdAndVersionFromPath(NugetRestoreBlobStrategy.java:156) at com.sonatype.nexus.blobstore.restore.nuget.internal.NugetRestoreBlobStrategy.createAssetFromBlob(NugetRestoreBlobStrategy.java:95) at org.sonatype.nexus.blobstore.restore.datastore.BaseRestoreBlobStrategy.restore(BaseRestoreBlobStrategy.java:115) at org.sonatype.nexus.blobstore.restore.datastore.RestoreMetadataTask.restore(RestoreMetadataTask.java:156) at org.sonatype.nexus.blobstore.restore.datastore.RestoreMetadataTask.execute(RestoreMetadataTask.java:115) at org.sonatype.nexus.blobstore.restore.datastore.RestoreMetadataTask.execute(RestoreMetadataTask.java:1) at org.sonatype.nexus.scheduling.TaskSupport.call(TaskSupport.java:100) ...
REPRODUCE STEPS:
- Install NXRM 3.37.3 with OrientDB
- (optional) Create a Nuget hosted repository (nuget-hosted should be already existed)
- Upload a nuget file
_NEXUS_BASE_URL="http://localhost:8081/" _REPO_NAME="nuget-hosted" curl -O -L 'https://globalcdn.nuget.org/packages/test.2.0.1.1.nupkg'; curl -D- -u admin:admin123 "${_NEXUS_BASE_URL%/}/service/rest/v1/components?repository=${_REPO_NAME}" -F "nuget.asset=@./test.2.0.1.1.nupkg" -H "accept: application/json" -H "Content-Type: multipart/form-data";
- Run the DB migrator to migrate to PostgreSQL
- Disable " Cleanup unused nuget blobs from nexus"
- Delete the uploaded nupkg file from the Nuget Hosted repo
- Run the reconcile task against the correct blob store with "Restore blob metadata" option (only)
Shortcut way:
- Instead of installing NXRM 3 with OrientDB, install NXRM 3 with PostgreSQL then
mkdir -p ${workingDirectory%/}/blobs/default/content/vol-25/chap-05; cp -v 6db614c6-0307-46bd-b56a-00d2c8c12893.properties ${workingDirectory%/}/blobs/default/content/vol-25/chap-05/6db614c6-0307-46bd-b56a-00d2c8c12893.properties curl -o ${workingDirectory%/}/blobs/default/content/vol-25/chap-05/6db614c6-0307-46bd-b56a-00d2c8c12893.bytes -L 'https://globalcdn.nuget.org/packages/test.2.0.1.1.nupkg';
- Run the reconcile task
EXPECTED BEHAVIOUR:
I understand New DB does not support Nuget V2, however, as per NEXUS-30109, I expect restoring Nuget hosted (V2) from OrientDB to PostgreSQL should be supported.
Reconcile component database from blob store task against Nuget hosted repo generates java.lang.IllegalArgumentException probably because NXRM3 + PostgreSQL does not support Nuget V2 type path (eg: either Test-2.0.1.1.nupkg or /Test-2.0.1.1.nupkg) but it expects "/{id}/{version}".
Attachments
Issue Links
- relates
-
NEXUS-30109 Repair - Reconcile component database from blob store task does not restore blobs created while running a different database type
-
- Closed
-