Bug 4823 - Disc number higher then 255 may crash the scanner
: Disc number higher then 255 may crash the scanner
Status: CLOSED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: Scanner
: 6.5.2
: PC Windows XP
: P2 normal (vote)
: ---
Assigned To: Dan Sully
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-03-10 07:52 UTC by Philip Meyer
Modified: 2008-12-18 11:12 UTC (History)
3 users (show)

See Also:
Category: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philip Meyer 2007-03-10 07:52:17 UTC
I have an mp3 file that has a disc number of 294.  This causes the error below during a full scan.
Note that extra debug flags need to be turned on and a full rescan reperformed in order to find the faulty file.

I suggest that the scanner should log a warning and continue (report the file that has a problem),
rather than crashing and not doing the final post-process stage.

Even better would be to ignore fields that don't conform to database type ranges (i.e. it has detected that disc was out of range, so try to store the record again with null instead).


2007-03-10 15:37:28.1776 newTrack(): New Track: [file:///M:/Music/Podcast%20Enclosures/Coverville_[id_1391]/Coverville-070215.mp3]
2007-03-10 15:37:28.1777 newTrack(): readTags is 1
2007-03-10 15:37:28.1784 mp3 file type for M:\Music\Podcast Enclosures\Coverville_[id_1391]\Coverville-070215.mp3
2007-03-10 15:37:28.2789 ERROR: Error executing 'INSERT INTO tracks (audio, audio_offset, audio_size, bitrate, block_alignment, bpm, content_type, disc, drm, filesize, lossless, rating, remote, replay_gain, samplerate, secs, tagversion, timestamp, title, titlesearch, titlesort, tracknum, url, year) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)': DBD::mysql::st execute failed: Out of range value adjusted for column 'disc' at row 1 at P:\Music\SlimServer\trunk\server\CPAN/DBIx/Class/Storage/DBI.pm line 771.

2007-03-10 15:37:28.2791 ERROR: Backtrace follows:

2007-03-10 15:37:28.2793 Backtrace:

   frame 0: Slim::Schema::Storage::throw_exception (P:\Music\SlimServer\trunk\server\CPAN/DBIx/Class/Storage/DBI.pm line 773)
   frame 1: DBIx::Class::Storage::DBI::_execute (P:\Music\SlimServer\trunk\server\CPAN/DBIx/Class/Storage/DBI.pm line 788)
   frame 2: DBIx::Class::Storage::DBI::insert (P:\Music\SlimServer\trunk\server\CPAN/DBIx/Class/Row.pm line 75)
   frame 3: DBIx::Class::Row::insert (P:\Music\SlimServer\trunk\server\CPAN/DBIx/Class/PK/Auto.pm line 43)
   frame 4: DBIx::Class::PK::Auto::insert (P:\Music\SlimServer\trunk\server\CPAN/DBIx/Class/ResultSet.pm line 1335)
   frame 5: DBIx::Class::ResultSet::create (P:\Music\SlimServer\trunk\server/Slim/Schema.pm line 831)
   frame 6: Slim::Schema::newTrack (P:\Music\SlimServer\trunk\server/Slim/Utils/Scanner.pm line 322)
   frame 7: Slim::Utils::Scanner::scanDirectory (P:\Music\SlimServer\trunk\server/Slim/Music/MusicFolderScan.pm line 72)
   frame 8: Slim::Music::MusicFolderScan::startScan (P:/Music/SlimServer/trunk/server/Slim/Music/Import.pm line 422)
   frame 9: Slim::Music::Import::runImporter (P:/Music/SlimServer/trunk/server/Slim/Music/Import.pm line 265)
   frame 10: Slim::Music::Import::runScan (P:/Music/SlimServer/trunk/server/scanner.pl line 180)
   frame 11: (eval) (P:/Music/SlimServer/trunk/server/scanner.pl line 174)
   frame 12: main::main (P:/Music/SlimServer/trunk/server/scanner.pl line 312)

2007-03-10 15:37:28.2857 ERROR: Scanner: Failed when running main scan: [Carp::Clan::__ANON__(): Error executing 'INSERT INTO tracks (audio, audio_offset, audio_size, bitrate, block_alignment, bpm, content_type, disc, drm, filesize, lossless, rating, remote, replay_gain, samplerate, secs, tagversion, timestamp, title, titlesearch, titlesort, tracknum, url, year) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)': DBD::mysql::st execute failed: Out of range value adjusted for column 'disc' at row 1 at P:\Music\SlimServer\trunk\server\CPAN/DBIx/Class/Storage/DBI.pm line 771.
]

2007-03-10 15:37:28.2859 ERROR: Scanner: Skipping post-process & Not updating lastRescanTime!
Comment 1 Spies Steven 2007-03-12 15:44:28 UTC
Philip, I have not been able to reproduce this. I am not sure if it makes a difference, but are you running SlimServer with ActivePerl perhaps? I will try again with ActivePerl myself.
Comment 2 Philip Meyer 2007-03-12 16:13:21 UTC
Yes, Windows XP Pro, running ActiveState Perl 5.8.8.820.
I use my own MySQL instance.  mysql-5.0.37.
Comment 3 Ross Levine 2007-03-12 17:51:06 UTC
Tested against 7.0a1 TRUNK (active perl) sure enough it seems disc number is limited to 255, however I'm not getting any error message, it simply assigns the disc number as 255 and ignores the disc number of 294. 
Comment 4 Philip Meyer 2007-03-12 19:19:43 UTC
I haven't tried 7.0.  With 6.5.2 I had to track down the file that caused the problem and fix the tag before I could perform a full scan.
Comment 5 Spies Steven 2007-03-13 10:43:34 UTC
I see the 255 disc limit with as well, but I do not get a crash. We may want to change the bug summary to reflect this. It may be the ActiveState Perl 5.8.8.820 and mysql 5.0.37 combined with 6.5.2 that produces the crash.
Comment 6 Spies Steven 2007-03-13 13:32:55 UTC
Dan, can this apparent 255 disc number limit be raised easily or is it more involved? I suspect if the limit is raised it would eliminate the crash that Philip observes.
Comment 7 Dan Sully 2007-03-13 13:36:29 UTC
The schema defines disc & discc as 'tinyint' which have a 255 limit.

There is no realistic reason to raise this limit, as there are no disc sets that go that high.

We can catch that boundary error in the software however and ignore it.
Comment 8 Philip Meyer 2007-03-13 14:03:01 UTC
Not sure what the ID3 standard allows as a maximum - Slimserver should support whatever the standard supports.  But I agree that tinyint should be big enough for most people!

It's the error handling that needs to be tweaked, for the case when a tag hasn't got a sensible value in it.
Comment 9 Dan Sully 2007-03-13 14:34:39 UTC
Fixed in change 11634
Comment 10 Chris Owens 2008-03-07 09:04:09 UTC
This bug is being closed since it was resolved for a version which is now released!  Please download the new version of SqueezeCenter (formerly SlimServer) at http://www.slimdevices.com/su_downloads.html

If you are still seeing this bug, please re-open it and we will consider it for a future release.