ExportXMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Normal
    • None
    • Component/s: listenbrainz-labs
    • None

      When using the recording-mbid-lookup method on the labs api or frontend, it either returns empty (via the api) or renders this error:

      Traceback (most recent call last):
        File "/usr/local/lib/python3.13/site-packages/datasethoster/main.py", line 211, in web_query_handler
          results = query.fetch(inputs, RequestSource.web)
        File "/code/listenbrainz/listenbrainz/labs_api/labs/api/recording_from_recording_mbid.py", line 67, in fetch
          output = [RecordingFromRecordingMBIDOutput(**row) for row in output]
                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^
        File "/usr/local/lib/python3.13/site-packages/pydantic/main.py", line 341, in __init__
          raise validation_error
      pydantic.error_wrappers.ValidationError: 9 validation errors for RecordingFromRecordingMBIDOutput
      tags -> 0
        str type expected (type=type_error.str)
      tags -> 1
        str type expected (type=type_error.str)
      tags -> 2
        str type expected (type=type_error.str)
      tags -> 3
        str type expected (type=type_error.str)
      tags -> 4
        str type expected (type=type_error.str)
      tags -> 5
        str type expected (type=type_error.str)
      tags -> 6
        str type expected (type=type_error.str)
      tags -> 7
        str type expected (type=type_error.str)
      tags -> 8
        str type expected (type=type_error.str)

       

      Repro:
      https://labs.api.listenbrainz.org/recording-mbid-lookup?recording_mbid=f939409f-c292-4a8f-ad18-3d8d4cc07376

      ... any browser/API client should repro.

      Analysis:
      The issue looks to have been introduced by adding the tags field to the RecordingFromRecordingMBIDOutput here (https://github.com/metabrainz/listenbrainz-server/blob/40dfa8484a5dfeccac57be8e81e1f3756987bb84/listenbrainz/labs_api/labs/api/recording_from_recording_mbid.py#L34)

      ..from this commit last week:
      https://github.com/metabrainz/listenbrainz-server/commit/b8258abef351ee114f851f1fb2b7ebc1d22d3470

      I don't know enough about the dataset but I'd surmise this is fixed with converting the tags type to Optional[list[str]] or if required, maybe upstream the query is not providing the needed results.  

       

       

            Assignee:
            amCap1712
            Reporter:
            ssweens
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

                Version Package