nexus-public icon indicating copy to clipboard operation
nexus-public copied to clipboard

'Repair - Reconcile component database from blob store' fails to import some items to DB

Open jo-krk opened this issue 1 year ago • 2 comments

Hello,

I have fresh installation of Nexus 3.61.0-02, where I'm trying to rebuild DB from scratch, based on blobs migrated from Nexus 3.54.1-01. I'm expecting 'Repair - Reconcile component database from blob store' task to do it and it partially succeeds , but some items, that exist in filesystem, are not imported into DB.

  • There are no errors in the log/tasks/blobstore.rebuildComponentDB-20231008151901212.log or log/nexus.log
  • 'Repair - Reconcile component database from blob store' task description talks about not being able to import older than 90 days items, but I can see that some older ones were successfully imported into DB.

I can't identify any unique parameters, why those particular items would be ignored. I can't import DB from that older Nexus installation as it was corrupted, the only source of truth are blob stores.

Any ideas why some of those items from blob stores are not imported into DB ? And how to fix it? Thank you

One of the items that fails to be imported:

root@nexus:/opt# cat sonatype-work/nexus3/blobs/default/content/vol-04/chap-31/46b14fe6-85e4-4cd9-b597-c9d934effc52.properties
#2020-09-24 13:38:24,232+0200
#Thu Sep 24 13:38:24 CEST 2020
@BlobStore.created-by=<redacted>
size=32
@Bucket.repo-name=maven-public-releases
creationTime=1600947504232
@BlobStore.created-by-ip=<redacted>
@BlobStore.content-type=text/plain
@BlobStore.blob-name=<redacted>.jar.md5
sha1=<redacted>

Permissions of the files are ok, the same as some other ones, that were successfully imported:

root@nexus:/opt# ls -l sonatype-work/nexus3/blobs/default/content/vol-04/chap-31/46b14fe6-85e4-4cd9-b597-c9d934effc52.*
-rw-r--r-- 1 nexus nexus  32 Sep 24  2020 sonatype-work/nexus3/blobs/default/content/vol-04/chap-31/46b14fe6-85e4-4cd9-b597-c9d934effc52.bytes
-rw-r--r-- 1 nexus nexus 353 Sep 24  2020 sonatype-work/nexus3/blobs/default/content/vol-04/chap-31/46b14fe6-85e4-4cd9-b597-c9d934effc52.properties

But, as mentioned, this item could not be found in DB:

orientdb {db=component}> select name from asset where blob_ref='default@46b14fe6-85e4-4cd9-b597-c9d934effc52'

0 item(s) found. Query executed in 1.452 sec(s).

jo-krk avatar Oct 08 '23 14:10 jo-krk

I noticed that some of those *.properties files were soft deleted (?) - they had deleted=true line in them. So I restored last good backup of the database and then I deleted:

  • all <id>.bytes and matching <id>.properties files in filesystem, that had deleted=true line in <id>.properties file
  • all of the <id>.bytes and matching <id>.properties files, that had @Bucket.repo-name=<group_name> in <id>.properties file, instead of @Bucket.repo-name=<hosted_repo_name>
  • all files in the filesystem, belonging to the proxy type blobstore
  • all the entries in asset class, component db
  • all the entries in components class, component db
  • all the entries in the browse_nodes class, component db

After that I ran 'Repair - Reconcile component database from blob store' task and it successfully finished and recreated entries inside the db.

Now, at least for the last few days, everything seems to be working ok again.

jo-krk avatar Oct 23 '23 14:10 jo-krk

This issue is stale because it has been open for 60 days with no activity.

github-actions[bot] avatar Jan 23 '24 01:01 github-actions[bot]

This issue was closed because it has been inactive for 90 days since being marked as stale.

github-actions[bot] avatar Apr 24 '24 01:04 github-actions[bot]