NASA-PDS / doi-service

Service and tools for generating DOIs for PDS bundles, collections, and data sets
https://nasa-pds.github.io/doi-service
Other
2 stars 3 forks source link

Service does not flag submissions with incorrect DOI prefix #302

Open collinss-jpl opened 2 years ago

collinss-jpl commented 2 years ago

๐Ÿ› Describe the bug

When submitting a release request to DataCite, the DOI service does not check beforehand if the DOI prefixes of the records match the one configured in the INI. This results in unintuitive errors returned from DataCite. The service should be able to check for this prior to submission and provide a better error message to the user.

๐Ÿ“œ To Reproduce

Steps to reproduce the behavior:

  1. Download this sample input label: doi_incorrect_prefix.json.txt
  2. Remove the ".txt" extension from the file (this was needed to upload to this ticket).
  3. Copy the doi_incorrect_prefix.json file to pds-gamma
  4. Submit the file to the DOI service with the release command (using the --no-review flag)
  5. An error similar to the following should be returned by the service:
pds_doi_service.core.entities.exceptions.CriticalDOIException: DOI submission request to DataCite service failed, reason: 403 Client Error: Forbidden for url: https://api.test.datacite.org/dois/10.12345/47kr-ta40
Details: ('{"errors":[{"status":"403","title":"You are not authorized to access this '
'resource."}]}')

๐Ÿ•ต๏ธ Expected behavior

The service should provide a more intuitive error message stating the incorrect prefix and the expected prefix based on what is configured in the INI.

๐Ÿ“š Version of Software Used

๐Ÿฉบ Test Data / Additional context

doi_incorrect_prefix.json.txt

๐ŸžScreenshots

๐Ÿ–ฅ System Info


๐Ÿฆ„ Related requirements

โš™๏ธ Engineering Details

jordanpadams commented 2 years ago

@collinss-jpl do we really need to check this? if we are not allowed to mint DOIs with that identifier, it will fail when we submit to Datacite anyways?

collinss-jpl commented 2 years ago

@jordanpadams I think this was an improvement suggested by Ron since he ran into this issue and had a hard time troubleshooting because of the obtuse error message DataCite provide back. I would still consider this a low priority, nice-to-have.

jordanpadams commented 2 years ago

moving to icebox. the error messages may be unintuitive, but we have bigger things to do right now