Bug 26 - cddb-tool returning status of 500, not caught by abcde:do_cddbread()
Summary: cddb-tool returning status of 500, not caught by abcde:do_cddbread()
Status: RESOLVED FIXED
Alias: None
Product: abcde
Classification: Unclassified
Component: CD lookup (show other bugs)
Version: unspecified
Hardware: Macintosh All
: Normal normal
Assignee: Andrew Strong
URL:
Depends on:
Blocks:
 
Reported: 2015-12-13 17:56 GMT by Von Welch
Modified: 2016-01-09 17:47 GMT (History)
1 user (show)

See Also:


Attachments
Catch cddb-tool returning 500 (996 bytes, patch)
2015-12-14 00:14 GMT, Von Welch
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Von Welch 2015-12-13 17:56:28 GMT
This is with git HEAD (f4ce943) under MacOSX 10.11.2.

I'm apparently getting a status of 500 back from CDDB:

% cat /Volumes/music/wav/abcde.ffffffffef000a0c/cddbquery
500 Command syntax error.

Here's the command abcde is running and I've confirmed it returns 500 when run directly
% cddb-tool query http://freedb.freedb.org/\~cddb/cddb.cgi 6 von Vons-Air ffffffffef000a0c 12 150 -1418788714 1372651670 87294358 394461590 818741654 -1843330410 1718092438 599392918 -1424751722 1600914326 1575027606 31784972

500 Command syntax error.

Confirming what is being passed to cddb-tool matches what cd-discid produces:
% cddb-tool query http://freedb.freedb.org/\~cddb/cddb.cgi 6 von Vons-Air `cd-discid /dev/disk2`

500 Command syntax error.

cd-discid's outut:
% cd-discid /dev/disk2
ffffffffef000a0c 12 150 -1418788714 1372651670 87294358 394461590 818741654 -1843330410 1718092438 599392918 -1424751722 1600914326 1575027606 31784972


do_cddbread() doesn't seem to catch the 500 response - looking at the case statement, it doesn't look for 500 so this just falls through.

Ultimately I believe this then causes do_cddbedit() to fail as follows:

abcde: internal error: cddb-choice not recorded.
Comment 1 Andrew Strong 2015-12-13 20:05:05 GMT
I wonder if you are coming to grief with the default:

HELLOINFO="$(whoami)@$(hostname)"

from abcde? I am not sure what this produces in MacOSx but try manipulating this and see if freedb is happier...

The cddb-tool used directly uses:

HELLOINFO="$USER+$HOST+$NAME+$VERSION"

I suspect that either of these are causing the issue. Wish I had a Mac to test this out :(.
Comment 2 Von Welch 2015-12-14 00:00:41 GMT
It's something with the cd-discid output, the following works (it's some sample discid output I found on the web at http://ubuntuforums.org/archive/index.php/t-1669680.html):

% cddb-tool query http://freedb.freedb.org/\~cddb/cddb.cgi 6 von Vons-Air b20c680c 12 150 20767 32892 47645 68990 87095 107210 119500 137185 160902 186732 205667 3178

200 blues b20c680c R. L. Burnside / Burnside On Burnside
Comment 3 Von Welch 2015-12-14 00:04:53 GMT
It's apparently the negative values returned by cd-discid. The following is the same command that returns 500, but with "-"s removed from the number.

% cddb-tool query http://freedb.freedb.org/\~cddb/cddb.cgi 6 von Vons-Air ffffffffef000a0c 12 150 1418788714 1372651670 87294358 394461590 818741654 1843330410 1718092438 599392918 1424751722 1600914326 1575027606 31784972

202 No match for disc ID ffffffff.
Comment 4 Von Welch 2015-12-14 00:14:31 GMT
Created attachment 13 [details]
Catch cddb-tool returning 500
Comment 5 Von Welch 2015-12-14 00:16:58 GMT
The attached patch makes abcde handle cddb-tool returning 500 appropriately I believe (it treats it the same a a 503 response). (Perhaps you want to generalize to any 5?? status?)

% ./abcde
Volume Audio CD on disk2 unmounted
Volume Audio CD on disk2 mounted
Grabbing entire CD - tracks: 01 02 03 04 05 06 07 08 09 10 11 12
Volume Audio CD on disk2 unmounted
CDDB unavailable.
---- Unknown Artist / Unknown Album ----
1: Track 1
2: Track 2
3: Track 3
4: Track 4
5: Track 5
6: Track 6
7: Track 7
8: Track 8
9: Track 9
10: Track 10
11: Track 11
12: Track 12

Edit selected CDDB data [Y/n]? ^C
Status: 130
Comment 6 Von Welch 2015-12-14 00:37:38 GMT
This isn't really relevant to abcde, but in case another mac user finds their way here, it appears cd-discid returning negative values may be a very old bug that has crept back in somehow: https://trac.macports.org/ticket/11353

I'm running 1.4 installed via homebrew:
% cd-discid --version
cd-discid 1.4.

If I can find another way to install it so it works, I'll report back here.
Comment 7 Von Welch 2015-12-14 00:49:19 GMT
I've confirmed that cloning the latest cd-discid from https://github.com/taem/cd-discid running 'make' and using it instead of the homebrew version works.

% ./cd-discid /dev/disk2
ab0df70c 12 150 28737 53735 79003 99245 118214 139816 157948 178873 202049 224501 254451 3577

This is the same disc that was returning an id of "ffffffffef000a0c" so it's not just broken track information.

I note the same version though:

% ./cd-discid --version
cd-discid 1.4.


Probably a bug to report to homebrew. I'm done here unless there is something else I can provide.
Comment 8 Von Welch 2015-12-14 01:02:57 GMT
Link the Homebrew issue: https://github.com/Homebrew/homebrew/issues/46267
Comment 9 Andrew Strong 2015-12-14 19:21:45 GMT
Thanks for all of your work on this issue, I will retest and commit this weekend...
Comment 10 Andrew Strong 2015-12-15 08:41:27 GMT
Might be interesting to flesh all of the error codes out a little. This seems to be the most recent document I could find:

http://ftp.freedb.org/pub/freedb/misc/freedb_CDDB_protcoldoc.zip
Comment 11 Andrew Strong 2015-12-17 01:34:41 GMT
I have pushed the fix and left myself a note about making the error codes a little clearer in abcde. Thanks again for your work Von Welch, I welcome your eagle eye over abcde and I especially welcome the involvement of somebody who uses MacOSX :)
Comment 12 Von Welch 2016-01-09 17:47:20 GMT
FYI, cd-discid in homebrew has been fixed per https://github.com/Homebrew/homebrew/issues/46267