Bug 5166 - Scanner crashes with multiple ALBUMARTIST tags
: Scanner crashes with multiple ALBUMARTIST tags
Status: RESOLVED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: Scanner
: 6.5.3
: Linkstation Debian Linux
: P2 critical (vote)
: ---
Assigned To: Squeezebox QA Team email alias
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-07-14 08:15 UTC by Steve Tregidgo
Modified: 2007-09-18 12:38 UTC (History)
3 users (show)

See Also:
Category: ---


Attachments
This file crashes the scanner (1.45 MB, audio/x-mpeg)
2007-07-14 08:18 UTC, Steve Tregidgo
Details
This file does not cause a crash for me (1.96 MB, audio/x-mpeg)
2007-07-14 09:09 UTC, Steve Tregidgo
Details
potential patch (494 bytes, patch)
2007-07-20 12:33 UTC, Adrian Smith
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Steve Tregidgo 2007-07-14 08:15:35 UTC
I've encountered some files which cause the scanner on my system to produce a SQL-related backtrace.  A sample log is included at the end of this description.

I've isolated one of the MP3 files which caused the problem, and have been experimenting with the tags to see just what triggers it.  It seems to be related to the presence of ALBUMARTIST and COMPOSER tags, but it's not obvious to me what the exact criteria are.  The following tags fail (the formatting here due to being copied from foobar2000; the order seems to be important):

ARTIST = The Police
COMPOSER = Jon Kaplan
COMPOSER = Al Kaplan
ALBUMARTIST = Jon Kaplan
ALBUMARTIST = Al Kaplan
TITLE = It's Me!

These tags also fail:

ARTIST = The Police
ALBUMARTIST = Al Kaplan
TITLE = It's Me!
COMPOSER = Jon Kaplan
COMPOSER = Al Kaplan
ALBUMARTIST = Jon Kaplan

...as do these (the sample log at the end is from this set of tags):

ARTIST = The Police
TITLE = It's Me!
COMPOSER = Al Kaplan
ALBUMARTIST = Al Kaplan
COMPOSER = Jon Kaplan

However, the following sets of tags (each set separated by '-----') do not fail:

ARTIST = The Police
ALBUMARTIST = Jon Kaplan
ALBUMARTIST = Al Kaplan
TITLE = It's Me!
COMPOSER = Jon Kaplan
COMPOSER = Al Kaplan
-----
ARTIST = The Police
ALBUMARTIST = Al Kaplan
TITLE = It's Me!
COMPOSER = Jon Kaplan
COMPOSER = Al Kaplan
-----
ARTIST = The Police
TITLE = It's Me!
COMPOSER = Jon Kaplan
COMPOSER = Al Kaplan
ALBUMARTIST = Al Kaplan
-----
ARTIST = The Police
TITLE = It's Me!
COMPOSER = Al Kaplan
ALBUMARTIST = Al Kaplan
-----
ARTIST = The Police
ALBUMARTIST = Jon Kaplan
ALBUMARTIST = Al Kaplan
TITLE = It's Me!


Additionally, other MP3s from the same album (with the same COMPOSER and ALBUMARTIST tags) do not fail.  There are a few other files from other albums which fail with the same SQL error (albeit different values).  I can upload sample files somewhere if that would be helpful.

Is there anything else I should try?  I've try disabling plugins, but to no avail (but is it possible that simply restarting slimserver after changing the plugin settings did not fully disable them?).


Here is a sample log (with d_info, d_import, d_server and d_scan all enabled):

