overseerr icon indicating copy to clipboard operation
overseerr copied to clipboard

SQLITE_CONSTRAINT: UNIQUE constraint failed: media.tvdbId

Open othyn opened this issue 1 year ago • 1 comments

Description

When trying to add "The Great British Bake Off" I get the error:

Something went wrong while submitting the request.

To try and gather some more information, the following appears in the network inspector as the JSON response from the backend API:

{
    "message": "SQLITE_CONSTRAINT: UNIQUE constraint failed: media.tvdbId"
}

Version

1.29.1 (stable) (latest)

Steps to Reproduce

  1. When trying to add "The Great British Bake Off", the url slug being /tv/87012, it firstly asks which TV series to link to as there are multiple results, on the popup presented when clicking 'request', it shows:

We couldn't automatically match your request. Please select the correct match from the list below.

  1. I then select the first top-left result "The Great British Bake Off" and proceed to select the seasons.
  2. Upon hitting request, I get the following error message:

Something went wrong while submitting the request.

  1. To then debug further, and out of habit, I went snooping in the network inspector and confirmed the following 500 error response from the POST request to /api/v1/request:

Request:

{
    "mediaId": 87012,
    "tvdbId": 184871,
    "mediaType": "tv",
    "is4k": false,
    "seasons": [
        6
    ],
    "serverId": 0,
    "profileId": 1,
    "rootFolder": "/data",
    "languageProfileId": 1,
    "userId": 1,
    "tags": []
}

Response:

{
    "message": "SQLITE_CONSTRAINT: UNIQUE constraint failed: media.tvdbId"
}

Screenshots

N/A

Logs

N/A

Platform

desktop

Device

MacBook M1 Pro

Operating System

macOS 12.5

Browser

Firefox 104.0.1 (64 bit)

Additional Context

Service is running as a Docker container.

Code of Conduct

  • [X] I agree to follow Overseerr's Code of Conduct

othyn avatar Sep 05 '22 08:09 othyn

Ah, it was partly confusion I think.

I double checked the series air date on the popup:

We couldn't automatically match your request. Please select the correct match from the list below.

and selected a different series that aligned with the original show selected by its air date.

Its a bit complicated as the show changed hands from BBC to Channel 4 in 2016/17 and so has two entries. The show I had selected was the 2017 Channel 4 version, but the release I was selecting on the match select modal was the original 2010 (BBC) release, which I'd already added as that appears as its own entity on the parent search list UI.

Once I selected the correct entry (the 2017 version for the 2017 release) it was fine.

Although could the UX experience or error message for this scenario be improved? Perhaps something like:

You've already requested this version of the show.

and/or grey out that option, or hide it entirely, from the UI on the popup window?

othyn avatar Sep 05 '22 08:09 othyn