Bugged out Edit

Tags: #<Tag:0x00007f58fdc61bc0>

https://musicbrainz.org/release/08806400-d072-47e3-9971-69c553a7a68e/edit

Attempted to Add Four Medium to a release by using Add Medium button and selecting four medium from another edition. They drop into 5,6,7,8. This left me with the original four blank medium in places 1 to 4 which I then deleted. Got a wall of error text when applying edit. (see below).

Also interesting that the medium being removed attempted to all be moved to item 5?
image

About to see if I can repeat it.

Looking at Edit History I see Open Edits for my adding the mediums, deleting the empty mediums, but not the reorder that was caused by deleting four mediums.

Have now done successful edit to shuffle order to put the blank ones to 5,6,7,8

My theory - bug caused by my deleting four mediums from 1,2,3,4 and having all of them shuffle into item 5 as in screen shot.

Failed query: ‘UPDATE medium SET position = (SELECT position FROM (VALUES (?::INTEGER, ?::INTEGER), (?::INTEGER, ?::INTEGER), (?::INTEGER, ?::INTEGER), (?::INTEGER, ?::INTEGER), (?::INTEGER, ?::INTEGER)) AS mpos (medium, position) WHERE mpos.medium = medium.id) WHERE id IN (?,?,?,?,?)’ (3406243 5 3406241 5 3406242 5 3406244 5 3406920 4 3406243 3406241 3406242 3406244 3406920) 23505 DBD::Pg::st execute failed: ERROR: duplicate key value violates unique constraint “medium_uniq” DETAIL: Key (release, “position”)=(3127723, 5) already exists. [for Statement “UPDATE medium SET position = (SELECT position FROM (VALUES (?::INTEGER, ?::INTEGER), (?::INTEGER, ?::INTEGER), (?::INTEGER, ?::INTEGER), (?::INTEGER, ?::INTEGER), (?::INTEGER, ?::INTEGER)) AS mpos (medium, position) WHERE mpos.medium = medium.id) WHERE id IN (?,?,?,?,?)” with ParamValues: 1=‘3406243’, 2=‘5’, 3=‘3406241’, 4=‘5’, 5=‘3406242’, 6=‘5’, 7=‘3406244’, 8=‘5’, 9=‘3406920’, 10=‘4’, 11=‘3406243’, 12=‘3406241’, 13=‘3406242’, 14=‘3406244’, 15=‘3406920’] at lib/Sql.pm line 116. Sql::catch {…} (MusicBrainz::Server::Exceptions::DatabaseError=HASH(0x55b9206a3578)) called at /home/musicbrainz/carton-local/lib/perl5/Try/Tiny.pm line 123 Try::Tiny::try(CODE(0x55b920b970c8), Try::Tiny::Catch=REF(0x55b91fac0230)) called at lib/Sql.pm line 117 Sql::do(Sql=HASH(0x55b91c5c9870), “UPDATE medium SET position =\x{a} (SELECT position”…, 3406243, 5, 3406241, 5, 3406242, 5, …) called at lib/MusicBrainz/Server/Data/Medium.pm line 281 MusicBrainz::Server::Data::Medium::reorder(MusicBrainz::Server::Data::Medium=HASH(0x55b9195cbbc8), 3406920, 4, 3406244, 5, 3406242, 5, 3406243, …) called at lib/MusicBrainz/Server/Edit/Release/ReorderMediums.pm line 134 MusicBrainz::Server::Edit::Release::ReorderMediums::accept(MusicBrainz::Server::Edit::Release::ReorderMediums=HASH(0x55b920609ed0)) called at lib/MusicBrainz/Server/Data/Edit.pm line 764 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(0x55b920c16c88), Try::Tiny::Catch=REF(0x55b91b922fe8)) called at lib/MusicBrainz/Server/Data/Edit.pm line 799 MusicBrainz::Server::Data::Edit::_do_accept(MusicBrainz::Server::Data::Edit=HASH(0x55b91851c130), MusicBrainz::Server::Edit::Release::ReorderMediums=HASH(0x55b920609ed0)) called at lib/MusicBrainz/Server/Data/Edit.pm line 838 MusicBrainz::Server::Data::Edit::ANON(MusicBrainz::Server::Edit::Release::ReorderMediums=HASH(0x55b920609ed0)) called at lib/MusicBrainz/Server/Data/Edit.pm line 861 MusicBrainz::Server::Data::Edit::_close(MusicBrainz::Server::Data::Edit=HASH(0x55b91851c130), MusicBrainz::Server::Edit::Release::ReorderMediums=HASH(0x55b920609ed0), CODE(0x55b90b60fb28)) called at lib/MusicBrainz/Server/Data/Edit.pm line 838 MusicBrainz::Server::Data::Edit::accept(MusicBrainz::Server::Data::Edit=HASH(0x55b91851c130), MusicBrainz::Server::Edit::Release::ReorderMediums=HASH(0x55b920609ed0)) called at lib/MusicBrainz/Server/Data/Edit.pm line 608 MusicBrainz::Server::Data::Edit::create(MusicBrainz::Server::Data::Edit=HASH(0x55b91851c130), “release”, MusicBrainz::Server::Entity::Release=HASH(0x55b91c7aea08), “edit_type”, 313, “medium_positions”, ARRAY(0x55b91c5c23a8), “editor”, …) called at lib/MusicBrainz/Server/Controller/WS/js/Edit.pm line 599 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(0x55b91c09c4d0), Try::Tiny::Catch=REF(0x55b91c246d88)) called at lib/MusicBrainz/Server/Controller/WS/js/Edit.pm line 617 MusicBrainz::Server::Controller::WS::js::Edit::create_edits(MusicBrainz::Server::Controller::WS::js::Edit=HASH(0x55b91a411a18), MusicBrainz::Server=HASH(0x55b91c0cf8c0), HASH(0x55b91c7ac8c8)) called at lib/MusicBrainz/Server/Controller/WS/js/Edit.pm line 674 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(0x55b91c7aa300), Try::Tiny::Catch=REF(0x55b91c5e1130)) called at lib/Sql.pm line 335 Sql::_auto_transaction(CODE(0x55b91a3965d8), Sql=HASH(0x55b91c5c9870)) called at lib/Sql.pm line 340 Sql::_run_in_transaction_one(CODE(0x55b91a3965d8), Sql=HASH(0x55b91c5c9870)) called at lib/Sql.pm line 355 Sql::run_in_transaction(CODE(0x55b91a3965d8), Sql=HASH(0x55b91c5c9870)) called at lib/MusicBrainz/Server/Model/MB.pm line 19 MusicBrainz::Server::Model::MB::with_transaction(MusicBrainz::Server::Model::MB=HASH(0x55b917d02b08), CODE(0x55b91a3965d8)) called at lib/MusicBrainz/Server/Controller/WS/js/Edit.pm line 685 MusicBrainz::Server::Controller::WS::js::Edit::submit_edits(MusicBrainz::Server::Controller::WS::js::Edit=HASH(0x55b91a411a18), MusicBrainz::Server=HASH(0x55b91c0cf8c0), HASH(0x55b91c7ac8c8)) called at lib/MusicBrainz/Server/Controller/WS/js/Edit.pm line 649 MusicBrainz::Server::Controller::WS::js::Edit::create(MusicBrainz::Server::Controller::WS::js::Edit=HASH(0x55b91a411a18), MusicBrainz::Server=HASH(0x55b91c0cf8c0)) called at /home/musicbrainz/carton-local/lib/perl5/Catalyst/Action.pm line 358 Catalyst::Action::execute(Catalyst::Action=HASH(0x55b91a8f30e0), MusicBrainz::Server::Controller::WS::js::Edit=HASH(0x55b91a411a18), MusicBrainz::Server=HASH(0x55b91c0cf8c0)) 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(0x55b91c0cf8c0), “MusicBrainz::Server::Controller::WS::js::Edit”, Catalyst::Action=HASH(0x55b91a8f30e0)) called at lib/Catalyst/Plugin/ErrorInfo.pm line 34 Catalyst::Plugin::ErrorInfo::execute(MusicBrainz::Server=HASH(0x55b91c0cf8c0), “MusicBrainz::Server::Controller::WS::js::Edit”, Catalyst::Action=HASH(0x55b91a8f30e0)) called at /home/musicbrainz/carton-local/lib/perl5/Catalyst/Action.pm line 353 Catalyst::Action::dispatch(Catalyst::Action=HASH(0x55b91a8f30e0), MusicBrainz::Server=HASH(0x55b91c0cf8c0)) called at /home/musicbrainz/carton-local/lib/perl5/Catalyst/ActionChain.pm line 46 Catalyst::ActionChain::dispatch(Catalyst::ActionChain=HASH(0x55b91c241c70), MusicBrainz::Server=HASH(0x55b91c0cf8c0)) called at /home/musicbrainz/carton-local/lib/perl5/Catalyst/Controller.pm line 170 Catalyst::Controller::_ACTION(MusicBrainz::Server::Controller::WS::js::Edit=HASH(0x55b91a411a18), MusicBrainz::Server=HASH(0x55b91c0cf8c0)) called at /home/musicbrainz/carton-local/lib/perl5/Catalyst/Action.pm line 358 Catalyst::Action::execute(Catalyst::Action=HASH(0x55b91a8f27b0), MusicBrainz::Server::Controller::WS::js::Edit=HASH(0x55b91a411a18), MusicBrainz::Server=HASH(0x55b91c0cf8c0)) 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(0x55b91c0cf8c0), “MusicBrainz::Server::Controller::WS::js::Edit”, Catalyst::Action=HASH(0x55b91a8f27b0)) called at lib/Catalyst/Plugin/ErrorInfo.pm line 34 Catalyst::Plugin::ErrorInfo::execute(MusicBrainz::Server=HASH(0x55b91c0cf8c0), “MusicBrainz::Server::Controller::WS::js::Edit”, Catalyst::Action=HASH(0x55b91a8f27b0)) called at /home/musicbrainz/carton-local/lib/perl5/Catalyst/Action.pm line 353 Catalyst::Action::dispatch(Catalyst::Action=HASH(0x55b91a8f27b0), MusicBrainz::Server=HASH(0x55b91c0cf8c0)) called at /home/musicbrainz/carton-local/lib/perl5/Catalyst/Dispatcher.pm line 261 Catalyst::Dispatcher::_do_forward(Catalyst::Dispatcher=HASH(0x55b90da05f80), “forward”, MusicBrainz::Server=HASH(0x55b91c0cf8c0), “_ACTION”) called at /home/musicbrainz/carton-local/lib/perl5/Catalyst/Dispatcher.pm line 241 Catalyst::Dispatcher::forward(Catalyst::Dispatcher=HASH(0x55b90da05f80), MusicBrainz::Server=HASH(0x55b91c0cf8c0), “_ACTION”) called at /home/musicbrainz/carton-local/lib/perl5/Catalyst.pm line 483 Catalyst::forward(MusicBrainz::Server=HASH(0x55b91c0cf8c0), “_ACTION”) called at /home/musicbrainz/carton-local/lib/perl5/Catalyst/Controller.pm line 134 Catalyst::Controller::_DISPATCH(MusicBrainz::Server::Controller::WS::js::Edit=HASH(0x55b91a411a18), MusicBrainz::Server=HASH(0x55b91c0cf8c0)) called at /home/musicbrainz/carton-local/lib/perl5/Catalyst/Action.pm line 358 Catalyst::Action::execute(Catalyst::Action=HASH(0x55b91a8edbb8), MusicBrainz::Server::Controller::WS::js::Edit=HASH(0x55b91a411a18), MusicBrainz::Server=HASH(0x55b91c0cf8c0)) 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(0x55b91c0cf8c0), “MusicBrainz::Server::Controller::WS::js::Edit”, Catalyst::Action=HASH(0x55b91a8edbb8)) called at lib/Catalyst/Plugin/ErrorInfo.pm line 34 Catalyst::Plugin::ErrorInfo::execute(MusicBrainz::Server=HASH(0x55b91c0cf8c0), “MusicBrainz::Server::Controller::WS::js::Edit”, Catalyst::Action=HASH(0x55b91a8edbb8)) called at /home/musicbrainz/carton-local/lib/perl5/Catalyst/Action.pm line 353 Catalyst::Action::dispatch(Catalyst::Action=HASH(0x55b91a8edbb8), MusicBrainz::Server=HASH(0x55b91c0cf8c0)) called at /home/musicbrainz/carton-local/lib/perl5/Catalyst/Dispatcher.pm line 261 Catalyst::Dispatcher::_do_forward(Catalyst::Dispatcher=HASH(0x55b90da05f80), “forward”, MusicBrainz::Server=HASH(0x55b91c0cf8c0), “/ws/js/edit/_DISPATCH”) called at /home/musicbrainz/carton-local/lib/perl5/Catalyst/Dispatcher.pm line 241 Catalyst::Dispatcher::forward(Catalyst::Dispatcher=HASH(0x55b90da05f80), MusicBrainz::Server=HASH(0x55b91c0cf8c0), “/ws/js/edit/_DISPATCH”) called at /home/musicbrainz/carton-local/lib/perl5/Catalyst.pm line 483 Catalyst::forward(MusicBrainz::Server=HASH(0x55b91c0cf8c0), “/ws/js/edit/_DISPATCH”) called at /home/musicbrainz/carton-local/lib/perl5/Catalyst/Dispatcher.pm line 107 Catalyst::Dispatcher::dispatch(Catalyst::Dispatcher=HASH(0x55b90da05f80), MusicBrainz::Server=HASH(0x55b91c0cf8c0)) called at /home/musicbrainz/carton-local/lib/perl5/Catalyst.pm line 2007 Catalyst::dispatch(MusicBrainz::Server=HASH(0x55b91c0cf8c0)) called at lib/MusicBrainz/Server.pm line 390 MusicBrainz::Server::ANON() called at lib/MusicBrainz/Server.pm line 357 MusicBrainz::Server::with_translations(MusicBrainz::Server=HASH(0x55b91c0cf8c0), CODE(0x55b91c0a6818)) called at lib/MusicBrainz/Server.pm line 391 Class::MOP::Class:::around(CODE(0x55b90983d1d8), MusicBrainz::Server=HASH(0x55b91c0cf8c0)) 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(0x55b91c0cf8c0)) called at lib/MusicBrainz/Server.pm line 405 Class::MOP::Class:::around(CODE(0x55b91a361e80), MusicBrainz::Server=HASH(0x55b91c0cf8c0)) 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(0x55b91c0cf8c0)) called at lib/MusicBrainz/Server.pm line 490 Class::MOP::Class:::around(CODE(0x55b91a3624f8), MusicBrainz::Server=HASH(0x55b91c0cf8c0)) 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(0x55b91c0cf8c0)) 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(0x55b91c0cf8c0)) 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(0x55b91c0cf8c0)) 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(0x55b91c234c88), Try::Tiny::Catch=REF(0x55b91c500fc8)) called at /home/musicbrainz/carton-local/lib/perl5/Catalyst.pm line 2422 Catalyst::handle_request(“MusicBrainz::Server”, “env”, HASH(0x55b91c098290), “response_cb”, CODE(0x55b91c5a34e8)) called at /home/musicbrainz/carton-local/lib/perl5/Catalyst/Engine.pm line 807 Catalyst::Engine::ANON(CODE(0x55b91c5a34e8)) 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(0x55b91c0655c0), Try::Tiny::Catch=REF(0x55b91c79df50)) called at /home/musicbrainz/carton-local/lib/perl5/Plack/Middleware/HTTPExceptions.pm line 41 Plack::Middleware::HTTPExceptions::ANON(CODE(0x55b91c0abe08)) called at /home/musicbrainz/carton-local/lib/perl5/Plack/Util.pm line 339 Plack::Util::ANON(CODE(0x55b91c471f48)) called at /home/musicbrainz/carton-local/lib/perl5/Plack/Util.pm line 339 Plack::Util::ANON(CODE(0x55b91c266410)) called at /home/musicbrainz/carton-local/lib/perl5/Plack/Util.pm line 339 Plack::Util::ANON(CODE(0x55b91c52b510)) called at /home/musicbrainz/carton-local/lib/perl5/Starlet/Server.pm line 377 Starlet::Server::handle_connection(Plack::Handler::Starlet=HASH(0x55b91a3eb590), HASH(0x55b91c098290), IO::Socket::INET=GLOB(0x55b91b927b20), CODE(0x55b90d29bb80), “”, “”, “”) called at /home/musicbrainz/carton-local/lib/perl5/Starlet/Server.pm line 190 Starlet::Server::accept_loop(Plack::Handler::Starlet=HASH(0x55b91a3eb590), CODE(0x55b90d29bb80), 33) called at /home/musicbrainz/carton-local/lib/perl5/Plack/Handler/Starlet.pm line 80 Plack::Handler::Starlet::run(Plack::Handler::Starlet=HASH(0x55b91a3eb590), CODE(0x55b90d29bb80)) called at /home/musicbrainz/carton-local/lib/perl5/Plack/Loader.pm line 84 Plack::Loader::run(Plack::Loader=HASH(0x55b9073d7860), Plack::Handler::Starlet=HASH(0x55b91a3eb590)) called at /home/musicbrainz/carton-local/lib/perl5/Plack/Runner.pm line 277 Plack::runner::run(Plack::Runner=HASH(0x55b907135eb0)) called at /home/musicbrainz/carton-local/bin/plackup line 7

2 Likes
2 Likes

I see you have the same where all the deleted mediums wanted to become the same disc number.

I guess you did the same as me and added your new discs as the bottom, and removed the old ones from the top? I think the shuffle up breaks it as it doesn’t expect multiple deletes.