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

hermes harvest return 0 on error #204

Closed
daniel-mohr opened this issue Aug 11, 2023 · 4 comments
Closed

hermes harvest return 0 on error #204

daniel-mohr opened this issue Aug 11, 2023 · 4 comments
Labels
architecture Describes some architectural decisions that need to be made bug Something isn't working conference-discussion Issues that could be discussed at next conference enhancement New feature or request meeting-discussion Issues that should be discussed at the next project meeting

Comments

@daniel-mohr
Copy link

Following Set up automatic software publishing I created a CITATION.cff and in the end in the pipeline the upload to zenodo sandbox fails with Error in 'hermes.deposit.publish' entry point 'invenio': With access_right open, a license is required..

The reason was that hermes harvest already claims:

!!! warning "CITATION.cff is not valid according to <https://citation-file-format.github.io/1.2.0/schema.json>"
    Invalid input for `root`.
    !!! message "'message' is a required property"

But still the command returned 0 and the pipeline passed. And for a user no error is recognizable.

I would suggest that hermes return an other value than 0 on error. Then the pipeline would break and the user is pointed to the error.

@led02
Copy link
Member

led02 commented Aug 11, 2023

You are right, even though we only get a warning during harvesting, we need to somehow signal / decide when we actually have an error (and signal this).

However, we are still not very happy with the different ways and rules that are applied for error processing: on the one hand, we want to be as resilient as possible. On the other hand, it's important to face the user with as much information as possible.

We're planning on producing an extensive HERMES runtime report using the Python logging facility. However, there are still some decitions to be taken:

  • How are errors during processing signalled and who handels them?
  • What errors should be treated as "fatal" and stop the processing pipeline (and at which "stage")? (I.e., it might be okay if some of the harvesters fail, as long as there is a consistent dataset produced... from time to time failing harvesters might even be helpful)
  • How to produce a (user readable) extensive and understandable report?

@led02 led02 added bug Something isn't working enhancement New feature or request meeting-discussion Issues that should be discussed at the next project meeting architecture Describes some architectural decisions that need to be made labels Aug 11, 2023
@daniel-mohr
Copy link
Author

I do not think that a harvesters should be allowed to fail. If the harvester if configured it should work. Otherwise a user can decide to use only some, e. g.:

[harvest]
from = [ "git" ]

@daniel-mohr
Copy link
Author

Maybe it could also be interesting to provide the user a simple solution to check the cff file, e. g. as gitlab ci pipeline using cffconvert and an official docker image (The provided citationcff/cffconvert docker image is pretty old and based on an old alpine:3.14.1.):

cffconvert__alpine:
  stage: pre
  image:
    name: alpine:latest
  script:
    - date
    - cat /etc/os-release
    - apk add --no-cache py3-attrs py3-click py3-dateutil py3-docopt py3-jsonschema py3-packaging py3-parsing py3-pip py3-pykwalify py3-pyrsistent py3-requests py3-retrying py3-setuptools py3-six
    - pip3 install cffconvert
    - cffconvert --validate

Or using the pre-commit hook.

This could be mentioned in the documentation.

@SKernchen SKernchen added the conference-discussion Issues that could be discussed at next conference label Sep 25, 2023
@led02
Copy link
Member

led02 commented Aug 6, 2024

In #253 there is a first fix to this. I.e., hermes exits with error code 1 when some command has an error (that might not be fatal), it stops with code 2 when there is an uncaught exception, otherwise the code will be 0.

This is behavior is still subject to change, follow up on issue #238

@led02 led02 closed this as completed Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
architecture Describes some architectural decisions that need to be made bug Something isn't working conference-discussion Issues that could be discussed at next conference enhancement New feature or request meeting-discussion Issues that should be discussed at the next project meeting
Projects
None yet
Development

No branches or pull requests

3 participants