Uploaded image for project: 'ListenBrainz'
  1. ListenBrainz
  2. LB-1075

Reconnecting Spotify account: psycopg2 Unique ID constraint violation for user_id_service_ndx_listens_importer

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • None
    • data dumps, import tools
    • None

      Got an e-mail saying ListenBrainz lost access to my Spotify account (which I did not do):

      We encountered an error while importing your listens from Spotify.
      The error was as follows: "It seems like you've revoked permission for us to read your spotify account"
      
      Please take a look at your Spotify import page (https://listenbrainz.org/profile/music-services/details/)
      for more information.

      Followed the link, and selected the top option (Activate Both Features)

      Then the Spotify login window popped up and I entered my credentials

      That went fine, but when we returned to the ListenBrainz page this error message popped up:

       

      (psycopg2.errors.UniqueViolation) duplicate key value violates unique constraint "user_id_service_ndx_listens_importer" DETAIL: Key (user_id, service)=(11309, spotify) already exists. [SQL: INSERT INTO listens_importer (external_service_oauth_id, user_id, service) VALUES (%(external_service_oauth_id)s, %(user_id)s, %(service)s) ] [parameters: {'external_service_oauth_id': 12949, 'user_id': 11309, 'service': 'spotify'}] (Background on this error at: http://sqlalche.me/e/13/gkpj)

      Looks like you tried INSERTing a record that should have been UPDATEd?

            kartik1712 amCap1712
            Computertoucher Chris Eveley
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                Version Package