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

SQL Sysntax error causing Error 500 when trying to ad releases to Collection

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      This doesn't happen every time, and I don't have details of what was sent to MusicBrainz when it failed, but the stackrace shows that the data provided caused some invalid SQL to be generated.

      Extracted from stack trace below
      <p><code>Caught exception in MusicBrainz::Server::Controller::WS::2::Collection->list_list "Failed query:
      'SELECT id, coalesce(
      (SELECT count(release)
      FROM editor_collection_release
      WHERE collection = col.id), 0)
      FROM (
      VALUES
      ) col (id)'
      ()
      DBD::Pg::st execute failed: ERROR: syntax error at or near ")"
      LINE 7:

      <!DOCTYPE html>
      <html xmlns="http://www.w3.org/1999/xhtml"
      xml:lang="en"
      lang="en">

      <head>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Internal Server Error - MusicBrainz</title>
      <link rel="stylesheet" type="text/css" href="/static/styles/78c126fb02ffa29f85247f6612a7c236.css" />
      <link type="text/css" rel="stylesheet" href="http://musicbrainz.org/static/lib/jquery.ui/themes/base/jquery.ui.all.css" /> <link rel="search" type="application/opensearchdescription+xml" title="MusicBrainz: Artist" href="http://musicbrainz.org/static/search_plugins/opensearch/musicbrainz_artist.xml" />
      <link rel="search" type="application/opensearchdescription+xml" title="MusicBrainz: Label" href="http://musicbrainz.org/static/search_plugins/opensearch/musicbrainz_label.xml" />
      <link rel="search" type="application/opensearchdescription+xml" title="MusicBrainz: Release" href="http://musicbrainz.org/static/search_plugins/opensearch/musicbrainz_release.xml" />
      <link rel="search" type="application/opensearchdescription+xml" title="MusicBrainz: Track" href="http://musicbrainz.org/static/search_plugins/opensearch/musicbrainz_track.xml" />
      <script type="text/javascript">//<![CDATA[
      document.cookie = "javascript=true; path=/";
      //]]></script> <script src="/static/84701079b35c33f99324b5fba2ef7c5b.js"></script> <script type="text/javascript" src="http://musicbrainz.org/text.js"></script> <script type="text/javascript">//<![CDATA[
      $(document).ready (function ()

      { $("[placeholder]").mb_placeholder (); MB.Control.RelateTo (); }

      );
      //]]></script>
      </head>
      <body>
      <div id="header">
      <div id="header-logo">
      <a href="/" class="logo" title="MusicBrainz"><strong>MusicBrainz</strong></a>
      <div> <form action="http://musicbrainz.org/search" method="get">

      <span class="buttons header-search">
      <button type="submit">Search</button>
      </span>
      </form>
      </div>
      </div>
      <div id="header-menu">
      <div><ul class="r"> <li class="account">
      <a href="http://musicbrainz.org/user/rpm4fsu">rpm4fsu</a>
      <ul>
      <li>
      <a href="http://musicbrainz.org/account/edit">Edit Profile</a>
      </li>
      <li>
      <a href="http://musicbrainz.org/account/change-password">Change Password</a>
      </li>
      <li>
      <a href="http://musicbrainz.org/account/preferences">Preferences</a>
      </li>
      <li>
      <a href="http://musicbrainz.org/user/rpm4fsu/subscriptions/artist">Subscriptions</a>
      </li>
      <li>
      <a href="http://musicbrainz.org/logout">Log Out</a>
      </li>
      </ul>
      </li>
      <li class="data">
      <a href="http://musicbrainz.org/user/rpm4fsu">My Data</a>
      <ul>
      <li>
      <a href="http://musicbrainz.org/user/rpm4fsu/collections">My Collections</a>
      </li>
      <li>
      <a href="http://musicbrainz.org/user/rpm4fsu/ratings">My Ratings</a>
      </li>
      <li>
      <a href="http://musicbrainz.org/user/rpm4fsu/tags">My Tags</a>
      </li>
      <li>
      <a href="http://musicbrainz.org/watch/list">My Watched Artists</a>
      </li>
      <li class="separator">
      <a href="http://musicbrainz.org/user/rpm4fsu/edits/open">My Open Edits</a>
      </li>
      <li>
      <a href="http://musicbrainz.org/user/rpm4fsu/edits">All My Edits</a>
      </li>
      <li>
      <a href="http://musicbrainz.org/edit/subscribed">Edits for Subscribed Entities</a>
      </li>
      <li>
      <a href="http://musicbrainz.org/edit/subscribed_editors">Edits by Subscribed Editors</a>
      </li>
      </ul>
      </li>
      </ul>

      <ul>
      <li class="about">
      <a href="http://musicbrainz.org/doc/About_MusicBrainz">About</a>
      <ul>
      <li>
      <a href="http://musicbrainz.org/doc/MusicBrainz_Sponsors">Sponsors</a>
      </li>
      <li>
      <a href="http://musicbrainz.org/doc/MusicBrainz_Bio">People</a>
      </li>
      <li>
      <a href="http://musicbrainz.org/doc/MusicBrainz_Press">In the Press</a>
      </li>
      <li class="separator">
      <a href="http://musicbrainz.org/doc/MusicBrainz_License">Data Licenses</a>
      </li>
      <li>
      <a href="http://musicbrainz.org/doc/Social_Contract">Social Contract</a>
      </li>
      <li>
      <a href="http://musicbrainz.org/doc/MusicBrainz_Privacy_Policy">Privacy Policy</a>
      </li>
      <li class="separator">
      <a href="http://musicbrainz.org/elections">Auto-editor Elections</a>
      </li>
      <li>
      <a href="http://musicbrainz.org/privileged">Privileged User Accounts</a>
      </li>
      <li>
      <a href="http://musicbrainz.org/statistics">Statistics</a>
      </li>
      <li>
      <a href="http://musicbrainz.org/statistics/timeline">Timeline Graph</a>
      </li>
      </ul>
      </li>
      <li class="blog">
      <a href="http://blog.musicbrainz.org" class="internal">
      Blog
      </a>
      </li>

      <li class="products">
      <a href="http://musicbrainz.org/doc/Products">Products</a>
      <ul>
      <li>
      <a href="http://musicbrainz.org/doc/MusicBrainz_Picard">MusicBrainz Picard</a>
      </li>
      <li>
      <a href="http://musicbrainz.org/doc/Jaikoz">Jaikoz</a>
      </li>
      <li>
      <a href="http://musicbrainz.org/doc/Magic_MP3_Tagger">Magic MP3 Tagger</a>
      </li>
      <li class="separator">
      <a href="http://musicbrainz.org/doc/MusicBrainz_Server">MusicBrainz Server</a>
      </li>
      <li>
      <a href="http://musicbrainz.org/doc/MusicBrainz_Database">MusicBrainz Database</a>
      </li>
      <li>
      <a href="http://musicbrainz.org/doc/XML_Web_Service">XML Web Service</a>
      </li>
      <li>
      <a href="http://musicbrainz.org/doc/Live_Data_Feed">Live Data Feed</a>
      </li>
      <li class="separator">
      <a href="http://musicbrainz.org/doc/FreeDB_Gateway">FreeDB Gateway</a>
      </li>
      </ul>
      </li>
      <li class="search">
      <a href="http://musicbrainz.org/search">Search</a>
      <ul> <li>
      <a href="http://musicbrainz.org/search/edits">Search Edits</a>
      </li>

      <li>
      <a href="http://musicbrainz.org/browse">Browse</a>
      </li>
      <li>
      <a href="http://musicbrainz.org/tags">Tags</a>
      </li>
      <li>
      <a href="http://musicbrainz.org/cdstub/browse">Top CD Stubs</a>
      </li>
      <li class="separator">
      <a href="http://musicbrainz.org/search/plugins">Browser Search Plugins</a>
      </li>
      </ul>
      </li> <li class="editing">
      <a href="http://musicbrainz.org/doc/How_Editing_Works">Editing</a>
      <ul>
      <li>
      <a href="http://musicbrainz.org/artist/create">Add Artist</a>
      </li>
      <li>
      <a href="http://musicbrainz.org/label/create">Add Label</a>
      </li>
      <li>
      <a href="http://musicbrainz.org/release-group/create">Add Release Group</a>
      </li>
      <li>
      <a href="http://musicbrainz.org/release/add">Add Release</a>
      </li>
      <li>
      <a href="http://musicbrainz.org/release/add?artist=">Add Various Artists Release</a>
      </li>
      <li>
      <a href="http://musicbrainz.org/recording/create">Add Standalone Recording</a>
      </li>
      <li>
      <a href="http://musicbrainz.org/work/create">Add Work</a>
      </li>
      <li class="separator">
      <a href="http://musicbrainz.org/edit/open">Vote on Edits</a>
      </li>
      <li>
      <a href="http://musicbrainz.org/report">Editing Suggestions</a>
      </li>
      <li class="separator">
      <a href="http://musicbrainz.org/doc/Edit_Types">Edit Conditions</a>
      </li>
      </ul>
      </li> <li class="documentation">
      <a href="http://musicbrainz.org/doc/MusicBrainz_Documentation">Documentation</a>
      <ul>
      <li>
      <a href="http://musicbrainz.org/doc/Beginners_Guide">Beginners Guide</a>
      </li>
      <li>
      <a href="http://musicbrainz.org/doc/Official_Style_Guideline">Style Guidelines</a>
      </li>
      <li>
      <a href="http://musicbrainz.org/doc/Frequently_Asked_Questions">FAQs</a>
      </li>
      <li class="separator">
      <a href="http://musicbrainz.org/admin/linktype">Relationship Types</a>
      </li>
      <li>
      <a href="http://musicbrainz.org/admin/linkattributetype">Relationship Attributes</a>
      </li>
      <li>
      <a href="http://musicbrainz.org/admin/linkattributetype/instruments">Instrument Tree</a>
      </li>
      <li class="separator">
      <a href="http://musicbrainz.org/doc/Development">Development</a>
      </li>
      </ul>
      </li>
      <li class="contact">
      <a href="http://musicbrainz.org/doc/Contact_Us">Contact Us</a>
      <ul>
      <li>
      <a href="http://musicbrainz.org/doc/Mailing_Lists">Mailing Lists</a>
      </li>
      <li>
      <a href="http://forums.musicbrainz.org" class="internal">
      Forums
      </a>
      </li>
      <li class="separator">
      <a href="http://jira.musicbrainz.org" class="internal">
      Report a Bug
      </a>
      </li>
      <li>
      <a href="http://musicbrainz.org/doc/Copyright_Violation_Notice">Report a Copyright Violation</a>
      </li>
      </ul>
      </li>
      </ul>
      <div class="r"></div><div class="l"></div>
      </div>
      </div>
      </div>

      <div id="page" class="fullwidth">
      <div id="content">
      <h1>Internal Server Error</h1>

      <p><strong>Oops, something went wrong!</strong></p>

      <p>
      <strong>Error:</strong>

      <p><code>Caught exception in MusicBrainz::Server::Controller::WS::2::Collection->list_list "Failed query:
      'SELECT id, coalesce(
      (SELECT count(release)
      FROM editor_collection_release
      WHERE collection = col.id), 0)
      FROM (
      VALUES
      ) col (id)'
      ()
      DBD::Pg::st execute failed: ERROR: syntax error at or near ")"
      LINE 7: ) col (id)
      ^ at /home/musicbrainz/musicbrainz-server/script/../lib/Sql.pm line 79.

      at /home/musicbrainz/musicbrainz-server/script/../lib/Sql.pm line 84
      Sql::_ANON_('DBD::Pg::st execute failed: ERROR: syntax error at or near "...') called at /usr/local/share/perl/5.10.1/Try/Tiny.pm line 100
      Try::Tiny::try('CODE(0xbf613c0)', 'Try::Tiny::Catch=REF(0xbf715f8)') called at /home/musicbrainz/musicbrainz-server/script/../lib/Sql.pm line 86
      Sql::select('Sql=HASH(0x95c40a8)', 'SELECT id, coalesce(\x

      {a} (SELECT count(release)\x{a}

      ...') called at /home/musicbrainz/musicbrainz-server/script/../lib/MusicBrainz/Server/Data/Collection.pm line 192
      MusicBrainz::Server::Data::Collection::load_release_count('MusicBrainz::Server::Data::Collection=HASH(0x7a6c588)') called at /home/musicbrainz/musicbrainz-server/script/../lib/MusicBrainz/Server/Controller/WS/2/Collection.pm line 123
      MusicBrainz::Server::Controller::WS::2::Collection::list_list('MusicBrainz::Server::Controller::WS::2::Collection=HASH(0x8dd...', 'MusicBrainz::Server=HASH(0xbf2b8c8)') called at /usr/local/share/perl/5.10.1/Catalyst/Action.pm line 65
      Catalyst::Action::execute('Catalyst::Action=HASH(0x91d9520)', 'MusicBrainz::Server::Controller::WS::2::Collection=HASH(0x8dd...', 'MusicBrainz::Server=HASH(0xbf2b8c8)') called at /usr/local/share/perl/5.10.1/Catalyst.pm line 1665
      eval

      {...} called at /usr/local/share/perl/5.10.1/Catalyst.pm line 1665
      Catalyst::execute('MusicBrainz::Server=HASH(0xbf2b8c8)', 'MusicBrainz::Server::Controller::WS::2::Collection', 'Catalyst::Action=HASH(0x91d9520)') called at /usr/local/share/perl/5.10.1/Catalyst/Plugin/StackTrace.pm line 94
      Catalyst::Plugin::StackTrace::execute('MusicBrainz::Server=HASH(0xbf2b8c8)', 'MusicBrainz::Server::Controller::WS::2::Collection', 'Catalyst::Action=HASH(0x91d9520)') called at /usr/local/share/perl/5.10.1/Catalyst/Action.pm line 60
      Catalyst::Action::dispatch('Catalyst::Action=HASH(0x91d9520)', 'MusicBrainz::Server=HASH(0xbf2b8c8)') called at /usr/local/share/perl/5.10.1/Catalyst/ActionChain.pm line 39
      Catalyst::ActionChain::dispatch('Catalyst::ActionChain=HASH(0xbf602e8)', 'MusicBrainz::Server=HASH(0xbf2b8c8)') called at /usr/local/share/perl/5.10.1/Catalyst/Controller.pm line 110
      Catalyst::Controller::_ACTION('MusicBrainz::Server::Controller::WS::2::Collection=HASH(0x8dd...', 'MusicBrainz::Server=HASH(0xbf2b8c8)') called at /usr/local/share/perl/5.10.1/Catalyst/Action.pm line 65
      Catalyst::Action::execute('Catalyst::Action=HASH(0x91cf748)', 'MusicBrainz::Server::Controller::WS::2::Collection=HASH(0x8dd...', 'MusicBrainz::Server=HASH(0xbf2b8c8)') called at /usr/local/share/perl/5.10.1/Catalyst.pm line 1665
      eval {...}

      called at /usr/local/share/perl/5.10.1/Catalyst.pm line 1665
      Catalyst::execute('MusicBrainz::Server=HASH(0xbf2b8c8)', 'MusicBrainz::Server::Controller::WS::2::Collection', 'Catalyst::Action=HASH(0x91cf748)') called at /usr/local/share/perl/5.10.1/Catalyst/Plugin/StackTrace.pm line 94
      Catalyst::Plugin::StackTrace::execute('MusicBrainz::Server=HASH(0xbf2b8c8)', 'MusicBrainz::Server::Controller::WS::2::Collection', 'Catalyst::Action=HASH(0x91cf748)') called at /usr/local/share/perl/5.10.1/Catalyst/Action.pm line 60
      Catalyst::Action::dispatch('Catalyst::Action=HASH(0x91cf748)', 'MusicBrainz::Server=HASH(0xbf2b8c8)') called at /usr/local/share/perl/5.10.1/Catalyst/Dispatcher.pm line 257
      Catalyst::Dispatcher::_do_forward('Catalyst::Dispatcher=HASH(0x1720698)', 'forward', 'MusicBrainz::Server=HASH(0xbf2b8c8)', '_ACTION') called at /usr/local/share/perl/5.10.1/Catalyst/Dispatcher.pm line 237
      Catalyst::Dispatcher::forward('Catalyst::Dispatcher=HASH(0x1720698)', 'MusicBrainz::Server=HASH(0xbf2b8c8)', '_ACTION') called at /usr/local/share/perl/5.10.1/Catalyst.pm line 377
      Catalyst::forward('MusicBrainz::Server=HASH(0xbf2b8c8)', '_ACTION') called at /usr/local/share/perl/5.10.1/Catalyst/Controller.pm line 84
      Catalyst::Controller::_DISPATCH('MusicBrainz::Server::Controller::WS::2::Collection=HASH(0x8dd...', 'MusicBrainz::Server=HASH(0xbf2b8c8)') called at /usr/local/share/perl/5.10.1/Catalyst/Action.pm line 65
      Catalyst::Action::execute('Catalyst::Action=HASH(0x91cf208)', 'MusicBrainz::Server::Controller::WS::2::Collection=HASH(0x8dd...', 'MusicBrainz::Server=HASH(0xbf2b8c8)') called at /usr/local/share/perl/5.10.1/Catalyst.pm line 1665
      eval

      {...} called at /usr/local/share/perl/5.10.1/Catalyst.pm line 1665
      Catalyst::execute('MusicBrainz::Server=HASH(0xbf2b8c8)', 'MusicBrainz::Server::Controller::WS::2::Collection', 'Catalyst::Action=HASH(0x91cf208)') called at /usr/local/share/perl/5.10.1/Catalyst/Plugin/StackTrace.pm line 94
      Catalyst::Plugin::StackTrace::execute('MusicBrainz::Server=HASH(0xbf2b8c8)', 'MusicBrainz::Server::Controller::WS::2::Collection', 'Catalyst::Action=HASH(0x91cf208)') called at /usr/local/share/perl/5.10.1/Catalyst/Action.pm line 60
      Catalyst::Action::dispatch('Catalyst::Action=HASH(0x91cf208)', 'MusicBrainz::Server=HASH(0xbf2b8c8)') called at /usr/local/share/perl/5.10.1/Catalyst/Dispatcher.pm line 257
      Catalyst::Dispatcher::_do_forward('Catalyst::Dispatcher=HASH(0x1720698)', 'forward', 'MusicBrainz::Server=HASH(0xbf2b8c8)', '/ws/2/collection/_DISPATCH') called at /usr/local/share/perl/5.10.1/Catalyst/Dispatcher.pm line 237
      Catalyst::Dispatcher::forward('Catalyst::Dispatcher=HASH(0x1720698)', 'MusicBrainz::Server=HASH(0xbf2b8c8)', '/ws/2/collection/_DISPATCH') called at /usr/local/share/perl/5.10.1/Catalyst.pm line 377
      Catalyst::forward('MusicBrainz::Server=HASH(0xbf2b8c8)', '/ws/2/collection/_DISPATCH') called at /usr/local/share/perl/5.10.1/Catalyst/Dispatcher.pm line 105
      Catalyst::Dispatcher::dispatch('Catalyst::Dispatcher=HASH(0x1720698)', 'MusicBrainz::Server=HASH(0xbf2b8c8)') called at /usr/local/share/perl/5.10.1/Catalyst.pm line 1611
      Catalyst::dispatch('MusicBrainz::Server=HASH(0xbf2b8c8)') called at /usr/local/share/perl/5.10.1/Catalyst/Plugin/Static/Simple.pm line 76
      Class::MOP::Class:::around('CODE(0x1d80440)', 'MusicBrainz::Server=HASH(0xbf2b8c8)') called at /usr/local/lib/perl/5.10.1/Class/MOP/Method/Wrapped.pm line 159
      Class::MOP::Method::Wrapped::_ANON_('MusicBrainz::Server=HASH(0xbf2b8c8)') called at /home/musicbrainz/musicbrainz-server/script/../lib/MusicBrainz/Server.pm line 258
      Class::MOP::Class:::around('CODE(0x92ed528)', 'MusicBrainz::Server=HASH(0xbf2b8c8)') called at /usr/local/lib/perl/5.10.1/Class/MOP/Method/Wrapped.pm line 159
      Class::MOP::Method::Wrapped::_ANON_('MusicBrainz::Server=HASH(0xbf2b8c8)') called at /usr/local/lib/perl/5.10.1/Class/MOP/Method/Wrapped.pm line 89
      MusicBrainz::Server::dispatch('MusicBrainz::Server=HASH(0xbf2b8c8)') called at /usr/local/share/perl/5.10.1/Catalyst.pm line 1952
      eval {...}

      called at /usr/local/share/perl/5.10.1/Catalyst.pm line 1943
      Catalyst::handle_request('MusicBrainz::Server', 'env', 'HASH(0x2ad8210)') called at /usr/local/share/perl/5.10.1/Catalyst/Plugin/AutoRestart.pm line 114
      Catalyst::Plugin::AutoRestart::handle_request('MusicBrainz::Server', 'env', 'HASH(0x2ad8210)') called at /usr/local/share/perl/5.10.1/Catalyst/Engine/FastCGI.pm line 149
      Catalyst::Engine::FastCGI::run('Catalyst::Engine::FastCGI=HASH(0x2aa3d70)', 'MusicBrainz::Server', '127.0.0.1:55901', 'HASH(0x60dd48)') called at /usr/local/share/perl/5.10.1/Catalyst.pm line 2396
      Catalyst::run('MusicBrainz::Server', '127.0.0.1:55901', 'HASH(0x60dd48)') called at ./script/musicbrainz_fastcgi.pl line 28"</code></p>

      </p>
      <p>
      <strong>Stack trace:</strong><br />
      <ul>

      <li><code>line 192 MusicBrainz::Server::Data::Collection</code></li>

      <li><code>line 123 MusicBrainz::Server::Controller::WS::2::Collection</code></li>

      <li><code>line 258 MusicBrainz::Server</code></li>

      </ul>
      </p>
      <p>
      <strong>Request data:</strong>
      <pre>$VAR1 = {
      'query_parameters' => {},
      'body_parameters' => {}
      };
      </pre>
      </p>

      <p>We're terribly sorry for this problem. Please wait a few minutes and repeat your request — the problem may go away.
      </p>
      <p>If the problem persists, please <a href="http://tickets.musicbrainz.org/secure/CreateIssue.jspa?pid=10000&issuetype=1">report a bug</a> and include any error message that is shown above. </p>

      <p>Please be sure to include the stack trace and request data shown above!</p>

      </div> <div class="br"></div><div class="bl"></div><div class="tr"></div><div class="tl"></div>
      </div>

      <div id="footer">
      <p class="links">
      <a href="http://metabrainz.org/donate" class="internal">Donate</a> |
      <a href="http://wiki.musicbrainz.org/" class="internal">Wiki</a> |
      <a href="http://forums.musicbrainz.org/" class="internal">Forums</a> |
      <a href="http://jira.musicbrainz.org/" class="internal">Bug Tracker</a> |
      <a href="http://twitter.com/MusicBrainz" class="internal">Twitter</a> |
      <a href="http://www.cafepress.com/musicbrainz" class="internal">Schwag</a>
      </p>

      <p class="sponsors">
      Hosted by <a href="http://digitalwest.net/">Digital West</a>. Sponsored by: <a href="http://www.google.com/">Google</a>,
      <a href="http://osuosl.org/">OSUOSL</a> and <a href="http://musicbrainz.org/doc/MusicBrainz_Sponsors">others...</a>
      </p>
      </div>
      </body>
      </html>

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              acid2 Oliver Charles
              Reporter:
              ijabz Paul Taylor
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Packages

                  Version Package