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

ISE when trying to visit artist-credit/whatever

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 2022-06-20
    • None
    • Data display
    • None

      We should validate that we only try to get artist credits by ids if the ids are valid, like we do with core entities.

      Sentry Issue: MUSICBRAINZ-SERVER-1B

      None: DBD::Pg::st execute failed: ERROR:  invalid input syntax for type integer: "lol"
      LINE 6:                 WHERE artist_credit IN ('lol')
                                                      ^ [for Statement "SELECT artist, artist_credit_name.name AS ac_name, join_phrase, artist_credit,
                      artist.id, artist.gid, artist.name, artist.sort_name, artist.type, artist.area, artist.begin_area, artist.end_area, gender, artist.edits_pending, artist.comment, artist.last_updated, artist.begin_date_year, artist.begin_date_month, artist.begin_date_day, artist.end_date_year, artist.end_date_month, artist.end_date_day,artist.ended, ac.edits_pending AS ac_edits_pending
                      FROM artist_credit_name
                      JOIN artist ON artist.id=artist_credit_name.artist
                      JOIN artist_credit ac ON ac.id = artist_credit_name.artist_credit
                      WHERE artist_credit IN (?)
                      ORDER BY artist_credit, position" with ParamValues: 1='lol']
        File "Connector.pm", line 50, in Sql::select_list_of_hashes
          $exception->throw( sqlstate => $state, message => decode_utf8($msg) );
        File "ArtistCredit.pm", line 36, in MusicBrainz::Server::Data::ArtistCredit::get_by_ids
          for my $row (@{ $self->sql->select_list_of_hashes($query, @ids) }) {
        File "EntityCache.pm", line 42, in MusicBrainz::Server::Data::ArtistCredit::get_by_ids
          my $data = $self->$orig(keys %ids) || {};
        File "Entity.pm", line 47, in MusicBrainz::Server::Data::Entity::get_by_id
          my @result = values %{$self->get_by_ids($id)};
        File "ArtistCredit.pm", line 25, in MusicBrainz::Server::Controller::ArtistCredit::_load
          my $artist_credit = $c->model('ArtistCredit')->get_by_id($id);
      ...
      (6 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-20