Do not register DOIs within calculateDOIDataFile

Slack discussion 2014-10-29

ryscher [10:09 AM]
It looks like newly-submitted items are attempting to register DOIs. Even items going into review. Luckily for us, they are failing due to the lack of an accession date. I assume this is related to last night's deploy of the changes for versioning? @dleehr @daisieh can you take another look at the logic for this?

dleehr [10:10 AM]
so everything is attempting a DOI registration - even before it's archived?

ryscher [10:11 AM]
I believe so... here are some sample DOIs that received registration failures:

ryscher [10:12 AM]
Many of these are in review, and I think one is still in the submitter's workspace.

ryscher [10:12 AM]
As a side note, I'm the only one getting these notifications right now.... admin@datadryad.org maps to my address -- I need to make it a group.

ryscher [10:13 AM]
A sample notice for you...
A Datacite EZID registration was not successfully completed, due to the following reason:

ERROR: BAD REQUEST - ELEMENT 'DATACITE': [XML] XML ERROR: CVC-COMPLEX-TYPE.2.4.A: INVALID CONTENT WAS FOUND STARTING WITH ELEMENT 'SUBJECTS'. ONE OF '{"HTTP://DATACITE.ORG/SCHEMA/KERNEL-2.2":PUBLICATIONYEAR}' IS EXPECTED.

dleehr [10:13 AM]
https://github.com/datadryad/dryad-repo/pull/730/files#diff-ebd4e782aa1505d1c7e9491f2d0c5beeR614

dleehr [10:14 AM]
this is calling mint with register as true

dleehr [10:15 AM]
in all cases - that should either be false or conditional

ryscher [10:15 AM]
The comment says "if versioning has already begun", so there's an assumption that an archived item exists already.

dleehr [10:18 AM]
not exactly

dleehr [10:18 AM]
it reads as a confusing comment

dleehr [10:19 AM]
but that's what's causing it - the case where there is no history (new item, mint a new doi)

dleehr [10:19 AM]
and canonical DOI does not exist

dleehr [10:19 AM]
mint it and register it

dleehr [10:21 AM]
I should have noticed that in code review

ryscher [10:22 AM]
Let's try to get a fix tested today, for deploy tonight.

dleehr [10:24 AM]
is daisieh available today?

dleehr [10:24 AM]
(i know it's still early there, just didn't know if she's working today or if this is on my plate)

ryscher [10:25 AM]
She usually doesn't have much time on Wednesdays, but she may have some today. We'll see when she wakes up.

daisieh [10:36 AM]
Luckily, I am one of those people who looks at my phone at all hours.

daisieh [10:37 AM]
I'll take a look. It sounds like it's related to something I did.

dleehr [10:46 AM]
The quick fix would be to change that true to a false on line 614 https://github.com/datadryad/dryad-repo/blob/dryad-master/dspace/modules/api/src/main/java/org/dspace/identifier/DOIIdentifierProvider.java#L614

dleehr [10:46 AM]
but I don't know if it should ever be true

dleehr [10:47 AM]
and the previous code didn't mint anything there

daisieh [10:47 AM]
you're fast

dleehr [10:49 AM]
well i've got a 3 hour head start :simple_smile:

daisieh [10:49 AM]
I imagine that it needs to be moved into the conditional...

daisieh [10:55 AM]
I put that line there because if versioning has already started (on an archived item), and you're trying to add a new file to a version, you need to be able to find the canonical DOI for that new file as well as the versioned file DOI

daisieh [10:55 AM]
but I don't know if that should be registered at that point.

daisieh [10:55 AM]
or if ever.

ryscher [10:56 AM]
no, versions should not be registered until they are approved by curators

daisieh [10:56 AM]
but it seems like it should be registered as well, doesn't it? (not in the bug case we have now, but in the original case)

daisieh [10:57 AM]
right. I think that that line should say false there, and that fixes this problem

ryscher [10:57 AM]
everything should be registered when it moves into archive/blackout -- I think all of the minting is handled before that

daisieh [11:02 AM]
Okay so at that point, it registers all the dois that have been minted for the package?

daisieh [11:05 AM]
@dleehr: if you submit that one fix as a pull request, I can review it really quick

dleehr [11:05 AM]
sure
NEW MESSAGES

daisieh [11:07 AM]
I think that it sounds like that should solve all of the problems.

daisieh [11:08 AM]
apologies for introducing a crazy bug!
Merge pull request #768 from dleehr/fix-eager-doi-registration

Fix issue where DOI registrations are attempted prior to blackout or archive