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

Internal server error entering an existing ISO code

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 2013-07-08
    • None
    • None
    • None

      If you try to use an ISO code that's already in the database:

      Error:

      Caught exception in MusicBrainz::Server::Controller::Area->create "The edit could not be created.
      POST: $VAR1 =

      Unknown macro: { 'edit-area.name' => 'foo', 'edit-area.iso_3166_3.0' => '', 'edit-area.period.end_date.month' => '', 'edit-area.iso_3166_2.0' => '', 'edit-area.period.begin_date.month' => '', 'edit-area.sort_name' => 'bar', 'edit-area.period.begin_date.day' => '', 'edit-area.period.end_date.day' => '', 'edit-area.period.begin_date.year' => '', 'edit-area.period.end_date.year' => '', 'edit-area.edit_note' => '', 'edit-area.iso_3166_1.0' => 'ZX', 'edit-area.type_id' => '' }

      ;

      Exception:$VAR1 = 'Failed query:
      \'INSERT INTO iso_3166_1 (area, code) VALUES (?, ?)\'
      (268 ZX)
      DBD::Pg::st execute failed: ERROR: duplicate key value violates unique constraint "iso_3166_1_pkey"
      DETAIL: Key (code)=(ZX) already exists. at lib/Sql.pm line 107, line 3.

      at lib/Sql.pm line 113, line 3.
      Sql::_ANON_(\'DBD::Pg::st execute failed: ERROR: duplicate key value viola...\') called at /home/musicbrainz/musicbrainz-server/admin/../local/lib/perl5/Try/Tiny.pm line 100
      Try::Tiny::try(\'CODE(0x12ace200)\', \'Try::Tiny::Catch=REF(0x12aeec20)\') called at lib/Sql.pm line 114
      Sql::do(\'Sql=HASH(0x12ae4f78)\', \'INSERT INTO iso_3166_1 (area, code) VALUES (?, ?)\', 268, \'ZX\') called at lib/MusicBrainz/Server/Data/Area.pm line 121
      MusicBrainz::Server::Data::Area::_set_codes(\'MusicBrainz::Server::Data::Area=HASH(0xa615e18)\', 268, \'iso_3166_1\', \'ARRAY(0x12a6d760)\') called at lib/MusicBrainz/Server/Data/Area.pm line 129
      MusicBrainz::Server::Data::Area::set_all_codes(\'MusicBrainz::Server::Data::Area=HASH(0xa615e18)\', 268, \'HASH(0x12a8d318)\') called at lib/MusicBrainz/Server/Data/Area.pm line 149
      MusicBrainz::Server::Data::Area::insert(\'MusicBrainz::Server::Data::Area=HASH(0xa615e18)\', \'HASH(0x12a8d318)\') called at lib/MusicBrainz/Server/Edit/Generic/Create.pm line 45
      MusicBrainz::Server::Edit::Generic::Create::insert(\'MusicBrainz::Server::Edit::Area::Create=HASH(0x12a7b150)\') called at lib/MusicBrainz/Server/Data/Edit.pm line 433
      MusicBrainz::Server::Data::Edit::create(\'MusicBrainz::Server::Data::Edit=HASH(0xabbe978)\', \'editor_id\', 481628, \'privileges\', 384, \'iso_3166_3\', \'ARRAY(0x12a689d0)\', \'iso_3166_2\', \'ARRAY(0x12a51490)\', ...) called at lib/MusicBrainz/Server/Controller.pm line 85
      MusicBrainz::Server::Controller::_ANON_() called at /home/musicbrainz/musicbrainz-server/admin/../local/lib/perl5/Try/Tiny.pm line 76
      eval

      Unknown macro: {...}

      called at /home/musicbrainz/musicbrainz-server/admin/../local/lib/perl5/Try/Tiny.pm line 67
      Try::Tiny::try(\'CODE(0x12a7ca30)\', \'Try::Tiny::Catch=REF(0x12a6df70)\') called at lib/MusicBrainz/Server/Controller.pm line 101
      MusicBrainz::Server::Controller::_insert_edit(\'MusicBrainz::Server::Controller::Area=HASH(0x54529c0)\', \'MusicBrainz::Server=HASH(0x12a8eeb0)\', \'MusicBrainz::Server::Form::Area=HASH(0x12aee8c0)\', \'edit_type\', 81, \'name\', \'foo\', \'sort_name\', \'bar\', ...) called at lib/MusicBrainz/Server/Controller.pm line 136
      MusicBrainz::Server::Controller::_ANON_() called at lib/Sql.pm line 307
      Sql::_ANON_() called at /home/musicbrainz/musicbrainz-server/admin/../local/lib/perl5/Try/Tiny.pm line 76
      eval

      called at /home/musicbrainz/musicbrainz-server/admin/../local/lib/perl5/Try/Tiny.pm line 67
      Try::Tiny::try(\'CODE(0x12a8d400)\', \'Try::Tiny::Catch=REF(0x12a66be0)\') called at lib/Sql.pm line 320
      Sql::_auto_transaction(\'CODE(0x12a68508)\', \'Sql=HASH(0x12ae4f78)\') called at lib/Sql.pm line 325
      Sql::_run_in_transaction_one(\'CODE(0x12a68508)\', \'Sql=HASH(0x12ae4f78)\') called at lib/Sql.pm line 339
      Sql::run_in_transaction(\'CODE(0x12a68508)\', \'Sql=HASH(0x12ae4f78)\') called at lib/MusicBrainz/Server/Model/MB.pm line 19
      MusicBrainz::Server::Model::MB::with_transaction(\'MusicBrainz::Server::Model::MB=HASH(0x7402458)\', \'CODE(0x12a68508)\') called at lib/MusicBrainz/Server/Controller.pm line 147
      MusicBrainz::Server::Controller::edit_action(\'MusicBrainz::Server::Controller::Area=HASH(0x54529c0)\', \'MusicBrainz::Server=HASH(0x12a8eeb0)\', \'form\', \'Area\', \'type\', 81, \'on_creation\', \'CODE(0x12a51b98)\') called at lib/MusicBrainz/Server/Controller/Role/Create.pm line 56
      Moose::Meta::Role::_ANON_::SERIAL::64::create(\'MusicBrainz::Server::Controller::Area=HASH(0x54529c0)\', \'MusicBrainz::Server=HASH(0x12a8eeb0)\') called at /home/musicbrainz/musicbrainz-server/admin/../local/lib/perl5/x86_64-linux-gnu-thread-multi/Class/MOP/Method/Wrapped.pm line 50
      Class::MOP::Method::Wrapped::_ANON_(\'MusicBrainz::Server::Controller::Area=HASH(0x54529c0)\', \'MusicBrainz::Server=HASH(0x12a8eeb0)\') called at /home/musicbrainz/musicbrainz-server/admin/../local/lib/perl5/x86_64-linux-gnu-thread-multi/Class/MOP/Method/Wrapped.pm line 91
      MusicBrainz::Server::Controller::Area::create(\'MusicBrainz::Server::Controller::Area=HASH(0x54529c0)\', \'MusicBrainz::Server=HASH(0x12a8eeb0)\') called at /home/musicbrainz/musicbrainz-server/admin/../local/lib/perl5/Catalyst/Action.pm line 65
      Catalyst::Action::execute(\'Catalyst::Action=HASH(0xc1eac40)\', \'MusicBrainz::Server::Controller::Area=HASH(0x54529c0)\', \'MusicBrainz::Server=HASH(0x12a8eeb0)\') called at /home/musicbrainz/musicbrainz-server/admin/../local/lib/perl5/Catalyst.pm line 1672
      eval

      Unknown macro: {...}

      called at /home/musicbrainz/musicbrainz-server/admin/../local/lib/perl5/Catalyst.pm line 1672
      Catalyst::execute(\'MusicBrainz::Server=HASH(0x12a8eeb0)\', \'MusicBrainz::Server::Controller::Area\', \'Catalyst::Action=HASH(0xc1eac40)\') called at /home/musicbrainz/musicbrainz-server/admin/../local/lib/perl5/Catalyst/Plugin/StackTrace.pm line 94
      Catalyst::Plugin::StackTrace::execute(\'MusicBrainz::Server=HASH(0x12a8eeb0)\', \'MusicBrainz::Server::Controller::Area\', \'Catalyst::Action=HASH(0xc1eac40)\') called at /home/musicbrainz/musicbrainz-server/admin/../local/lib/perl5/Catalyst/Action.pm line 60
      Catalyst::Action::dispatch(\'Catalyst::Action=HASH(0xc1eac40)\', \'MusicBrainz::Server=HASH(0x12a8eeb0)\') called at /home/musicbrainz/musicbrainz-server/admin/../local/lib/perl5/Catalyst/Controller.pm line 158
      Catalyst::Controller::_ACTION(\'MusicBrainz::Server::Controller::Area=HASH(0x54529c0)\', \'MusicBrainz::Server=HASH(0x12a8eeb0)\') called at /home/musicbrainz/musicbrainz-server/admin/../local/lib/perl5/Catalyst/Action.pm line 65
      Catalyst::Action::execute(\'Catalyst::Action=HASH(0xc1d9e60)\', \'MusicBrainz::Server::Controller::Area=HASH(0x54529c0)\', \'MusicBrainz::Server=HASH(0x12a8eeb0)\') called at /home/musicbrainz/musicbrainz-server/admin/../local/lib/perl5/Catalyst.pm line 1672
      eval

      called at /home/musicbrainz/musicbrainz-server/admin/../local/lib/perl5/Catalyst.pm line 1672
      Catalyst::execute(\'MusicBrainz::Server=HASH(0x12a8eeb0)\', \'MusicBrainz::Server::Controller::Area\', \'Catalyst::Action=HASH(0xc1d9e60)\') called at /home/musicbrainz/musicbrainz-server/admin/../local/lib/perl5/Catalyst/Plugin/StackTrace.pm line 94
      Catalyst::Plugin::StackTrace::execute(\'MusicBrainz::Server=HASH(0x12a8eeb0)\', \'MusicBrainz::Server::Controller::Area\', \'Catalyst::Action=HASH(0xc1d9e60)\') called at /home/musicbrainz/musicbrainz-server/admin/../local/lib/perl5/Catalyst/Action.pm line 60
      Catalyst::Action::dispatch(\'Catalyst::Action=HASH(0xc1d9e60)\', \'MusicBrainz::Server=HASH(0x12a8eeb0)\') called at /home/musicbrainz/musicbrainz-server/admin/../local/lib/perl5/Catalyst/Dispatcher.pm line 257
      Catalyst::Dispatcher::_do_forward(\'Catalyst::Dispatcher=HASH(0x3755380)\', \'forward\', \'MusicBrainz::Server=HASH(0x12a8eeb0)\', \'_ACTION\') called at /home/musicbrainz/musicbrainz-server/admin/../local/lib/perl5/Catalyst/Dispatcher.pm line 237
      Catalyst::Dispatcher::forward(\'Catalyst::Dispatcher=HASH(0x3755380)\', \'MusicBrainz::Server=HASH(0x12a8eeb0)\', \'_ACTION\') called at /home/musicbrainz/musicbrainz-server/admin/../local/lib/perl5/Catalyst.pm line 362
      Catalyst::forward(\'MusicBrainz::Server=HASH(0x12a8eeb0)\', \'_ACTION\') called at /home/musicbrainz/musicbrainz-server/admin/../local/lib/perl5/Catalyst/Controller.pm line 132
      Catalyst::Controller::_DISPATCH(\'MusicBrainz::Server::Controller::Area=HASH(0x54529c0)\', \'MusicBrainz::Server=HASH(0x12a8eeb0)\') called at /home/musicbrainz/musicbrainz-server/admin/../local/lib/perl5/Catalyst/Action.pm line 65
      Catalyst::Action::execute(\'Catalyst::Action=HASH(0xc1d9b48)\', \'MusicBrainz::Server::Controller::Area=HASH(0x54529c0)\', \'MusicBrainz::Server=HASH(0x12a8eeb0)\') called at /home/musicbrainz/musicbrainz-server/admin/../local/lib/perl5/Catalyst.pm line 1672
      eval

      Unknown macro: {...}

      called at /home/musicbrainz/musicbrainz-server/admin/../local/lib/perl5/Catalyst.pm line 1672
      Catalyst::execute(\'MusicBrainz::Server=HASH(0x12a8eeb0)\', \'MusicBrainz::Server::Controller::Area\', \'Catalyst::Action=HASH(0xc1d9b48)\') called at /home/musicbrainz/musicbrainz-server/admin/../local/lib/perl5/Catalyst/Plugin/StackTrace.pm line 94
      Catalyst::Plugin::StackTrace::execute(\'MusicBrainz::Server=HASH(0x12a8eeb0)\', \'MusicBrainz::Server::Controller::Area\', \'Catalyst::Action=HASH(0xc1d9b48)\') called at /home/musicbrainz/musicbrainz-server/admin/../local/lib/perl5/Catalyst/Action.pm line 60
      Catalyst::Action::dispatch(\'Catalyst::Action=HASH(0xc1d9b48)\', \'MusicBrainz::Server=HASH(0x12a8eeb0)\') called at /home/musicbrainz/musicbrainz-server/admin/../local/lib/perl5/Catalyst/Dispatcher.pm line 257
      Catalyst::Dispatcher::_do_forward(\'Catalyst::Dispatcher=HASH(0x3755380)\', \'forward\', \'MusicBrainz::Server=HASH(0x12a8eeb0)\', \'/area/_DISPATCH\') called at /home/musicbrainz/musicbrainz-server/admin/../local/lib/perl5/Catalyst/Dispatcher.pm line 237
      Catalyst::Dispatcher::forward(\'Catalyst::Dispatcher=HASH(0x3755380)\', \'MusicBrainz::Server=HASH(0x12a8eeb0)\', \'/area/_DISPATCH\') called at /home/musicbrainz/musicbrainz-server/admin/../local/lib/perl5/Catalyst.pm line 362
      Catalyst::forward(\'MusicBrainz::Server=HASH(0x12a8eeb0)\', \'/area/_DISPATCH\') called at /home/musicbrainz/musicbrainz-server/admin/../local/lib/perl5/Catalyst/Dispatcher.pm line 105
      Catalyst::Dispatcher::dispatch(\'Catalyst::Dispatcher=HASH(0x3755380)\', \'MusicBrainz::Server=HASH(0x12a8eeb0)\') called at /home/musicbrainz/musicbrainz-server/admin/../local/lib/perl5/Catalyst.pm line 1618
      Catalyst::dispatch(\'MusicBrainz::Server=HASH(0x12a8eeb0)\') called at lib/MusicBrainz/Server.pm line 326
      MusicBrainz::Server::_ANON_() called at lib/MusicBrainz/Server.pm line 300
      MusicBrainz::Server::with_translations(\'MusicBrainz::Server=HASH(0x12a8eeb0)\', \'CODE(0x12afc9f8)\') called at lib/MusicBrainz/Server.pm line 327
      Class::MOP::Class:::around(\'CODE(0x2ae5700)\', \'MusicBrainz::Server=HASH(0x12a8eeb0)\') called at /home/musicbrainz/musicbrainz-server/admin/../local/lib/perl5/x86_64-linux-gnu-thread-multi/Class/MOP/Method/Wrapped.pm line 162
      Class::MOP::Method::Wrapped::_ANON_(\'MusicBrainz::Server=HASH(0x12a8eeb0)\') called at lib/MusicBrainz/Server.pm line 341
      Class::MOP::Class:::around(\'CODE(0xc40c490)\', \'MusicBrainz::Server=HASH(0x12a8eeb0)\') called at /home/musicbrainz/musicbrainz-server/admin/../local/lib/perl5/x86_64-linux-gnu-thread-multi/Class/MOP/Method/Wrapped.pm line 162
      Class::MOP::Method::Wrapped::_ANON_(\'MusicBrainz::Server=HASH(0x12a8eeb0)\') called at lib/MusicBrainz/Server.pm line 386
      Class::MOP::Class:::around(\'CODE(0xc425170)\', \'MusicBrainz::Server=HASH(0x12a8eeb0)\') called at /home/musicbrainz/musicbrainz-server/admin/../local/lib/perl5/x86_64-linux-gnu-thread-multi/Class/MOP/Method/Wrapped.pm line 162
      Class::MOP::Method::Wrapped::_ANON_(\'MusicBrainz::Server=HASH(0x12a8eeb0)\') called at /home/musicbrainz/musicbrainz-server/admin/../local/lib/perl5/x86_64-linux-gnu-thread-multi/Class/MOP/Method/Wrapped.pm line 35
      Class::MOP::Method::Wrapped::_ANON_(\'MusicBrainz::Server=HASH(0x12a8eeb0)\') called at /home/musicbrainz/musicbrainz-server/admin/../local/lib/perl5/x86_64-linux-gnu-thread-multi/Class/MOP/Method/Wrapped.pm line 91
      MusicBrainz::Server::dispatch(\'MusicBrainz::Server=HASH(0x12a8eeb0)\') called at /home/musicbrainz/musicbrainz-server/admin/../local/lib/perl5/Catalyst.pm line 1968
      Catalyst::_ANON_() called at /home/musicbrainz/musicbrainz-server/admin/../local/lib/perl5/Try/Tiny.pm line 76
      eval

      called at /home/musicbrainz/musicbrainz-server/admin/../local/lib/perl5/Try/Tiny.pm line 67
      Try::Tiny::try(\'CODE(0x12ad17a0)\', \'Try::Tiny::Catch=REF(0x12ad3338)\') called at /home/musicbrainz/musicbrainz-server/admin/../local/lib/perl5/Catalyst.pm line 1974
      Catalyst::handle_request(\'MusicBrainz::Server\', \'env\', \'HASH(0x12af04b8)\', \'response_cb\', \'CODE(0x12a6e0d8)\') called at /home/musicbrainz/musicbrainz-server/admin/../local/lib/perl5/Catalyst/Engine.pm line 688
      Catalyst::Engine::_ANON_(\'CODE(0x12a6e0d8)\') called at /home/musicbrainz/musicbrainz-server/admin/../local/lib/perl5/Plack/Handler/FCGI.pm line 130
      Plack::Handler::FCGI::run(\'Plack::Handler::FCGI=HASH(0x9147d0)\', \'CODE(0xc43eaf0)\') called at /home/musicbrainz/musicbrainz-server/admin/../local/lib/perl5/Plack/Loader.pm line 84
      Plack::Loader::run(\'Plack::Loader=HASH(0x83b9c8)\', \'Plack::Handler::FCGI=HASH(0x9147d0)\') called at /home/musicbrainz/musicbrainz-server/admin/../local/lib/perl5/Plack/Runner.pm line 267
      Plack::Runner::run(\'Plack::Runner=HASH(0x6bc020)\') called at /home/musicbrainz/musicbrainz-server/admin/../local/bin/plackup line 10
      ';
      at lib/MusicBrainz/Server/Controller.pm line 101.
      at lib/Sql.pm line 320."
      Stack trace:
      line 19 MusicBrainz::Server::Model::MB
      line 147 MusicBrainz::Server::Controller
      line 56 MusicBrainz::Server::Controller::Role::Create
      line 326 MusicBrainz::Server
      line 300 MusicBrainz::Server
      line 327 MusicBrainz::Server
      line 341 MusicBrainz::Server
      line 386 MusicBrainz::Server
      Request data:

      $VAR1 = {
      'query_parameters' => {},
      'body_parameters' =>

      Unknown macro: { 'edit-area.name' => 'foo', 'edit-area.period.end_date.month' => '', 'edit-area.iso_3166_3.0' => '', 'edit-area.period.begin_date.month' => '', 'edit-area.iso_3166_2.0' => '', 'edit-area.period.begin_date.day' => '', 'edit-area.sort_name' => 'bar', 'edit-area.period.end_date.day' => '', 'edit-area.period.begin_date.year' => '', 'edit-area.edit_note' => '', 'edit-area.period.end_date.year' => '', 'edit-area.iso_3166_1.0' => 'ZX', 'edit-area.type_id' => '' }

      };

      Host: hobbes

      URL: http://test.musicbrainz.org/area/create

            acid2 Oliver Charles
            nikki nikki
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

                Version Package
                2013-07-08