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

Improve harvest error reporting #1257

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

LukasKalbertodt
Copy link
Member

Previously, when an item failed to deserialize, we logged this:

WARN  tobira::sync::harvest >  Could not deserialize item in harvest response for kind 'event' (updated 2024-10-02 09:01:49.038 UTC)

This always required, manually finding the item with said updated time, then writing some code to actually find out whats wrong.

With this PR, Tobira will log an actual useful error and the whole raw value. See this (I added dummy required field title2 to cause an error):

ERROR tobira::sync::harvest >  Could not deserialize 'event' harvest item -> ignoring. Error: missing field `title2`
DEBUG tobira::sync::harvest >  Raw value: {
                            >    "acl": {
                            >      "read": [
                            >        "ROLE_ANONYMOUS"
                            >      ]
                            >    },
                            >    "captions": [],
                            >    "created": 1460505600000,
                            >    "creators": [
                            >      "Dissertori,  Günther"
                            >    ],
                            >    "description": null,
                            >    "duration": 5637803,
                            >    "endTime": 1460543400000,
                            >    "id": "09828f52-b684-32b3-a614-cbb96fc63ee8",
                            >    "isLive": false,
                            >    "kind": "event",
                            >    "metadata": {
                            >      "dcterms": {
                            >        "contributor": [
                            >          "D-PHYS"
                            >        ],
                            >        "issued": [
                            >          "2016-04-14"
                            >        ],
                            >        "language": [
                            >          "deu"
                            >        ],
                            >        "license": [
                            >          "CC-BY-NC-ND"
                            >        ],
                            >        "publisher": [
                            >          "ETH Zürich, ID-MMS; Schweiz"
                            >        ],
                            >        "rightsHolder": [
                            >          "ETH Zürich, Schweiz"
                            >        ],
                            >        "spatial": [
                            >          "Zürich, Schweiz; ETH Zürich, HPV G 5"
                            >        ],
                            >        "temporal": [
                            >          "start=2016-04-13T08:45:00Z; end=2016-04-13T10:30:00Z; scheme=W3C-DTF;"
                            >        ],
                            >        "type": [
                            >          "MovingImage"
                            >        ]
                            >      },
                            >      "http://ethz.ch/video/metadata": {
                            >        "owner": [
                            >          "Dissertori, Günther"
                            >        ]
                            >      }
                            >    },
                            >    "partOf": "97eea518-409b-372b-b47a-54483658fc0c",
                            >    "segments": [],
                            >    "slideText": null,
                            >    "startTime": 1460537100000,
                            >    "thumbnail": "https://tobira-test-oc.ethz.ch/static/mh_default_org/engage-player/09828f52-b684-32b3-a614-cbb96fc63ee8/0579ed69-56f2-4d4d-878d-d85210e8df30/presentation_0dd34669_9a79_4a1b_be52_216ba65f4688_3_000s_player_preview_16_9_all_to_16_9_640x360.jpg",
                            >    "timelinePreview": null,
                            >    "title": "Einführung in die Kern- und Teilchenphysik",
                            >    "tracks": [
                            >      {
                            >        "flavor": "presentation/delivery",
                            >        "isMaster": false,
                            >        "mimetype": "video/webm",
                            >        "resolution": [
                            >          640,
                            >          360
                            >        ],
                            >        "uri": "https://tobira-test-oc.ethz.ch/static/mh_default_org/engage-player/09828f52-b684-32b3-a614-cbb96fc63ee8/82d70840-8acc-41aa-9c0d-9236be3e4112/presentation_0dd34669_9a79_4a1b_be52_216ba65f4688.webm"
                            >      },
                            >      {
                            >        "flavor": "presentation/delivery",
                            >        "isMaster": false,
                            >        "mimetype": "video/mp4",
                            >        "resolution": [
                            >          1280,
                            >          720
                            >        ],
                            >        "uri": "https://tobira-test-oc.ethz.ch/static/mh_default_org/engage-player/09828f52-b684-32b3-a614-cbb96fc63ee8/5f782138-8194-4368-8543-26c284d2b168/presentation_0dd34669_9a79_4a1b_be52_216ba65f4688.mp4"
                            >      },
                            >      {
                            >        "flavor": "presentation/delivery",
                            >        "isMaster": false,
                            >        "mimetype": "video/webm",
                            >        "resolution": [
                            >          1280,
                            >          720
                            >        ],
                            >        "uri": "https://tobira-test-oc.ethz.ch/static/mh_default_org/engage-player/09828f52-b684-32b3-a614-cbb96fc63ee8/4b776ef3-f1bd-4fe9-be16-f828374cdd2a/presentation_0dd34669_9a79_4a1b_be52_216ba65f4688.webm"
                            >      },
                            >      {
                            >        "flavor": "presentation/delivery",
                            >        "isMaster": false,
                            >        "mimetype": "video/mp4",
                            >        "resolution": [
                            >          640,
                            >          360
                            >        ],
                            >        "uri": "https://tobira-test-oc.ethz.ch/static/mh_default_org/engage-player/09828f52-b684-32b3-a614-cbb96fc63ee8/ccab01b9-f1c6-45b0-a6a5-c4648c5d96dc/presentation_0dd34669_9a79_4a1b_be52_216ba65f4688.mp4"
                            >      }
                            >    ],
                            >    "updated": 1626161268818
                            >  }
      

No runtime behavior should be changed, but enables us to deserialize
a specific item individually.
@github-actions github-actions bot temporarily deployed to test-deployment-pr1257 October 2, 2024 16:05 Destroyed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant