Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OAI Server: "earliestDateStamp" in the repository broken in 5.12.1; causing problems with serving incremental harvests #9309

Closed
landreev opened this issue Jan 19, 2023 · 3 comments · Fixed by #9316

Comments

@landreev
Copy link
Contributor

landreev commented Jan 19, 2023

This was an insane thing for me to have missed. 😢
In the new XOAI implementation (gdcc/xoai-5.0.0-RC1), validation was added for the "from=" parameter, rejecting the request if the date supplied is before what the OAI Repository thinks is the "earliest date stamp" in it. *) But the RepositoryConfiguration is still initialized with the default value of

.withEarliestDate(DateProvider.now())

and it's never reset in the Dataverse code. And "now" in this context means the time the OAI service was initialized.
Which in turn means that the server is going to reject any incremental request from a client that hasn't successfully harvested since the last time this Dataverse application was restarted (!).
Straightforward to fix; and we may want to consider applying the fix as a patch to our (Harvard) prod. before 5.13 is released.

*) Is this validation really necessary? I'm accepting full responsibility for missing this; and I'm all for fixing it - if nothing else, we want to advertise the correct date in the Identify verb. But I'm not sure I understand the point of rejecting requests on account of this; and I'm not seeing this spelled out in the OAI spec. May not be looking in the right place, etc.

@donsizemore
Copy link
Contributor

donsizemore commented Jan 20, 2023

I believe you've hit the nail on the head. Our broken ACSS harvest (which we were going to solve by upgrading) wasn't a good test; the upgraded (5.10.1) client succeeded the first time. After reading your issue I re-ran the 5.10.1 harvesting client and it failed. Harvard DV sent the same error it sent the 5.3 client:

<message>com.lyncode.xoai.serviceprovider.exceptions.InvalidOAIResponse OAI responded with code: badArgument
StackTrace: 
com.lyncode.xoai.serviceprovider.parsers.ListIdentifiersParser.hasNext(ListIdentifiersParser.java:50)
com.lyncode.xoai.serviceprovider.handler.ListIdentifierHandler.nextIteration(ListIdentifierHandler.java:80)
com.lyncode.xoai.serviceprovider.lazy.ItemIterator.hasNext(ItemIterator.java:40)
com.lyncode.xoai.serviceprovider.lazy.ItemIterator.&lt;init&gt;(ItemIterator.java:30)
com.lyncode.xoai.serviceprovider.ServiceProvider.listIdentifiers(ServiceProvider.java:71)
edu.harvard.iq.dataverse.harvest.client.oai.OaiHandler.runListIdentifiers(OaiHandler.java:226)
edu.harvard.iq.dataverse.harvest.client.HarvesterServiceBean.harvestOAI(HarvesterServiceBean.java:253)
edu.harvard.iq.dataverse.harvest.client.HarvesterServiceBean.doHarvest(HarvesterServiceBean.java:177)
edu.harvard.iq.dataverse.harvest.client.HarvesterServiceBean.doAsyncHarvest(HarvesterServiceBean.java:97)

@landreev
Copy link
Contributor Author

I'll make a quick PR shortly.

@landreev
Copy link
Contributor Author

But yes, good to know that #9197 appears to be caused by this same issue. I'll add it to the "closes" tag.
For the record, this was originally found while investigating IQSS/dataverse.harvard.edu/issues/206.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants