Bugzilla – Bug 4454
Data too long for column 'musicbrainz_id'
Last modified: 2007-10-23 10:48:34 UTC
Scanner bombs during scan: 2006-11-01 08:12:22.7947 ERROR: Error executing 'INSERT INTO tracks (audio, audio_offset, audio_size, bitrate, block_alignment, content_type, drm, filesize, lossless, musicbrainz_id, rating, remote, samplerate, secs, tagversion, timestamp, title, titlesearch, titlesort, tracknum, url, year) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)': DBD::mysql::st execute failed: Data too long for column 'musicbrainz_id' at row 1 at C:\Program Files\SlimServer\server\CPAN/DBIx/Class/Storage/DBI.pm line 771. 2006-11-01 08:12:22.7953 ERROR: Backtrace follows: 2006-11-01 08:12:22.7958 Backtrace: frame 0: Slim::Schema::Storage::throw_exception (C:\Program Files\SlimServer\server\CPAN/DBIx/Class/Storage/DBI.pm line 773) frame 1: DBIx::Class::Storage::DBI::_execute (C:\Program Files\SlimServer\server\CPAN/DBIx/Class/Storage/DBI.pm line 788) frame 2: DBIx::Class::Storage::DBI::insert (C:\Program Files\SlimServer\server\CPAN/DBIx/Class/Row.pm line 75) frame 3: DBIx::Class::Row::insert (C:\Program Files\SlimServer\server\CPAN/DBIx/Class/PK/Auto.pm line 43) frame 4: DBIx::Class::PK::Auto::insert (C:\Program Files\SlimServer\server\CPAN/DBIx/Class/ResultSet.pm line 1335) frame 5: DBIx::Class::ResultSet::create (/PerlApp/Slim/Schema.pm line 794) frame 6: Slim::Schema::newTrack (/PerlApp/Slim/Schema.pm line 955) frame 7: Slim::Schema::updateOrCreate (/PerlApp/Slim/Utils/Scanner.pm line 322) frame 8: Slim::Utils::Scanner::scanDirectory (/PerlApp/Slim/Utils/Scanner.pm line 90) frame 9: Slim::Utils::Scanner::scanPathOrURL (scanner.pl line 168) frame 10: (eval) (scanner.pl line 168) frame 11: main::main (scanner.pl line 312) 2006-11-01 08:12:22.8083 ERROR: Scanner: Failed when running main scan: [Carp::Clan::__ANON__(): Error executing 'INSERT INTO tracks (audio, audio_offset, audio_size, bitrate, block_alignment, content_type, drm, filesize, lossless, musicbrainz_id, rating, remote, samplerate, secs, tagversion, timestamp, title, titlesearch, titlesort, tracknum, url, year) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)': DBD::mysql::st execute failed: Data too long for column 'musicbrainz_id' at row 1 at C:\Program Files\SlimServer\server\CPAN/DBIx/Class/Storage/DBI.pm line 771. ] 2006-11-01 08:12:22.8090 ERROR: Scanner: Skipping post-process & Not updating lastRescanTime!
MB ID's are UUIDs and look like this: 8f1f19b1-d974-4c26-bca6-5debd5c847f7 so they should always be 36 chars long. The database columns for these are actually 40 chars long. You may have a bogus value in one of your files.
If that's the case, scanner should handle it gracefully. Rule #1. Never trust the data. Anyhow, < half of my collection is showing up. Maybe this single file is the culprit, maybe not.
Agreed, it should. Dan: Should we check the length of all tag data before putting it in the database?
For items that have a max size, such as varchar, yes we should.
Subject: Re: Data too long for column 'musicbrainz_id' is this a dbi issue? shouldn't the insert just return a error/false rather than crash? then up to scanner/server to check the return value? ----- Original Message ---- From: Slim Devices Bugzilla <bugs@bugs.slimdevices.com> To: bkfake-slim2@yahoo.com Sent: Wednesday, November 1, 2006 10:12:40 AM Subject: [Bug 4454] Data too long for column 'musicbrainz_id' https://bugs-archive.lyrion.org/show_bug.cgi?id=4454 ------- Comment #4 from dan@slimdevices.com 2006-11-01 08:12 ------- For items that have a max size, such as varchar, yes we should. ------- You are receiving this mail because: ------- You reported the bug, or are watching the reporter. <html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">is this a dbi issue?<br>shouldn't the insert just return a error/false rather than crash?<br>then up to scanner/server to check the return value?<br><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">----- Original Message ----<br>From: Slim Devices Bugzilla <bugs@bugs.slimdevices.com><br>To: bkfake-slim2@yahoo.com<br>Sent: Wednesday, November 1, 2006 10:12:40 AM<br>Subject: [Bug 4454] Data too long for column 'musicbrainz_id'<br><br><div><a target="_blank" href="https://bugs-archive.lyrion.org/show_bug.cgi?id=4454">https://bugs-archive.lyrion.org/show_bug.cgi?id=4454</a><br><br><br><br><br><br>------- Comment #4 from dan@slimdevices.com 2006-11-01 08:12 -------<br>For items that have a max size, such as varchar, yes we should.<br><br><br><br><br>------- You are receiving this mail because: -------<br>You reported the bug, or are watching the reporter.<br></div></div><br></div></div></body></html>
Andy, are you looking at this bug? Shall I assign it to you?
If someone can attach a file that triggers this bug, I'll look at it. Otherwise it's not a high priority, as anything in a musicbrainz_id tag should be the correct length.