sul-dlss / dor-services-app

A Rails application exposing Digital Object Registry functions as a RESTful HTTP API
https://sul-dlss.github.io/dor-services-app/
Other
3 stars 2 forks source link

Fix 27 druids that have version mismatch issues #5128

Closed andrewjbtw closed 1 month ago

andrewjbtw commented 1 month ago

The following druids have version mismatch errors in the sdr-ingest-transfer step in accessionWF:

druid:fk830fp9668
druid:fm307dv9822
druid:fn705pp4786
druid:fp545zb6726
druid:fr393wt8309
druid:fs032kr9063
druid:fs444bd4973
druid:fs579hv2047
druid:ft689yt2452
druid:ft901gp4296
druid:fx925dk0468
druid:gb435rt0564
druid:gb642yj5483
druid:gc020xg8582
druid:gf100ms0909
druid:gf671mw8397
druid:gh954jv5320
druid:gk417tw8847
druid:gn461gr8669
druid:gp109rf4516
druid:gp950rx0991
druid:gt850gy6114
druid:gv117bg4551
druid:gy486wh3133
druid:gy503wv3688
druid:gz021qh0030
druid:gz094kr4904

In DSA, these items are at version 2, but preservation already has a version 2. In reality, these druids should be at version 3. This is why the error reads:

Error: sdr-ingest-transfer : problem with sdr-ingest-transfer (BackgroundJob: 33885904): {:errors=>[{:title=>"Preservation error", :detail=>"Version mismatch in /dor/workspace/fx/925/dk/0468/fx925dk0468/metadata/versionMetadata.xml, expected 3, found 2"}]}

I think we can fix the error by doing the following:

  1. Update the druids so that they are version 3. I think that must be do-able in DSA.

When updating the druids, use "reaccession" as the version description. That means both versions 2 and 3 will have the description "reaccession".

  1. Update the workflow service data so that it is operating on version 3.

Updating the workflow data might not be straightforward. The problem is that the previously existing workflow data from the original version 2 has mostly been overwritten by the current attempt to accession the item. You can see this in the current lifecycles for these objects:

 2 reaccession
    Opened  2023-08-09 21:28:35 UTC
    Submitted   2024-07-02 21:32:26 UTC
    Published   2024-07-02 21:32:37 UTC
    Deposited   pending
    Accessioned     pending

The "Opened" date is the original date that version 2 was created: 2023-08-09. The remaining dates are from the current attempt at accessioning. That means we need to:

When adding version 3 workflow data:

Then:

After version 3 workflows have been created, then "fix" version 2 so that it reflects the real version 2 created in 2023:

Once these steps are complete, we won't have precisely restored the previous workflow data for version 2, but we will have:

Once all of that is in place, I believe that retrying the sdr-ingest-transfer step will result in the item finishing accessioning with a new version 3 in preservation.

How did these items get into a problem state?

I think the problem was likely created by these objects not being properly "Closed" when they were last accessioned (the original version 2). From what I see in the workflow data, the last steps in the versioningWF were skipped rather than completed back in 2023. That may have meant the version 2 was never "finished" from DSA's perspective. That could be why the latest reaccessioning didn't get applied to a new version 3 and instead started to overwrite the existing version 2.

Additionally

There are 200+ items that have not yet generated version mismatches that are vulnerable to this error. I'm filing a separate ticket to remediate them in the hopes of preventing more version mismatches. If we can get to them before someone tries to accession them, we should be able to prevent this error from recurring.

aaron-collier commented 1 month ago

Remediated all objects.