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

Relationship credit with whitespace causes error

XMLWordPrintable

      I accidentally tried to use as an artist credit for a relationship "Aki Takahashi ‎" (with a space). I would expect it to be trimmed, but instead this happened:

      Failed query: 'UPDATE l_artist_recording SET link = ?, entity1 = ?, entity1_credit = ?, entity0 = ?, entity0_credit = ? WHERE id = ?' (22671 162616 669452 Aki Takahashi 1308483) 23514 DBD::Pg::st execute failed: ERROR: new row for relation "l_artist_recording" violates check constraint "control_for_whitespace_entity0_credit" DETAIL: Failing row contains (1308483, 22671, 669452, 162616, 0, 2020-05-24 12:15:06.040324+00, 0, Aki Takahashi , ). [for Statement "UPDATE l_artist_recording SET link = ?, entity1 = ?, entity1_credit = ?, entity0 = ?, entity0_credit = ? WHERE id = ?" with ParamValues: 1='22671', 2='162616', 3='', 4='669452', 5='Aki Takahashi ', 6='1308483'] at lib/Sql.pm line 116. Sql::catch {...} (MusicBrainz::Server::Exceptions::DatabaseError=HASH(0x1b2002e8)) called at /home/musicbrainz/carton-local/lib/perl5/Try/Tiny.pm line 123 Try::Tiny::try(CODE(0x1b1ff8f8), Try::Tiny::Catch=REF(0x1b1fff10)) called at lib/Sql.pm line 117 Sql::do(Sql=HASH(0x16099850), "UPDATE l_artist_recording SET link = ?, entity1 = ?, entity1_"..., 22671, 162616, "", 669452, "Aki Takahashi ", 1308483) called at lib/Sql.pm line 203 Sql::update_row(Sql=HASH(0x16099850), "l_artist_recording", HASH(0x166edd98), HASH(0x1b1f4a20)) called at lib/MusicBrainz/Server/Data/Relationship.pm line 682 MusicBrainz::Server::Data::Relationship::update(MusicBrainz::Server::Data::Relationship=HASH(0x134c7818), "artist", "recording", 1308483, HASH(0x1b1f4ba0)) called at lib/MusicBrainz/Server/Edit/Relationship/Edit.pm line 516 MusicBrainz::Server::Edit::Relationship::Edit::accept(MusicBrainz::Server::Edit::Relationship::Edit=HASH(0x1b1ef840)) called at lib/MusicBrainz/Server/Data/Edit.pm line 749 MusicBrainz::Server::Data::Edit::try {...} () called at /home/musicbrainz/carton-local/lib/perl5/Try/Tiny.pm line 100 eval {...} called at /home/musicbrainz/carton-local/lib/perl5/Try/Tiny.pm line 93 Try::Tiny::try(CODE(0x1a6a5af0), Try::Tiny::Catch=REF(0x1b1eff90)) called at lib/MusicBrainz/Server/Data/Edit.pm line 784 MusicBrainz::Server::Data::Edit::_do_accept(MusicBrainz::Server::Data::Edit=HASH(0x123a6988), MusicBrainz::Server::Edit::Relationship::Edit=HASH(0x1b1ef840)) called at lib/MusicBrainz/Server/Data/Edit.pm line 823 MusicBrainz::Server::Data::Edit::__ANON__(MusicBrainz::Server::Edit::Relationship::Edit=HASH(0x1b1ef840)) called at lib/MusicBrainz/Server/Data/Edit.pm line 846 MusicBrainz::Server::Data::Edit::_close(MusicBrainz::Server::Data::Edit=HASH(0x123a6988), MusicBrainz::Server::Edit::Relationship::Edit=HASH(0x1b1ef840), CODE(0x9a873e0)) called at lib/MusicBrainz/Server/Data/Edit.pm line 823 MusicBrainz::Server::Data::Edit::accept(MusicBrainz::Server::Data::Edit=HASH(0x123a6988), MusicBrainz::Server::Edit::Relationship::Edit=HASH(0x1b1ef840)) called at lib/MusicBrainz/Server/Data/Edit.pm line 593 MusicBrainz::Server::Data::Edit::create(MusicBrainz::Server::Data::Edit=HASH(0x123a6988), "entity0", MusicBrainz::Server::Entity::Artist=HASH(0x167f3858), "entity0_credit", "Aki Takahashi \x{200e}", "link_type", MusicBrainz::Server::Entity::LinkType=HASH(0x15625cf8), "begin_date", HASH(0x16a786c8), ...) called at lib/MusicBrainz/Server/Controller/WS/js/Edit.pm line 565 MusicBrainz::Server::Controller::WS::js::Edit::try {...} () called at /home/musicbrainz/carton-local/lib/perl5/Try/Tiny.pm line 102 eval {...} called at /home/musicbrainz/carton-local/lib/perl5/Try/Tiny.pm line 93 Try::Tiny::try(CODE(0x16ff3cd0), Try::Tiny::Catch=REF(0x16ff5e38)) called at lib/MusicBrainz/Server/Controller/WS/js/Edit.pm line 583 MusicBrainz::Server::Controller::WS::js::Edit::create_edits(MusicBrainz::Server::Controller::WS::js::Edit=HASH(0x142163e0), MusicBrainz::Server=HASH(0x16954f40), HASH(0x167f5b90)) called at lib/MusicBrainz/Server/Controller/WS/js/Edit.pm line 640 MusicBrainz::Server::Controller::WS::js::Edit::__ANON__() called at lib/Sql.pm line 322 Sql::try {...} () called at /home/musicbrainz/carton-local/lib/perl5/Try/Tiny.pm line 102 eval {...} called at /home/musicbrainz/carton-local/lib/perl5/Try/Tiny.pm line 93 Try::Tiny::try(CODE(0x1671faa8), Try::Tiny::Catch=REF(0x167219c8)) called at lib/Sql.pm line 335 Sql::_auto_transaction(CODE(0x16fec968), Sql=HASH(0x16099850)) called at lib/Sql.pm line 340 Sql::_run_in_transaction_one(CODE(0x16fec968), Sql=HASH(0x16099850)) called at lib/Sql.pm line 355 Sql::run_in_transaction(CODE(0x16fec968), Sql=HASH(0x16099850)) called at lib/MusicBrainz/Server/Model/MB.pm line 19 MusicBrainz::Server::Model::MB::with_transaction(MusicBrainz::Server::Model::MB=HASH(0x11b59ca0), CODE(0x16fec968)) called at lib/MusicBrainz/Server/Controller/WS/js/Edit.pm line 651 MusicBrainz::Server::Controller::WS::js::Edit::submit_edits(MusicBrainz::Server::Controller::WS::js::Edit=HASH(0x142163e0), MusicBrainz::Server=HASH(0x16954f40), HASH(0x167f5b90)) called at lib/MusicBrainz/Server/Controller/WS/js/Edit.pm line 615 MusicBrainz::Server::Controller::WS::js::Edit::create(MusicBrainz::Server::Controller::WS::js::Edit=HASH(0x142163e0), MusicBrainz::Server=HASH(0x16954f40)) called at /home/musicbrainz/carton-local/lib/perl5/Catalyst/Action.pm line 358 Catalyst::Action::execute(Catalyst::Action=HASH(0x146d3e40), MusicBrainz::Server::Controller::WS::js::Edit=HASH(0x142163e0), MusicBrainz::Server=HASH(0x16954f40)) called at /home/musicbrainz/carton-local/lib/perl5/Catalyst.pm line 2061 eval {...} called at /home/musicbrainz/carton-local/lib/perl5/Catalyst.pm line 2061 Catalyst::execute(MusicBrainz::Server=HASH(0x16954f40), "MusicBrainz::Server::Controller::WS::js::Edit", Catalyst::Action=HASH(0x146d3e40)) called at lib/Catalyst/Plugin/Sentry.pm line 23 Catalyst::Plugin::Sentry::execute(MusicBrainz::Server=HASH(0x16954f40), "MusicBrainz::Server::Controller::WS::js::Edit", Catalyst::Action=HASH(0x146d3e40)) called at /home/musicbrainz/carton-local/lib/perl5/Catalyst/Action.pm line 353 Catalyst::Action::dispatch(Catalyst::Action=HASH(0x146d3e40), MusicBrainz::Server=HASH(0x16954f40)) called at /home/musicbrainz/carton-local/lib/perl5/Catalyst/ActionChain.pm line 46 Catalyst::ActionChain::dispatch(Catalyst::ActionChain=HASH(0x1619a700), MusicBrainz::Server=HASH(0x16954f40)) called at /home/musicbrainz/carton-local/lib/perl5/Catalyst/Controller.pm line 170 Catalyst::Controller::_ACTION(MusicBrainz::Server::Controller::WS::js::Edit=HASH(0x142163e0), MusicBrainz::Server=HASH(0x16954f40)) called at /home/musicbrainz/carton-local/lib/perl5/Catalyst/Action.pm line 358 Catalyst::Action::execute(Catalyst::Action=HASH(0x146d3480), MusicBrainz::Server::Controller::WS::js::Edit=HASH(0x142163e0), MusicBrainz::Server=HASH(0x16954f40)) called at /home/musicbrainz/carton-local/lib/perl5/Catalyst.pm line 2061 eval {...} called at /home/musicbrainz/carton-local/lib/perl5/Catalyst.pm line 2061 Catalyst::execute(MusicBrainz::Server=HASH(0x16954f40), "MusicBrainz::Server::Controller::WS::js::Edit", Catalyst::Action=HASH(0x146d3480)) called at lib/Catalyst/Plugin/Sentry.pm line 23 Catalyst::Plugin::Sentry::execute(MusicBrainz::Server=HASH(0x16954f40), "MusicBrainz::Server::Controller::WS::js::Edit", Catalyst::Action=HASH(0x146d3480)) called at /home/musicbrainz/carton-local/lib/perl5/Catalyst/Action.pm line 353 Catalyst::Action::dispatch(Catalyst::Action=HASH(0x146d3480), MusicBrainz::Server=HASH(0x16954f40)) called at /home/musicbrainz/carton-local/lib/perl5/Catalyst/Dispatcher.pm line 261 Catalyst::Dispatcher::_do_forward(Catalyst::Dispatcher=HASH(0x7e5af00), "forward", MusicBrainz::Server=HASH(0x16954f40), "_ACTION") called at /home/musicbrainz/carton-local/lib/perl5/Catalyst/Dispatcher.pm line 241 Catalyst::Dispatcher::forward(Catalyst::Dispatcher=HASH(0x7e5af00), MusicBrainz::Server=HASH(0x16954f40), "_ACTION") called at /home/musicbrainz/carton-local/lib/perl5/Catalyst.pm line 483 Catalyst::forward(MusicBrainz::Server=HASH(0x16954f40), "_ACTION") called at /home/musicbrainz/carton-local/lib/perl5/Catalyst/Controller.pm line 134 Catalyst::Controller::_DISPATCH(MusicBrainz::Server::Controller::WS::js::Edit=HASH(0x142163e0), MusicBrainz::Server=HASH(0x16954f40)) called at /home/musicbrainz/carton-local/lib/perl5/Catalyst/Action.pm line 358 Catalyst::Action::execute(Catalyst::Action=HASH(0x146d0590), MusicBrainz::Server::Controller::WS::js::Edit=HASH(0x142163e0), MusicBrainz::Server=HASH(0x16954f40)) called at /home/musicbrainz/carton-local/lib/perl5/Catalyst.pm line 2061 eval {...} called at /home/musicbrainz/carton-local/lib/perl5/Catalyst.pm line 2061 Catalyst::execute(MusicBrainz::Server=HASH(0x16954f40), "MusicBrainz::Server::Controller::WS::js::Edit", Catalyst::Action=HASH(0x146d0590)) called at lib/Catalyst/Plugin/Sentry.pm line 23 Catalyst::Plugin::Sentry::execute(MusicBrainz::Server=HASH(0x16954f40), "MusicBrainz::Server::Controller::WS::js::Edit", Catalyst::Action=HASH(0x146d0590)) called at /home/musicbrainz/carton-local/lib/perl5/Catalyst/Action.pm line 353 Catalyst::Action::dispatch(Catalyst::Action=HASH(0x146d0590), MusicBrainz::Server=HASH(0x16954f40)) called at /home/musicbrainz/carton-local/lib/perl5/Catalyst/Dispatcher.pm line 261 Catalyst::Dispatcher::_do_forward(Catalyst::Dispatcher=HASH(0x7e5af00), "forward", MusicBrainz::Server=HASH(0x16954f40), "/ws/js/edit/_DISPATCH") called at /home/musicbrainz/carton-local/lib/perl5/Catalyst/Dispatcher.pm line 241 Catalyst::Dispatcher::forward(Catalyst::Dispatcher=HASH(0x7e5af00), MusicBrainz::Server=HASH(0x16954f40), "/ws/js/edit/_DISPATCH") called at /home/musicbrainz/carton-local/lib/perl5/Catalyst.pm line 483 Catalyst::forward(MusicBrainz::Server=HASH(0x16954f40), "/ws/js/edit/_DISPATCH") called at /home/musicbrainz/carton-local/lib/perl5/Catalyst/Dispatcher.pm line 107 Catalyst::Dispatcher::dispatch(Catalyst::Dispatcher=HASH(0x7e5af00), MusicBrainz::Server=HASH(0x16954f40)) called at /home/musicbrainz/carton-local/lib/perl5/Catalyst.pm line 2007 Catalyst::dispatch(MusicBrainz::Server=HASH(0x16954f40)) called at lib/MusicBrainz/Server.pm line 324 MusicBrainz::Server::__ANON__() called at lib/MusicBrainz/Server.pm line 299 MusicBrainz::Server::with_translations(MusicBrainz::Server=HASH(0x16954f40), CODE(0x16a70038)) called at lib/MusicBrainz/Server.pm line 325 Class::MOP::Class:::around(CODE(0x38e76b8), MusicBrainz::Server=HASH(0x16954f40)) called at /home/musicbrainz/carton-local/lib/perl5/x86_64-linux-gnu-thread-multi/Class/MOP/Method/Wrapped.pm line 164 Class::MOP::Method::Wrapped::__ANON__(MusicBrainz::Server=HASH(0x16954f40)) called at lib/MusicBrainz/Server.pm line 339 Class::MOP::Class:::around(CODE(0x1427d750), MusicBrainz::Server=HASH(0x16954f40)) called at /home/musicbrainz/carton-local/lib/perl5/x86_64-linux-gnu-thread-multi/Class/MOP/Method/Wrapped.pm line 164 Class::MOP::Method::Wrapped::__ANON__(MusicBrainz::Server=HASH(0x16954f40)) called at lib/MusicBrainz/Server.pm line 417 Class::MOP::Class:::around(CODE(0x1427dab0), MusicBrainz::Server=HASH(0x16954f40)) called at /home/musicbrainz/carton-local/lib/perl5/x86_64-linux-gnu-thread-multi/Class/MOP/Method/Wrapped.pm line 164 Class::MOP::Method::Wrapped::__ANON__(MusicBrainz::Server=HASH(0x16954f40)) called at /home/musicbrainz/carton-local/lib/perl5/x86_64-linux-gnu-thread-multi/Class/MOP/Method/Wrapped.pm line 35 MusicBrainz::Server::_wrapped_dispatch(MusicBrainz::Server=HASH(0x16954f40)) called at /home/musicbrainz/carton-local/lib/perl5/x86_64-linux-gnu-thread-multi/Class/MOP/Method/Wrapped.pm line 95 MusicBrainz::Server::dispatch(MusicBrainz::Server=HASH(0x16954f40)) called at /home/musicbrainz/carton-local/lib/perl5/Catalyst.pm line 2413 Catalyst::try {...} () called at /home/musicbrainz/carton-local/lib/perl5/Try/Tiny.pm line 102 eval {...} called at /home/musicbrainz/carton-local/lib/perl5/Try/Tiny.pm line 93 Try::Tiny::try(CODE(0x159a0bc8), Try::Tiny::Catch=REF(0x166faec8)) called at /home/musicbrainz/carton-local/lib/perl5/Catalyst.pm line 2422 Catalyst::handle_request("MusicBrainz::Server", "env", HASH(0x1671c938), "response_cb", CODE(0x16705f48)) called at /home/musicbrainz/carton-local/lib/perl5/Catalyst/Engine.pm line 807 Catalyst::Engine::__ANON__(CODE(0x16705f48)) called at /home/musicbrainz/carton-local/lib/perl5/Plack/Middleware/HTTPExceptions.pm line 32 Plack::Middleware::HTTPExceptions::try {...} () called at /home/musicbrainz/carton-local/lib/perl5/Try/Tiny.pm line 102 eval {...} called at /home/musicbrainz/carton-local/lib/perl5/Try/Tiny.pm line 93 Try::Tiny::try(CODE(0x166e89c0), Try::Tiny::Catch=REF(0x1702e0e8)) called at /home/musicbrainz/carton-local/lib/perl5/Plack/Middleware/HTTPExceptions.pm line 41 Plack::Middleware::HTTPExceptions::__ANON__(CODE(0x1611fa68)) called at /home/musicbrainz/carton-local/lib/perl5/Plack/Util.pm line 339 Plack::Util::__ANON__(CODE(0x15729f98)) called at /home/musicbrainz/carton-local/lib/perl5/Plack/Util.pm line 339 Plack::Util::__ANON__(CODE(0x16a7bb10)) called at /home/musicbrainz/carton-local/lib/perl5/Plack/Util.pm line 339 Plack::Util::__ANON__(CODE(0x17067540)) called at /home/musicbrainz/carton-local/lib/perl5/Starlet/Server.pm line 377 Starlet::Server::handle_connection(Plack::Handler::Starlet=HASH(0x13e094f0), HASH(0x1671c938), IO::Socket::INET=GLOB(0x166f3bb8), CODE(0x1473cc68), "", "", "") called at /home/musicbrainz/carton-local/lib/perl5/Starlet/Server.pm line 190 Starlet::Server::accept_loop(Plack::Handler::Starlet=HASH(0x13e094f0), CODE(0x1473cc68), 52) called at /home/musicbrainz/carton-local/lib/perl5/Plack/Handler/Starlet.pm line 80 Plack::Handler::Starlet::run(Plack::Handler::Starlet=HASH(0x13e094f0), CODE(0x1473cc68)) called at /home/musicbrainz/carton-local/lib/perl5/Plack/Loader.pm line 84 Plack::Loader::run(Plack::Loader=HASH(0x14587a8), Plack::Handler::Starlet=HASH(0x13e094f0)) called at /home/musicbrainz/carton-local/lib/perl5/Plack/Runner.pm line 277 Plack::Runner::run(Plack::Runner=HASH(0x128aad8)) called at /home/musicbrainz/carton-local/bin/plackup line 7

            reosarevok Nicolás Tamargo
            reosarevok Nicolás Tamargo
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                Version Package
                2020-06-15