2007-07-14 14:47:08.5191 SlimServer OSDetect init...
2007-07-14 14:47:08.6284 SlimServer OS Specific init...
2007-07-14 14:47:08.6290 SlimServer settings init...
2007-07-14 14:47:08.9280 SlimServer strings init...
2007-07-14 14:47:27.9216 SlimServer Info init...
2007-07-14 14:47:31.6611 Connected to database dbi:mysql:database=slimserver - schema version: [3]
2007-07-14 14:47:43.1979 loading types config file...
2007-07-14 14:47:43.2586 SlimServer changing process priority to 0
2007-07-14 14:47:43.9827 Import: Adding Slim::Music::PlaylistFolderScan Scan
2007-07-14 14:47:44.0032 Import: Adding Slim::Music::MusicFolderScan Scan
2007-07-14 14:47:44.0041 SlimServer done init...
2007-07-14 14:47:44.6533 forceCommit: syncing to the database.
2007-07-14 14:47:44.6568 Import: Wiped all in-memory caches.
2007-07-14 14:47:44.6577 Import: Start schema_clear
2007-07-14 14:47:44.6714 Executing SQL file /usr/share/slimserver/SQL/mysql/schema_clear.sql
2007-07-14 14:47:44.9218 Connected to database dbi:mysql:database=slimserver - schema version: [3]
2007-07-14 14:47:44.9234 Import: Start schema_optimize
2007-07-14 14:47:44.9275 Executing SQL file /usr/share/slimserver/SQL/mysql/schema_optimize.sql
2007-07-14 14:47:47.3859 Import: End schema_optimize
2007-07-14 14:47:47.3881 Import: End schema_clear
2007-07-14 14:47:47.3889 Import: Wiped info database
2007-07-14 14:47:47.3925 Import: Starting Slim::Music::MusicFolderScan scan
2007-07-14 14:47:47.3937 Starting music folder scan in /mnt/disk1/share/Misc/music-test/to-scan
2007-07-14 14:47:47.4132 About to look for files in /mnt/disk1/share/Misc/music-test/to-scan
2007-07-14 14:47:47.4379 For files with extensions in: [(?i-xsm:\.(?:ape|wma|shn|wav|wave|mp3|mp2|flc|flac|m4a|mov|m4b|mp4|mp+|mpc|ogg|aif|aiff|cue)$)]
2007-07-14 14:47:47.5325 Found 1 files in /mnt/disk1/share/Misc/music-test/to-scan
2007-07-14 14:47:47.6875 mp3 file type for file:///mnt/disk1/share/Misc/music-test/to-scan/05%20-%20It's%20Me!.mp3
2007-07-14 14:47:47.6908 ScanDirectory: Adding file:///mnt/disk1/share/Misc/music-test/to-scan/05%20-%20It's%20Me!.mp3 to database.
2007-07-14 14:47:47.6919 
2007-07-14 14:47:47.6928 newTrack(): New Track: [file:///mnt/disk1/share/Misc/music-test/to-scan/05%20-%20It's%20Me!.mp3]
2007-07-14 14:47:47.6936 newTrack(): readTags is 1
2007-07-14 14:47:47.6988 mp3 file type for /mnt/disk1/share/Misc/music-test/to-scan/05 - It's Me!.mp3
2007-07-14 14:47:47.7001 Trying to load Slim::Formats::MP3
2007-07-14 14:47:49.6379 newTrack(): Created track 'It's Me!' (id: [1])
2007-07-14 14:47:49.6446 -- Track is a local track
2007-07-14 14:47:58.2354 -- Created NO GENRE (id: [1])
2007-07-14 14:47:58.2647 -- Track has no genre
2007-07-14 14:47:58.2657 -- Contributor 'The Police' of role 'ARTIST' transformed to role 'TRACKARTIST'
2007-07-14 14:47:59.6117 -- Track has contributor 'Al Kaplan' of role 'ALBUMARTIST'
2007-07-14 14:48:00.4778 ERROR: Error executing 'INSERT INTO contributors (musicbrainz_id, name, namesearch, namesort) VALUES (?, Jon Kaplan, Jon Kaplan, Jon Kaplan)': DBD::mysql::st execute failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Kaplan, Jon Kaplan, Jon Kaplan)' at line 1 at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 773.

2007-07-14 14:48:00.4792 ERROR: Backtrace follows:

