Uploaded image for project: 'MusicBrainz Server'
  1. MusicBrainz Server
  2. MBS-9366

duplicate key value violates unique constraint "artist_alias_idx_primary"

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • None
    • None
    • None
    • None

      If you try to import the replication packet from 2017-06-04 16:00:54.312309+00 you get this crash:

      vagrant@musicbrainz:~/bin$ tail-replication-log
              'UPDATE "musicbrainz"."artist_alias" SET "artist" = ?, "begin_date_day" = ?, "begin_date_month" = ?, "begin_date_year" = ?, "edits_pending" = ?, "end_date_day" = ?, "end_date_month" = ?, "end_date_year" = ?, "ended" = ?, "id" = ?, "last_updated" = ?, "locale" = ?, "name" = ?, "primary_for_locale" = ?, "sort_name" = ?, "type" = ? WHERE "artist" = ? AND "id" = ? AND "type" = ?'
              (347312    0    f 132184 2017-06-04 16:00:54.312309+00 ja 栄喜 t ひでき 1 994279 132184 1)
      23505 DBD::Pg::st execute failed: ERROR:  duplicate key value violates unique constraint "artist_alias_idx_primary"
      DETAIL:  Key (artist, locale)=(347312, ja) already exists. [for Statement "UPDATE "musicbrainz"."artist_alias" SET "artist" = ?, "begin_date_day" = ?, "begin_date_month" = ?, "begin_date_year" = ?, "edits_pending" = ?, "end_date_day" = ?, "end_date_month" = ?, "end_date_year" = ?, "ended" = ?, "id" = ?, "last_updated" = ?, "locale" = ?, "name" = ?, "primary_for_locale" = ?, "sort_name" = ?, "type" = ? WHERE "artist" = ? AND "id" = ? AND "type" = ?" with ParamValues: 1='347312', 2=undef, 3=undef, 4=undef, 5='0', 6=undef, 7=undef, 8=undef, 9='f', 10='132184', 11='2017-06-04 16:00:54.312309+00', 12='ja', 13='æ .å..', 14='t', 15='ã.²ã.§ã.�', 16='1', 17='994279', 18='132184', 19='1']
       at /musicbrainz-server/admin/replication/../../lib/Sql.pm line 115.
              Sql::catch {...} (MusicBrainz::Server::Exceptions::DatabaseError=HASH(0x2a22d78)) called at /usr/share/perl5/Try/Tiny.pm line 115
              Try::Tiny::try(CODE(0x2484578), Try::Tiny::Catch=REF(0x2a226b8)) called at /musicbrainz-server/admin/replication/../../lib/Sql.pm line 116
              Sql::do(Sql=HASH(0x2543f28), "UPDATE \"musicbrainz\".\"artist_alias\" SET \"artist\" = ?, \"begin_"..., 347312, undef, undef, undef, 0, undef, undef, ...) called at /musicbrainz-server/admin/replication/ProcessReplicationChanges line 331
              main::mirrorUpdate(Sql=HASH(0x25433d0), Sql=HASH(0x2543f28), ARRAY(0x2463318), 23744564, CODE(0x2a0e5f8)) called at /musicbrainz-server/admin/replication/ProcessReplicationChanges line 267
              main::mirrorCommand("u", Sql=HASH(0x25433d0), Sql=HASH(0x2543f28), ARRAY(0x2463318), 23744564, CODE(0x2a0e5f8)) called at /musicbrainz-server/admin/replication/ProcessReplicationChanges line 184

       

      What can we do?

            bitmap Michael Wiencek
            invisibleman78 Invisible Man
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Version Package