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

Internal server error when trying to authenticate via digest auth with non-ASCII username

XMLWordPrintable

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

      e.g. http://musicbrainz.org/ws/2/collection

      Picard calls this to fetch a user's collections and, if the username contains Latin-1 non-ASCII characters gets:

      Error:

      Caught exception in MusicBrainz::Server::Controller::WS::2::Collection->list_list "Failed query:
      'SELECT editor.id, editor.name, password, privs, email, website, bio,
      member_since, email_confirm_date, last_login_date, edits_accepted,
      edits_rejected, auto_edits_accepted, edits_failed, gender, area,
      birth_date FROM editor WHERE lower(name) = ? LIMIT 1'
      (ß)
      DBD::Pg::st execute failed: ERROR: invalid byte sequence for encoding "UTF8": 0xdf27 at lib/Sql.pm line 370, line 1.

      at lib/Sql.pm line 383, line 1.
      Sql::_ANON_('DBD::Pg::st execute failed: ERROR: invalid byte sequence for...') called at local/lib/perl5/Try/Tiny.pm line 100
      Try::Tiny::try('CODE(0xddf52b0)', 'Try::Tiny::Catch=REF(0xdcd85d8)') called at lib/Sql.pm line 385
      Sql::_select_single_row('Sql=HASH(0xda5f610)', 'SELECT editor.id, editor.name, password, privs, email, websit...', 'ARRAY(0x5bc0610)', 'hashref') called at lib/Sql.pm line 391
      Sql::select_single_row_hash('Sql=HASH(0xda5f610)', 'SELECT editor.id, editor.name, password, privs, email, websit...', '\x

      Unknown macro: {df}

      ') called at lib/MusicBrainz/Server/Data/Editor.pm line 76
      MusicBrainz::Server::Data::Editor::get_by_name('MusicBrainz::Server::Data::Editor=HASH(0xc0c4770)', '\x

      ') called at lib/MusicBrainz/Server/Authentication/WS/Store.pm line 31
      MusicBrainz::Server::Authentication::WS::Store::find_user('MusicBrainz::Server::Authentication::WS::Store=HASH(0x5213918)', 'HASH(0xdb38c90)', 'MusicBrainz::Server=HASH(0xdc0a0e0)') called at local/lib/perl5/Catalyst/Authentication/Realm.pm line 145
      Catalyst::Authentication::Realm::find_user('Catalyst::Authentication::Realm=HASH(0x5213840)', 'HASH(0xdb38c90)', 'MusicBrainz::Server=HASH(0xdc0a0e0)') called at local/lib/perl5/Catalyst/Authentication/Credential/HTTP.pm line 159
      Catalyst::Authentication::Credential::HTTP::authenticate_digest('MusicBrainz::Server::Authentication::WS::Credential=HASH(0x52...', 'MusicBrainz::Server=HASH(0xdc0a0e0)', 'Catalyst::Authentication::Realm=HASH(0x5213840)', 'HASH(0xdcec778)') called at local/lib/perl5/Catalyst/Authentication/Credential/HTTP.pm line 59
      Catalyst::Authentication::Credential::HTTP::authenticate('MusicBrainz::Server::Authentication::WS::Credential=HASH(0x52...', 'MusicBrainz::Server=HASH(0xdc0a0e0)', 'Catalyst::Authentication::Realm=HASH(0x5213840)', 'HASH(0xdcec778)') called at lib/MusicBrainz/Server/Authentication/WS/Credential.pm line 19
      MusicBrainz::Server::Authentication::WS::Credential::authenticate('MusicBrainz::Server::Authentication::WS::Credential=HASH(0x52...', 'MusicBrainz::Server=HASH(0xdc0a0e0)', 'Catalyst::Authentication::Realm=HASH(0x5213840)', 'HASH(0xdcec778)') called at local/lib/perl5/Catalyst/Authentication/Realm.pm line 161
      Catalyst::Authentication::Realm::authenticate('Catalyst::Authentication::Realm=HASH(0x5213840)', 'MusicBrainz::Server=HASH(0xdc0a0e0)', 'HASH(0xdcec778)') called at local/lib/perl5/Catalyst/Plugin/Authentication.pm line 378
      Catalyst::Plugin::Authentication::authenticate('MusicBrainz::Server=HASH(0xdc0a0e0)', 'HASH(0xdcec778)', 'musicbrainz.org') called at lib/MusicBrainz/Server/ControllerBase/WS/2.pm line 181
      MusicBrainz::Server::ControllerBase::WS::2::authenticate('MusicBrainz::Server::Controller::WS::2::Collection=HASH(0xd2a...', 'MusicBrainz::Server=HASH(0xdc0a0e0)', 16) called at lib/MusicBrainz/Server/Controller/WS/2/Collection.pm line 125
      MusicBrainz::Server::Controller::WS::2::Collection::list_list('MusicBrainz::Server::Controller::WS::2::Collection=HASH(0xd2a...', 'MusicBrainz::Server=HASH(0xdc0a0e0)') called at local/lib/perl5/Catalyst/Action.pm line 65
      Catalyst::Action::execute('Catalyst::Action=HASH(0xd63d438)', 'MusicBrainz::Server::Controller::WS::2::Collection=HASH(0xd2a...', 'MusicBrainz::Server=HASH(0xdc0a0e0)') called at local/lib/perl5/Catalyst.pm line 1672
      eval

      Unknown macro: {...}

      called at local/lib/perl5/Catalyst.pm line 1672
      Catalyst::execute('MusicBrainz::Server=HASH(0xdc0a0e0)', 'MusicBrainz::Server::Controller::WS::2::Collection', 'Catalyst::Action=HASH(0xd63d438)') called at local/lib/perl5/Catalyst/Plugin/StackTrace.pm line 94
      Catalyst::Plugin::StackTrace::execute('MusicBrainz::Server=HASH(0xdc0a0e0)', 'MusicBrainz::Server::Controller::WS::2::Collection', 'Catalyst::Action=HASH(0xd63d438)') called at local/lib/perl5/Catalyst/Action.pm line 60
      Catalyst::Action::dispatch('Catalyst::Action=HASH(0xd63d438)', 'MusicBrainz::Server=HASH(0xdc0a0e0)') called at local/lib/perl5/Catalyst/ActionChain.pm line 38
      Catalyst::ActionChain::dispatch('Catalyst::ActionChain=HASH(0xddf2a70)', 'MusicBrainz::Server=HASH(0xdc0a0e0)') called at local/lib/perl5/Catalyst/Controller.pm line 158
      Catalyst::Controller::_ACTION('MusicBrainz::Server::Controller::WS::2::Collection=HASH(0xd2a...', 'MusicBrainz::Server=HASH(0xdc0a0e0)') called at local/lib/perl5/Catalyst/Action.pm line 65
      Catalyst::Action::execute('Catalyst::Action=HASH(0xd7674e0)', 'MusicBrainz::Server::Controller::WS::2::Collection=HASH(0xd2a...', 'MusicBrainz::Server=HASH(0xdc0a0e0)') called at local/lib/perl5/Catalyst.pm line 1672
      eval

      called at local/lib/perl5/Catalyst.pm line 1672
      Catalyst::execute('MusicBrainz::Server=HASH(0xdc0a0e0)', 'MusicBrainz::Server::Controller::WS::2::Collection', 'Catalyst::Action=HASH(0xd7674e0)') called at local/lib/perl5/Catalyst/Plugin/StackTrace.pm line 94
      Catalyst::Plugin::StackTrace::execute('MusicBrainz::Server=HASH(0xdc0a0e0)', 'MusicBrainz::Server::Controller::WS::2::Collection', 'Catalyst::Action=HASH(0xd7674e0)') called at local/lib/perl5/Catalyst/Action.pm line 60
      Catalyst::Action::dispatch('Catalyst::Action=HASH(0xd7674e0)', 'MusicBrainz::Server=HASH(0xdc0a0e0)') called at local/lib/perl5/Catalyst/Dispatcher.pm line 257
      Catalyst::Dispatcher::_do_forward('Catalyst::Dispatcher=HASH(0x4b61090)', 'forward', 'MusicBrainz::Server=HASH(0xdc0a0e0)', '_ACTION') called at local/lib/perl5/Catalyst/Dispatcher.pm line 237
      Catalyst::Dispatcher::forward('Catalyst::Dispatcher=HASH(0x4b61090)', 'MusicBrainz::Server=HASH(0xdc0a0e0)', '_ACTION') called at local/lib/perl5/Catalyst.pm line 362
      Catalyst::forward('MusicBrainz::Server=HASH(0xdc0a0e0)', '_ACTION') called at local/lib/perl5/Catalyst/Controller.pm line 132
      Catalyst::Controller::_DISPATCH('MusicBrainz::Server::Controller::WS::2::Collection=HASH(0xd2a...', 'MusicBrainz::Server=HASH(0xdc0a0e0)') called at local/lib/perl5/Catalyst/Action.pm line 65
      Catalyst::Action::execute('Catalyst::Action=HASH(0xd766ec8)', 'MusicBrainz::Server::Controller::WS::2::Collection=HASH(0xd2a...', 'MusicBrainz::Server=HASH(0xdc0a0e0)') called at local/lib/perl5/Catalyst.pm line 1672
      eval

      Unknown macro: {...}

      called at local/lib/perl5/Catalyst.pm line 1672
      Catalyst::execute('MusicBrainz::Server=HASH(0xdc0a0e0)', 'MusicBrainz::Server::Controller::WS::2::Collection', 'Catalyst::Action=HASH(0xd766ec8)') called at local/lib/perl5/Catalyst/Plugin/StackTrace.pm line 94
      Catalyst::Plugin::StackTrace::execute('MusicBrainz::Server=HASH(0xdc0a0e0)', 'MusicBrainz::Server::Controller::WS::2::Collection', 'Catalyst::Action=HASH(0xd766ec8)') called at local/lib/perl5/Catalyst/Action.pm line 60
      Catalyst::Action::dispatch('Catalyst::Action=HASH(0xd766ec8)', 'MusicBrainz::Server=HASH(0xdc0a0e0)') called at local/lib/perl5/Catalyst/Dispatcher.pm line 257
      Catalyst::Dispatcher::_do_forward('Catalyst::Dispatcher=HASH(0x4b61090)', 'forward', 'MusicBrainz::Server=HASH(0xdc0a0e0)', '/ws/2/collection/_DISPATCH') called at local/lib/perl5/Catalyst/Dispatcher.pm line 237
      Catalyst::Dispatcher::forward('Catalyst::Dispatcher=HASH(0x4b61090)', 'MusicBrainz::Server=HASH(0xdc0a0e0)', '/ws/2/collection/_DISPATCH') called at local/lib/perl5/Catalyst.pm line 362
      Catalyst::forward('MusicBrainz::Server=HASH(0xdc0a0e0)', '/ws/2/collection/_DISPATCH') called at local/lib/perl5/Catalyst/Dispatcher.pm line 105
      Catalyst::Dispatcher::dispatch('Catalyst::Dispatcher=HASH(0x4b61090)', 'MusicBrainz::Server=HASH(0xdc0a0e0)') called at local/lib/perl5/Catalyst.pm line 1618
      Catalyst::dispatch('MusicBrainz::Server=HASH(0xdc0a0e0)') 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(0xdc0a0e0)', 'CODE(0xd8c17d8)') called at lib/MusicBrainz/Server.pm line 327
      Class::MOP::Class:::around('CODE(0x3f41f90)', 'MusicBrainz::Server=HASH(0xdc0a0e0)') called at local/lib/perl5/x86_64-linux-gnu-thread-multi/Class/MOP/Method/Wrapped.pm line 162
      Class::MOP::Method::Wrapped::_ANON_('MusicBrainz::Server=HASH(0xdc0a0e0)') called at lib/MusicBrainz/Server.pm line 341
      Class::MOP::Class:::around('CODE(0xd7fb7a8)', 'MusicBrainz::Server=HASH(0xdc0a0e0)') called at local/lib/perl5/x86_64-linux-gnu-thread-multi/Class/MOP/Method/Wrapped.pm line 162
      Class::MOP::Method::Wrapped::_ANON_('MusicBrainz::Server=HASH(0xdc0a0e0)') called at lib/MusicBrainz/Server.pm line 386
      Class::MOP::Class:::around('CODE(0xd8144c0)', 'MusicBrainz::Server=HASH(0xdc0a0e0)') called at local/lib/perl5/x86_64-linux-gnu-thread-multi/Class/MOP/Method/Wrapped.pm line 162
      Class::MOP::Method::Wrapped::_ANON_('MusicBrainz::Server=HASH(0xdc0a0e0)') called at local/lib/perl5/x86_64-linux-gnu-thread-multi/Class/MOP/Method/Wrapped.pm line 35
      Class::MOP::Method::Wrapped::_ANON_('MusicBrainz::Server=HASH(0xdc0a0e0)') called at local/lib/perl5/x86_64-linux-gnu-thread-multi/Class/MOP/Method/Wrapped.pm line 91
      MusicBrainz::Server::dispatch('MusicBrainz::Server=HASH(0xdc0a0e0)') called at local/lib/perl5/Catalyst.pm line 1968
      Catalyst::_ANON_() called at local/lib/perl5/Try/Tiny.pm line 76
      eval

      called at local/lib/perl5/Try/Tiny.pm line 67
      Try::Tiny::try('CODE(0xdce8440)', 'Try::Tiny::Catch=REF(0xddee640)') called at local/lib/perl5/Catalyst.pm line 1974
      Catalyst::handle_request('MusicBrainz::Server', 'env', 'HASH(0xdca66a8)', 'response_cb', 'CODE(0xd8aeed8)') called at local/lib/perl5/Catalyst/Plugin/AutoRestart.pm line 117
      Catalyst::Plugin::AutoRestart::handle_request('MusicBrainz::Server', 'env', 'HASH(0xdca66a8)', 'response_cb', 'CODE(0xd8aeed8)') called at local/lib/perl5/Catalyst/Engine.pm line 688
      Catalyst::Engine::_ANON_('CODE(0xd8aeed8)') called at local/lib/perl5/Plack/Handler/FCGI.pm line 130
      Plack::Handler::FCGI::run('Plack::Handler::FCGI=HASH(0x1e7a9d0)', 'CODE(0xd819bd0)') called at local/lib/perl5/Plack/Loader.pm line 84
      Plack::Loader::run('Plack::Loader=HASH(0x1da1c90)', 'Plack::Handler::FCGI=HASH(0x1e7a9d0)') called at local/lib/perl5/Plack/Runner.pm line 267
      Plack::Runner::run('Plack::Runner=HASH(0x1c2a808)') called at local/bin/plackup line 10"
      Stack trace:
      line 76 MusicBrainz::Server::Data::Editor
      line 31 MusicBrainz::Server::Authentication::WS::Store
      line 19 MusicBrainz::Server::Authentication::WS::Credential
      line 181 MusicBrainz::Server::ControllerBase::WS::2
      line 125 MusicBrainz::Server::Controller::WS::2::Collection
      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' => {}
      };

      Host: pingu

      URL: http://musicbrainz.org/ws/2/collection

      When trying to reproduce it with a non-Latin-1 username, it doesn't do anything at all, I just keep repeatedly getting asked for the username and password.

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

              Created:
              Updated:
              Resolved:

                Version Package
                2013-07-22