2007-07-14 14:48:00.4841 Backtrace:

   frame 0: Slim::Schema::Storage::throw_exception (/usr/share/perl5/DBIx/Class/Storage/DBI.pm line 775)
   frame 1: DBIx::Class::Storage::DBI::_execute (/usr/share/perl5/DBIx/Class/Storage/DBI.pm line 790)
   frame 2: DBIx::Class::Storage::DBI::insert (/usr/share/perl5/DBIx/Class/Row.pm line 78)
   frame 3: DBIx::Class::Row::insert (/usr/share/perl5/DBIx/Class/PK/Auto.pm line 43)
   frame 4: DBIx::Class::PK::Auto::insert (/usr/share/perl5/DBIx/Class/ResultSet.pm line 1371)
   frame 5: DBIx::Class::ResultSet::create (/usr/share/perl5/DBIx/Class/ResultSet.pm line 1417)
   frame 6: DBIx::Class::ResultSet::find_or_create (/usr/share/perl5/Slim/Schema/Contributor.pm line 132)
   frame 7: Slim::Schema::Contributor::add (/usr/share/perl5/Slim/Schema.pm line 2311)
   frame 8: Slim::Schema::_mergeAndCreateContributors (/usr/share/perl5/Slim/Schema.pm line 1835)
   frame 9: Slim::Schema::_postCheckAttributes (/usr/share/perl5/Slim/Schema.pm line 844)
   frame 10: Slim::Schema::newTrack (/usr/share/perl5/Slim/Utils/Scanner.pm line 322)
   frame 11: Slim::Utils::Scanner::scanDirectory (/usr/share/perl5/Slim/Music/MusicFolderScan.pm line 72)
   frame 12: Slim::Music::MusicFolderScan::startScan (/usr/share/perl5/Slim/Music/Import.pm line 422)
   frame 13: Slim::Music::Import::runImporter (/usr/share/perl5/Slim/Music/Import.pm line 265)
   frame 14: Slim::Music::Import::runScan (/usr/sbin/slimserver-scanner line 175)
   frame 15: (eval) (/usr/sbin/slimserver-scanner line 169)
   frame 16: main::main (/usr/sbin/slimserver-scanner line 306)

2007-07-14 14:48:00.5003 ERROR: Scanner: Failed when running main scan: [Carp::Clan::__ANON__(): Error executing 'INSERT INTO contributors (musicbrainz_id, name, namesearch, namesort) VALUES (?, Jon Kaplan, Jon Kaplan, Jon Kaplan)': DBD::mysql::st execute failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Kaplan, Jon Kaplan, Jon Kaplan)' at line 1 at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 773.
]

2007-07-14 14:48:00.5012 ERROR: Scanner: Skipping post-process & Not updating lastRescanTime!

2007-07-14 14:48:00.6392 Got to the END.
2007-07-14 14:48:00.6401 Got sigint.
2007-07-14 14:48:00.6584 SlimServer scanner cleaning up.
2007-07-14 14:48:01.0661 forceCommit: syncing to the database.
Comment 1 Steve Tregidgo 2007-07-14 08:18:56 UTC
Created attachment 2067 [details]
This file crashes the scanner

