Issue Details (XML | Word | Printable)

Key: MBS-4099
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Normal Normal
Assignee: Oliver Charles
Reporter: Robert Kaye
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
MusicBrainz Server

The server should give a good error message when it can't connect to the DB

Created: 02/Jan/12 09:27 PM   Updated: 12/Jan/12 02:30 PM  Due: 02/Apr/12   Resolved: 12/Jan/12 02:30 PM
Component/s: None
Affects Version/s: None
Fix Version/s: Schema change, 2012-01-12

Issue Links:
Duplicate
 
Relates
 
Resolution
 


 Description  « Hide

Currently, when the DB crashes, we get errors like this:

@400000004f021eb434c525cc [error] Caught exception in MusicBrainz::Server::Controller::WS::1::ReleaseGroup->lookup "Can't call method "artist_credit" on an undefined value at /home/musicbrainz/musicbrainz-server/script/../lib/MusicBrainz/Server/Controller/WS/1/ReleaseGroup.pm line 35."

Instead it should catch the error and give a proper message that our DB is unavailable.



Sort Order: Ascending order - Click to sort in descending order
Oliver Charles added a comment - 02/Jan/12 09:42 PM

Unassigning because anyone can do this


Oliver Charles added a comment - 02/Jan/12 09:57 PM

Could this be the same as http://codereview.musicbrainz.org/r/1558/ ?


Robert Kaye added a comment - 02/Jan/12 10:06 PM

I doubt its the same issue. In fact, I restarted the DB server and the web servers did not need restarting for everything to get going again, so the issue fixed in r1558 may not even be an issue (for us).


Oliver Charles added a comment - 03/Jan/12 03:40 PM

With pecastro's branch (and a single commit from me), I ran the following the tests...

  1. A request to /ws/2/release/f9be5cd4-f77d-48f2-8ced-4c5237f8dcc2 with the database running succeeds
  2. The database is server is forced to stop
  3. A request to /ws/2/release/f9be5cd4-f77d-48f2-8ced-4c5237f8dcc2 now produces the following log message:
    [error] Caught exception in MusicBrainz::Server::Controller::WS::2::Release->release "Failed query:
    	'SELECT release.id, release.gid, name.name, release.artist_credit AS artist_credit_id,
                release_group, release.status, release.packaging, date_year, date_month, date_day,
                release.country, release.comment, release.edits_pending, release.barcode,
                release.script, release.language, release.quality, release.last_updated FROM release JOIN release_name name ON release.name=name.id WHERE gid IN (?) '
    	(f9be5cd4-f77d-48f2-8ced-4c5237f8dcc2)
    DBI connect('dbname=musicbrainz','musicbrainz_user',...) failed: could not connect to server: No such file or directory
    	Is the server running locally and accepting
    	connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"? at /home/ollie/perl5/lib/perl5/DBIx/Connector.pm line 32
      
  4. Bringing the database server back up, the same request now succeeds again

So I think it solves this problem perfectly.


Kuno Woudt added a comment - 12/Jan/12 02:00 PM

(assigning to Oliver as the ticket is marked as "In Beta Testing" and Oliver probably merged this into beta)