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

Postgresql extension errors since Schema #23 when replicating

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Invalid
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Schema Change
    • Labels:
      None

      Description

      (I ran this procedure dozens of times before for our test servers etc)

      Scenario:

      After creating the database and importing the dumps, I did ./admin/replication/LoadReplicationChanges and got this:

      , or } expected while parsing object/hash, at character offset 1 (before "\n") at /var/apps/musicbrainz-server/admin/replication/../../lib/MusicBrainz/Server/Constants.pm line 363.
      Compilation failed in require at /var/apps/musicbrainz-server/admin/replication/../../lib/MusicBrainz/Server/Validation.pm line 70.
      BEGIN failed--compilation aborted at /var/apps/musicbrainz-server/admin/replication/../../lib/MusicBrainz/Server/Validation.pm line 70.
      Compilation failed in require at /var/apps/musicbrainz-server/admin/replication/../../lib/MusicBrainz/Server/Translation.pm line 15.
      BEGIN failed--compilation aborted at /var/apps/musicbrainz-server/admin/replication/../../lib/MusicBrainz/Server/Translation.pm line 15.
      Compilation failed in require at /var/apps/musicbrainz-server/admin/replication/../../lib/DBDefs/Default.pm line 35.
      BEGIN failed--compilation aborted at /var/apps/musicbrainz-server/admin/replication/../../lib/DBDefs/Default.pm line 35.
      Compilation failed in require at /usr/share/perl/5.18/parent.pm line 20.
      BEGIN failed--compilation aborted at /var/apps/musicbrainz-server/admin/replication/../../lib/DBDefs.pm line 29.
      Compilation failed in require at ./admin/replication/LoadReplicationChanges line 32.
      BEGIN failed--compilation aborted at ./admin/replication/LoadReplicationChanges line 32.

      Turns out this was some problem related to JSON parsing or whatever do I just included the entities.json content as a variable in lib/MusicBrainz/Server/Constants.pm to proceed with local debugging.

      Then, I ran ./admin/replication/LoadReplicationChanges again and got this:

      Thu May 26 13:53:57 2016 : Downloading https://metabrainz.org/api/musicbrainz/replication-95704.tar.bz2 to /tmp/replication-95704.tar.bz2
      Thu May 26 13:54:00 2016 : Decompressing /tmp/replication-95704.tar.bz2 to /tmp/loadrep-1cNvv6
      TIMESTAMP
      COPYING
      README
      REPLICATION_SEQUENCE
      SCHEMA_SEQUENCE
      mbdump/dbmirror_pending
      mbdump/dbmirror_pendingdata
      Thu May 26 13:54:00 2016 : LAST_REPLICATION_SEQUENCE file missing or malformed
      Thu May 26 13:54:00 2016 : This packet was produced (or begins) at 2016-05-25 01:14:05.120308+00
      Thu May 26 13:54:00 2016 : LAST_TIMESTAMP file missing or malformed, setting to TIMESTAMP
      Thu May 26 13:54:00 2016 : Importing dbmirror_pending and dbmirror_pendingdata files
      Thu May 26 13:54:01 2016 : starting import
      Table Rows est% rows/sec
      NOTICE: drop cascades to constraint dbmirror_pendingdata_seqid_fkey on table dbmirror_pendingdata
      Thu May 26 13:54:01 2016 : load dbmirror_pending
      dbmirror_pending 6968 100% 395954 0.02 sec
      Thu May 26 13:54:01 2016 : load dbmirror_pendingdata
      dbmirror_pendingdata 11096 100% 575011 0.02 sec
      Thu May 26 13:54:01 2016 : import finished
      Loaded 2 tables (18064 rows) in 0 seconds
      Thu May 26 13:54:01 2016 : Removing /tmp/loadrep-1cNvv6
      Thu May 26 13:54:01 2016 : Processing replication changes
      WARNING: SET TRANSACTION can only be used in transaction blocks
      WARNING: SET CONSTRAINTS can only be used in transaction blocks
      XIDs Stmts est% XIDs/sec Stmt/sec
      480 4881 70% 62 636Use of uninitialized value $params[2] in join or string at /var/apps/musicbrainz-server/admin/replication/../../lib/Sql.pm line 115.
      Use of uninitialized value $params[3] in join or string at /var/apps/musicbrainz-server/admin/replication/../../lib/Sql.pm line 115.
      Use of uninitialized value $params[8] in join or string at /var/apps/musicbrainz-server/admin/replication/../../lib/Sql.pm line 115.
      Use of uninitialized value $params[9] in join or string at /var/apps/musicbrainz-server/admin/replication/../../lib/Sql.pm line 115.
      Use of uninitialized value $params[10] in join or string at /var/apps/musicbrainz-server/admin/replication/../../lib/Sql.pm line 115.
      Failed query:
      'UPDATE "musicbrainz"."place" SET "address" = ?, "area" = ?, "begin_date_day" = ?, "begin_date_month" = ?, "begin_date_year" = ?, "comment" = ?, "coordinates" = ?, "edits_pending" = ?, "end_date_day" = ?, "end_date_month" = ?, "end_date_year" = ?, "ended" = ?, "gid" = ?, "id" = ?, "last_updated" = ?, "name" = ?, "type" = ? WHERE "area" = ? AND "id" = ? AND "type" = ?'
      (5100 Melrose Ave, Hollywood 7703 1972 (34.083333,-118.311389) 1 f e1288aeb-f51f-4ab7-879d-7080ac17deff 1793 2016-05-25 01:00:43.731984+00 Conway Recording Studios 1 7703 1793 1)
      42704 DBD::Pg::st execute failed: ERROR: type "earth" does not exist
      LINE 1: ...ians($1))*sin(radians($2))),earth()*sin(radians($1)))::earth
      ^
      QUERY: SELECT cube(cube(cube(earth()*cos(radians($1))*cos(radians($2))),earth()*cos(radians($1))*sin(radians($2))),earth()*sin(radians($1)))::earth
      CONTEXT: SQL function "ll_to_earth" during inlining [for Statement "UPDATE "musicbrainz"."place" SET "address" = ?, "area" = ?, "begin_date_day" = ?, "begin_date_month" = ?, "begin_date_year" = ?, "comment" = ?, "coordinates" = ?, "edits_pending" = ?, "end_date_day" = ?, "end_date_month" = ?, "end_date_year" = ?, "ended" = ?, "gid" = ?, "id" = ?, "last_updated" = ?, "name" = ?, "type" = ? WHERE "area" = ? AND "id" = ? AND "type" = ?" with ParamValues: 1='5100 Melrose Ave, Hollywood', 2='7703', 3=undef, 4=undef, 5='1972', 6='', 7='(34.083333,-118.311389)', 8='1', 9=undef, 10=undef, 11=undef, 12='f', 13='e1288aeb-f51f-4ab7-879d-7080ac17deff', 14='1793', 15='2016-05-25 01:00:43.731984+00', 16='Conway Recording Studios', 17='1', 18='7703', 19='1793', 20='1']
      at /var/apps/musicbrainz-server/admin/replication/../../lib/Sql.pm line 115.
      Sql::catch

      Unknown macro: {...}

      ('MusicBrainz::Server::Exceptions::DatabaseError=HASH(0x49c55b8)') called at /usr/local/share/perl/5.18.2/Try/Tiny.pm line 115
      Try::Tiny::try('CODE(0x498f338)', 'Try::Tiny::Catch=REF(0x4999f60)') called at /var/apps/musicbrainz-server/admin/replication/../../lib/Sql.pm line 116
      Sql::do('Sql=HASH(0x48b9528)', 'UPDATE "musicbrainz"."place" SET "address" = ?, "area" = ?, "...', '5100 Melrose Ave, Hollywood', 7703, undef, undef, 1972, '', '(34.083333,-118.311389)', ...) called at /var/apps/musicbrainz-server/admin/replication/ProcessReplicationChanges line 328
      main::mirrorUpdate('Sql=HASH(0x4156e20)', 'Sql=HASH(0x48b9528)', 'ARRAY(0x4252af8)', 875924711, 'CODE(0x498ef00)') called at /var/apps/musicbrainz-server/admin/replication/ProcessReplicationChanges line 264
      main::mirrorCommand('u', 'Sql=HASH(0x4156e20)', 'Sql=HASH(0x48b9528)', 'ARRAY(0x4252af8)', 875924711, 'CODE(0x498ef00)') called at /var/apps/musicbrainz-server/admin/replication/ProcessReplicationChanges line 181

      I already did a lot of debugging but can't seem to able to solve this.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              pedrobx Pedro Almeida
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Packages

                Version Package