Note that this file contains more tags than in my bug report; I had managed to remove some of them without making the problem go away.  I've left them as they were to show the difference between this file and the one that works.
Comment 2 Steve Tregidgo 2007-07-14 09:09:31 UTC
Created attachment 2068 [details]
This file does not cause a crash for me
Comment 3 Spies Steven 2007-07-16 13:40:08 UTC
I'll take a look.
Comment 4 Spies Steven 2007-07-16 16:33:14 UTC
I believe that having more then one ALBUMARTIST tag per ALBUM may be the culprit.  I do not think SlimServer supports more then one ALBUMARTIST per ALBUM at this time.  SlimServer should fail gracefully if it encounters more then one ALBUMARTIST tag per ALBUM however.
Comment 5 Steve Tregidgo 2007-07-17 01:30:55 UTC
(In reply to comment #4)
> I believe that having more then one ALBUMARTIST tag per ALBUM may be the
> culprit.  I do not think SlimServer supports more then one ALBUMARTIST per
> ALBUM at this time.  SlimServer should fail gracefully if it encounters more
> then one ALBUMARTIST tag per ALBUM however.
> 

I've tested some Ogg Vorbis files which have multiple ALBUMARTIST tags, and they work fine -- it's been a while since I checked though, so I can't say for sure whether the second tag in each case was available for searching etc.  I've tried scanning one of those albums, and I get no problems.

Having multiple ALBUMARTIST tags is the only way to represent certain metadata (for example, "Ballad Of The Broken Seas" is an album by Isobel Campbell and Mark Lanegan, so they get one ALBUMARTIST tag each).  If it's possible to add support for this (while fixing this problem), that would also be great. :-)

I should also note that this problem began after upgrading SlimServer from 6.5.2 to 6.5.3, so that might be an indication of what changed to make this happen.
Comment 6 Spies Steven 2007-07-17 16:11:10 UTC
I think change 12192 for bug #4694 may have caused this issue.  With further investigation I believe the crash or odd behavior is a result of having more then one ALBUMARTIST tag in a single file in addition to having either an ARTIST, BAND or COMPOSER tag with the same value.  I updated the summary to reflect this.
Comment 7 Steve Tregidgo 2007-07-18 02:36:23 UTC
(In reply to comment #6)
> I think change 12192 for bug #4694 may have caused this issue.  With further
> investigation I believe the crash or odd behavior is a result of having more
> then one ALBUMARTIST tag in a single file in addition to having either an
> ARTIST, BAND or COMPOSER tag with the same value.  I updated the summary to
> reflect this.
> 

Thanks for the update.  Do you know why this fails for some files, while succeeding for other files with almost identical tags?  The two files I uploaded have the same ALBUMARTIST and COMPOSER tags, but only one fails.
Comment 8 Jim McAtee 2007-07-19 20:11:08 UTC
This is looking like a fairly serious bug, with more posts about it in the forums.

http://forums.slimdevices.com/showthread.php?t=36004
http://forums.slimdevices.com/showthread.php?t=36789
http://forums.slimdevices.com/showthread.php?t=36949

Can anyone tell what the actual SQL bug is?  It says it's a syntax error, but that's hard to see because of the placeholder/prepared statement and the lack of single quotes shown in the log.

> 2007-07-14 14:48:00.4778 ERROR: Error executing 'INSERT INTO contributors
>(musicbrainz_id, name, namesearch, namesort) VALUES (?, Jon Kaplan, Jon
> Kaplan, Jon Kaplan)': DBD::mysql::st execute failed: You have an error in
> your SQL syntax; check the manual that corresponds to your MySQL server
> version for the right syntax to use near 'Kaplan, Jon Kaplan, Jon Kaplan)'
> at line 1 at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 773.
Comment 9 Steve Tregidgo 2007-07-20 01:29:59 UTC
Is anyone able to see a relevant difference between the two files I've attached?  Can anyone replicate the behaviour that one file crashes the scanner but the other doesn't?  I've compared the tags in fb2k, and as far as I can see they're the same apart from the title, track number and individual ARTIST tags (but ALBUMARTIST and COMPOSER are the same).  I tagged them both at the same time using fb2k (many months ago; this crash has only started with 6.5.3) so they ought to be the same.

Is there a tool I can use to look at the tags at a lower level than fb2k's interpretation?  To see anything weird that fb2k might have missed?
Comment 10 Erland Isaksson 2007-07-20 03:21:20 UTC
(In reply to comment #9)
> Is anyone able to see a relevant difference between the two files I've
> attached?  Can anyone replicate the behaviour that one file crashes the scanner
> but the other doesn't?  I've compared the tags in fb2k, and as far as I can see
> they're the same apart from the title, track number and individual ARTIST tags
> (but ALBUMARTIST and COMPOSER are the same).  I tagged them both at the same
> time using fb2k (many months ago; this crash has only started with 6.5.3) so
> they ought to be the same.
> 
> Is there a tool I can use to look at the tags at a lower level than fb2k's
> interpretation?  To see anything weird that fb2k might have missed?
> 

They both crash in my setup (on Linux).
I also noted that an INSERT that works seems to be logged like this:
INSERT INTO contributors (musicbrainz_id, name, namesearch, namesort) VALUES (?, ?, ?, ?): 'NULL', 'Al Kaplan', 'AL KAPLAN', 'AL KAPLAN'
And the one that doesn't work is logged like this:
INSERT INTO contributors (musicbrainz_id, name, namesearch, namesort) VALUES (?, Dr Lecter, Dr Lecter, Dr Lecter): 'NULL'

The reason for the syntax error is probably because it says: Dr Lecter 
Instead of: 'Dr Lecter'

I think the crash happens at line 132 in the find_or_create call in Contributor.pm if no one has realised this yet.

Below is the output from id3v2 on Linux for both files.
===========================================================================
id3v2 tag info for /mnt/mp3music_small/special/crash/04 - Quid Pro Quo.mp3:
TRCK (Track number/Position in set): 04
TIT2 (Title/songname/content description): Quid Pro Quo
TPE1 (Lead performer(s)/Soloist(s)): Clarice
TPE1 (Lead performer(s)/Soloist(s)): Dr Lecter
TYER (Year): 2003
COMM (Comments): ()[]: http://www.silencethemusical.com/
TCOM (Composer): Jon Kaplan
TCOM (Composer): Al Kaplan
TCON (Content type): Unknown (255)
TXXX (User defined text information): (ALBUMARTIST): Jon Kaplan
TXXX (User defined text information): (ALBUMARTIST): Al Kaplan
TALB (Album/Movie/Show title): Silence! The Musical
TXXX (User defined text information): (TRACKTOTAL): 9
TXXX (User defined text information): (SOURCEMEDIUM): MP3
TXXX (User defined text information): (SOURCEFORMAT): Album
TXXX (User defined text information): (ALBUMYEAR): 2003
TXXX (User defined text information): (replaygain_track_gain): -3.58 dB
TXXX (User defined text information): (replaygain_track_peak): 0.920881
TXXX (User defined text information): (replaygain_album_gain): -4.36 dB
TXXX (User defined text information): (replaygain_album_peak): 1.083855

id3v2 tag info for /mnt/mp3music_small/special/crash/05 - It's Me!.mp3:
TRCK (Track number/Position in set): 05
TIT2 (Title/songname/content description): It's Me!
TPE1 (Lead performer(s)/Soloist(s)): Dr Lecter
TPE1 (Lead performer(s)/Soloist(s)): The Police
TYER (Year): 2003
COMM (Comments): ()[]: http://www.silencethemusical.com/
TCOM (Composer): Jon Kaplan
TCOM (Composer): Al Kaplan
TCON (Content type): Unknown (255)
TXXX (User defined text information): (ALBUMARTIST): Jon Kaplan
TXXX (User defined text information): (ALBUMARTIST): Al Kaplan
TALB (Album/Movie/Show title): Silence! The Musical
TXXX (User defined text information): (TRACKTOTAL): 9
TXXX (User defined text information): (SOURCEMEDIUM): MP3
TXXX (User defined text information): (SOURCEFORMAT): Album
TXXX (User defined text information): (ALBUMYEAR): 2003
TXXX (User defined text information): (replaygain_track_gain): -2.79 dB
TXXX (User defined text information): (replaygain_track_peak): 0.945196
TXXX (User defined text information): (replaygain_album_gain): -4.36 dB
TXXX (User defined text information): (replaygain_album_peak): 1.083855
========================================================================

The output with --d_sql logging enabled with only the "04" track:
=================================================================
2007-07-20 11:45:59.4275 SELECT me.id, me.name, me.namesort, me.musicmagic_mixable, me.namesearch, me.musicbrainz_id FROM contributors me WHERE ( ( me.namesearch = ? ) ): 'AL KAPLAN'
2007-07-20 11:45:59.4290 INSERT INTO contributors (musicbrainz_id, name, namesearch, namesort) VALUES (?, ?, ?, ?): 'NULL', 'Al Kaplan', 'AL KAPLAN', 'AL KAPLAN'
2007-07-20 11:45:59.4307 SELECT me.role, me.contributor, me.track FROM contributor_track me WHERE ( ( me.contributor = ? AND me.role = ? AND me.track = ? ) OR ( me.contributor = ? AND me.role = ? AND me.track = ? ) ): '49', '5', '87', '49', '5', '87'
2007-07-20 11:45:59.4318 INSERT INTO contributor_track (contributor, role, track) VALUES (?, ?, ?): '49', '5', '87'
2007-07-20 11:45:59.4660 SELECT me.id, me.name, me.namesort, me.musicmagic_mixable, me.namesearch, me.musicbrainz_id FROM contributors me WHERE ( ( me.namesearch = ? ) ): 'JON KAPLAN'
2007-07-20 11:45:59.4680 INSERT INTO contributors (musicbrainz_id, name, namesearch, namesort) VALUES (?, ?, ?, ?): 'NULL', 'Jon Kaplan', 'JON KAPLAN', 'JON KAPLAN'
2007-07-20 11:45:59.5018 SELECT me.role, me.contributor, me.track FROM contributor_track me WHERE ( ( me.contributor = ? AND me.role = ? AND me.track = ? ) OR ( me.contributor = ? AND me.role = ? AND me.track = ? ) ): '50', '2', '87', '50', '2', '87'
2007-07-20 11:45:59.5031 INSERT INTO contributor_track (contributor, role, track) VALUES (?, ?, ?): '50', '2', '87'
2007-07-20 11:45:59.5081 SELECT me.id, me.name, me.namesort, me.musicmagic_mixable, me.namesearch, me.musicbrainz_id FROM contributors me WHERE ( ( ( ( me.namesearch = ? ) ) ) ): 'Al Kaplan'
2007-07-20 11:45:59.5104 SELECT me.role, me.contributor, me.track FROM contributor_track me WHERE ( ( me.contributor = ? AND me.role = ? AND me.track = ? ) OR ( me.contributor = ? AND me.role = ? AND me.track = ? ) ): '49', '2', '87', '49', '2', '87'
2007-07-20 11:45:59.5116 INSERT INTO contributor_track (contributor, role, track) VALUES (?, ?, ?): '49', '2', '87'
2007-07-20 11:45:59.5159 SELECT me.id, me.name, me.namesort, me.musicmagic_mixable, me.namesearch, me.musicbrainz_id FROM contributors me WHERE ( ( me.namesearch = ? ) ): 'CLARICE'
2007-07-20 11:45:59.5201 INSERT INTO contributors (musicbrainz_id, name, namesearch, namesort) VALUES (?, ?, ?, ?): 'NULL', 'Clarice', 'CLARICE', 'CLARICE'
2007-07-20 11:45:59.5226 SELECT me.role, me.contributor, me.track FROM contributor_track me WHERE ( ( me.contributor = ? AND me.role = ? AND me.track = ? ) OR ( me.contributor = ? AND me.role = ? AND me.track = ? ) ): '51', '6', '87', '51', '6', '87'
2007-07-20 11:45:59.5240 INSERT INTO contributor_track (contributor, role, track) VALUES (?, ?, ?): '51', '6', '87'
2007-07-20 11:45:59.5256 SELECT me.id, me.name, me.namesort, me.musicmagic_mixable, me.namesearch, me.musicbrainz_id FROM contributors me WHERE ( ( ( ( me.namesearch = ? ) ) ) ): 'Dr Lecter'
2007-07-20 11:45:59.5602 INSERT INTO contributors (musicbrainz_id, name, namesearch, namesort) VALUES (?, Dr Lecter, Dr Lecter, Dr Lecter): 'NULL'
2007-07-20 11:45:59.5612 ERROR: Error executing 'INSERT INTO contributors (musicbrainz_id, name, namesearch, namesort) VALUES (?, Dr Lecter, Dr Lecter, Dr Lecter)': DBD::mysql::st execute failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Lecter, Dr Lecter, Dr Lecter)' at line 1 at /opt/SlimServer_v6.5.3/CPAN/DBIx/Class/Storage/DBI.pm line 771.
========================================================================

The logging with --d_sql enabled and only the "05" track
========================================================================
2007-07-20 11:54:32.2044 SELECT me.id, me.name, me.namesort, me.musicmagic_mixable, me.namesearch, me.musicbrainz_id FROM contributors me WHERE ( ( me.namesearch = ? ) ): 'AL KAPLAN'
2007-07-20 11:54:32.2063 INSERT INTO contributors (musicbrainz_id, name, namesearch, namesort) VALUES (?, ?, ?, ?): 'NULL', 'Al Kaplan', 'AL KAPLAN', 'AL KAPLAN'
2007-07-20 11:54:32.2081 SELECT me.role, me.contributor, me.track FROM contributor_track me WHERE ( ( me.contributor = ? AND me.role = ? AND me.track = ? ) OR ( me.contributor = ? AND me.role = ? AND me.track = ? ) ): '49', '5', '87', '49', '5', '87'
2007-07-20 11:54:32.2093 INSERT INTO contributor_track (contributor, role, track) VALUES (?, ?, ?): '49', '5', '87'
2007-07-20 11:54:32.2110 SELECT me.id, me.name, me.namesort, me.musicmagic_mixable, me.namesearch, me.musicbrainz_id FROM contributors me WHERE ( ( me.namesearch = ? ) ): 'JON KAPLAN'
2007-07-20 11:54:32.2123 INSERT INTO contributors (musicbrainz_id, name, namesearch, namesort) VALUES (?, ?, ?, ?): 'NULL', 'Jon Kaplan', 'JON KAPLAN', 'JON KAPLAN'
2007-07-20 11:54:32.2143 SELECT me.role, me.contributor, me.track FROM contributor_track me WHERE ( ( me.contributor = ? AND me.role = ? AND me.track = ? ) OR ( me.contributor = ? AND me.role = ? AND me.track = ? ) ): '50', '2', '87', '50', '2', '87'
2007-07-20 11:54:32.2156 INSERT INTO contributor_track (contributor, role, track) VALUES (?, ?, ?): '50', '2', '87'
2007-07-20 11:54:32.2172 SELECT me.id, me.name, me.namesort, me.musicmagic_mixable, me.namesearch, me.musicbrainz_id FROM contributors me WHERE ( ( ( ( me.namesearch = ? ) ) ) ): 'Al Kaplan'
2007-07-20 11:54:32.2191 SELECT me.role, me.contributor, me.track FROM contributor_track me WHERE ( ( me.contributor = ? AND me.role = ? AND me.track = ? ) OR ( me.contributor = ? AND me.role = ? AND me.track = ? ) ): '49', '2', '87', '49', '2', '87'
2007-07-20 11:54:32.2203 INSERT INTO contributor_track (contributor, role, track) VALUES (?, ?, ?): '49', '2', '87'
2007-07-20 11:54:32.2220 SELECT me.id, me.name, me.namesort, me.musicmagic_mixable, me.namesearch, me.musicbrainz_id FROM contributors me WHERE ( ( me.namesearch = ? ) ): 'DR LECTER'
2007-07-20 11:54:32.2267 INSERT INTO contributors (musicbrainz_id, name, namesearch, namesort) VALUES (?, ?, ?, ?): 'NULL', 'Dr Lecter', 'DR LECTER', 'DR LECTER'
2007-07-20 11:54:32.2286 SELECT me.role, me.contributor, me.track FROM contributor_track me WHERE ( ( me.contributor = ? AND me.role = ? AND me.track = ? ) OR ( me.contributor = ? AND me.role = ? AND me.track = ? ) ): '51', '6', '87', '51', '6', '87'
2007-07-20 11:54:32.2303 INSERT INTO contributor_track (contributor, role, track) VALUES (?, ?, ?): '51', '6', '87'
2007-07-20 11:54:32.2322 SELECT me.id, me.name, me.namesort, me.musicmagic_mixable, me.namesearch, me.musicbrainz_id FROM contributors me WHERE ( ( ( ( me.namesearch = ? ) ) ) ): 'The Police'
2007-07-20 11:54:32.2366 INSERT INTO contributors (musicbrainz_id, name, namesearch, namesort) VALUES (?, The Police, The Police, The Police): 'NULL'
2007-07-20 11:54:32.2373 ERROR: Error executing 'INSERT INTO contributors (musicbrainz_id, name, namesearch, namesort) VALUES (?, The Police, The Police, The Police)': DBD::mysql::st execute failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Police, The Police, The Police)' at line 1 at /opt/SlimServer_v6.5.3/CPAN/DBIx/Class/Storage/DBI.pm line 771.
================================================================================

Comment 11 Jim McAtee 2007-07-20 11:21:59 UTC
I took a look at the two attached mp3 files and saw exactly the same thing as Erland.  They both crash the scanner on my system.  I also noticed the same thing about how the SQL call is formed in cases where it crashes vs. those where it doesn't.  So it really is a SQL syntax error.  I looked at some of the code but couldn't tell what is causing a different SQL statement to be executed in these cases.
Comment 12 Adrian Smith 2007-07-20 12:33:45 UTC
Created attachment 2070 [details]
potential patch

I believe this is due to change 12151 to lib/MP3/Info.pm  This creates inconsitent attributes arrays from this file.

Please test the attached patch.  I will also post to bug 3972 for review from the author of that patch.
Comment 13 Justin Fletcher 2007-07-20 13:58:06 UTC
Looks like triode has correctly identified my code as the source of the problem; really, really sorry about that.

I've checked the patch and it looks like it's correct, and I've tested it against my reference MP3s here and it seems to be ok as a regression check as well. I'm happy with the patch.

I've made the change to my local copy of the server so it'll get tested out with a full rescan this evening and all being well should still be ok.
Comment 14 Spies Steven 2007-07-20 14:14:03 UTC
I just tried the patch as well and I am no longer seeing the issues with the attached files.  Thanks Triode!  Steve, you may want to submit a feature request for support of more then one ALBUMARTIST tag in SlimServer.
Comment 15 Adrian Smith 2007-07-20 15:23:40 UTC
Patch applied in change 12406 and 12407 for 6.5 and trunk.  Please test and close.
Comment 16 Justin Fletcher 2007-07-20 15:35:41 UTC
Also, if anyone knows what program is generating the tags, could they please report the fault to the author - they will obviously want to comply to the specification as that gets them the widest range of support. Just about anything can be expected to happen if you do things that are outside the spec. The relevant section is ID3v2.3 specification, section 4.2, second sentance of the first paragraph :

"There may only be one text information frame of its kind in an tag" (sic)

Specifically, the TPE1 frames in ID3v2.3 should have alternate text strings separated by a '/' character. As noted in section 4.2.1, subsection 'TPE1'.

If it's reported to the author then at least we've tried to get things done properly by them, despite SlimServer having to work around their broken code.
Comment 17 Steve Tregidgo 2007-07-23 02:55:17 UTC
I've installed nightly build from the weekend and my scanner no longer crashes: thanks all!  Very pleased to have my library back. :-)

(In reply to comment #16)
> Also, if anyone knows what program is generating the tags, could they please
> report the fault to the author - they will obviously want to comply to the
> specification as that gets them the widest range of support. Just about
> anything can be expected to happen if you do things that are outside the spec.
> The relevant section is ID3v2.3 specification, section 4.2, second sentance of
> the first paragraph :
> 
> "There may only be one text information frame of its kind in an tag" (sic)
> 
> Specifically, the TPE1 frames in ID3v2.3 should have alternate text strings
> separated by a '/' character. As noted in section 4.2.1, subsection 'TPE1'.
> 
> If it's reported to the author then at least we've tried to get things done
> properly by them, despite SlimServer having to work around their broken code.

I tagged my files with foobar2000 version 0.8.3.  New versions have been released since I last upgraded, so I'll upgrade again and see how it behaves now.  fb2k's tag editor allows one to enter multiple instances of any given tag (presumably because the editor itself is format-agnostic, and this would be legal in Ogg Vorbis and others).  I suppose, at least in the version I've been using, that it didn't always convert the tags into a legal structure for the file's actual format.
Comment 18 Chris Owens 2007-09-18 12:38:38 UTC
The comments are a tough read but it looks like this should be closed.  Any objections?