Bug 41222

Summary: SUSHI harvest should retry under certain conditions
Product: Koha Reporter: John Vinke <jvinke>
Component: ERMAssignee: Jonathan Druart <jonathan.druart>
Status: RESOLVED DUPLICATE QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: jonathan.druart, jonathan.field, martin.renvoize, mathsabypro, matt.blenkinsop, pedro.amorim
Version: 25.05   
Hardware: All   
OS: All   
GIT URL: Initiative type: ---
Sponsorship status: --- Comma delimited list of Sponsors:
Crowdfunding goal: 0 Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:

Description John Vinke 2025-11-07 19:05:23 UTC
At present, the "ERM Usage Statistics SUSHI Harvester" job will attempt to harvest usage data a single time.  There are several conditions specified in Appendix D of the COUNTER Code of Practice under which the job should retry.

https://cop5.countermetrics.org/en/5.1.0.1/appendices/d-handling-errors-and-exceptions.html#appendix-d

The main one is "Report Queued for Processing" which returns Exception Code 1011 and HTTP 202.  Retrying the request periodically until the report has processed would return the data.  I have seen this take between 2-40 minutes.  

There are also "Service Not Available" and "Service Busy" exceptions that this might apply to.
Comment 1 Mathieu Saby 2025-11-08 16:17:46 UTC
It seems a duplicate of https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38804 ?
Comment 2 John Vinke 2025-11-10 13:17:15 UTC
Oh yes, sorry I did not see that one.  This is a dupe.

*** This bug has been marked as a duplicate of bug 38804 ***