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

ISE when trying to enter disallowed value for ratings

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 2022-06-07
    • None
    • Misc features
    • None

      Someone tried to rate an entity 700 (I assume by hand-editing the URL?), but the rating goes from 0 to 100. This should fail, but probably not with an ISE.

      Sentry Issue: MUSICBRAINZ-SERVER-6P

      None: Failed query:
      	'INSERT INTO release_group_rating_raw (rating, release_group, editor)
                                VALUES (?, ?, ?)'
      	(700 139454 326637)
      23514 DBD::Pg::st execute failed: ERROR:  new row for relation "release_group_rating_raw" violates check constraint "release_group_rating_raw_rating_check"
      DETAIL:  Failing row contains (139454, 326637, 700). [for Statement "INSERT INTO release_group_rating_raw (rating, release_group, editor)
                                VALUES (?, ?, ?)" with ParamValues: 1='700', 2='139454', 3='326637']
      
      	Sql::catch {...} (MusicBrainz::Server::Exceptions::DatabaseError=HASH(0x559736b5dc50)) called at /home/musicbrainz/carton-local/lib/perl5/Try/Tiny.pm line 123
      	Try::Tiny::try(CODE(0x559736a1b470), Try::Tiny::Catch=REF(0x559737128c70)) called at lib/Sql.pm line 117
      	Sql::do(Sql=HASH(0x559737134e50), "INSERT INTO release_group_rating_raw (rating, release_group, "..., 700, 139454, 326637) called at lib/MusicBrainz/Server/Data/Rating.pm line 186
      	MusicBrainz::Server::Data::Rating::__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(0x559736e9a5d0), Try::Tiny::Catch=REF(0x5597369495d8)) called at lib/Sql.pm line 335
      	Sql::_auto_transaction(CODE(0x559736e16b78), Sql=HASH(0x559737134e50)) called at lib/Sql.pm line 340
      	Sql::_run_in_transaction_one(CODE(0x559736e16b78), Sql=HASH(0x559737134e50)) called at lib/Sql.pm line 355
      	Sql::run_in_transaction(CODE(0x559736e16b78), Sql=HASH(0x559737134e50)) called at lib/MusicBrainz/Server/Data/Rating.pm line 208
      	MusicBrainz::Server::Data::Rating::update(MusicBrainz::Server::Data::Rating=HASH(0x559736e43d20), 326637, 139454, 700) called at lib/MusicBrainz/Server/Controller/Rating.pm line 41
      	MusicBrainz::Server::Controller::Rating::rate(MusicBrainz::Server::Controller::Rating=HASH(0x55973517a4e8), MusicBrainz::Server=HASH(0x559736e287e0)) called at /home/musicbrainz/carton-local/lib/perl5/Catalyst/Action.pm line 358
      	Catalyst::Action::execute(Catalyst::Action=HASH(0x5597354355e8), MusicBrainz::Server::Controller::Rating=HASH(0x55973517a4e8), MusicBrainz::Server=HASH(0x559736e287e0)) called at /home/musicbrainz/carton-local/lib/perl5/Catalyst.pm line 2060
      	eval {...} called at /home/musicbrainz/carton-local/lib/perl5/Catalyst.pm line 2060
      	Catalyst::execute(MusicBrainz::Server=HASH(0x559736e287e0), "MusicBrainz::Server::Controller::Rating", Catalyst::Action=HASH(0x5597354355e8)) called at lib/Catalyst/Plugin/ErrorInfo.pm line 34
      	Catalyst::Plugin::ErrorInfo::execute(MusicBrainz::Server=HASH(0x559736e287e0), "MusicBrainz::Server::Controller::Rating", Catalyst::Action=HASH(0x5597354355e8)) called at /home/musicbrainz/carton-local/lib/perl5/Catalyst/Action.pm line 353
      	Catalyst::Action::dispatch(Catalyst::Action=HASH(0x5597354355e8), MusicBrainz::Server=HASH(0x559736e287e0)) called at /home/musicbrainz/carton-local/lib/perl5/Catalyst/Controller.pm line 170
      	Catalyst::Controller::_ACTION(MusicBrainz::Server::Controller::Rating=HASH(0x55973517a4e8), MusicBrainz::Server=HASH(0x559736e287e0)) called at /home/musicbrainz/carton-local/lib/perl5/Catalyst/Action.pm line 358
      	Catalyst::Action::execute(Catalyst::Action=HASH(0x55973541dde8), MusicBrainz::Server::Controller::Rating=HASH(0x55973517a4e8), MusicBrainz::Server=HASH(0x559736e287e0)) called at /home/musicbrainz/carton-local/lib/perl5/Catalyst.pm line 2060
      	eval {...} called at /home/musicbrainz/carton-local/lib/perl5/Catalyst.pm line 2060
      	Catalyst::execute(MusicBrainz::Server=HASH(0x559736e287e0), "MusicBrainz::Server::Controller::Rating", Catalyst::Action=HASH(0x55973541dde8)) called at lib/Catalyst/Plugin/ErrorInfo.pm line 34
      	Catalyst::Plugin::ErrorInfo::execute(MusicBrainz::Server=HASH(0x559736e287e0), "MusicBrainz::Server::Controller::Rating", Catalyst::Action=HASH(0x55973541dde8)) called at /home/musicbrainz/carton-local/lib/perl5/Catalyst/Action.pm line 353
      	Catalyst::Action::dispatch(Catalyst::Action=HASH(0x55973541dde8), M
        File "Rating.pm", line 208, in MusicBrainz::Server::Data::Rating::update
          }, $self->c->sql);
        File "Rating.pm", line 41, in Catalyst::dispatch
          my ($sum, $count) = $model->rating->update($c->user->id, $entity_id, $rating);
        File "Server.pm", line 389, in MusicBrainz::Server::__ANON__
          $c->$orig(@args)
        File "Server.pm", line 354, in MusicBrainz::Server::with_translations
          $code->();
        File "Server.pm", line 390, in Class::MOP::Method::Wrapped::__ANON__
          });
      ...
      (2 additional frame(s) were not displayed)
      

            reosarevok Nicolás Tamargo
            dev-sentry Dev through Sentry
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                Version Package
                2022-06-07