Bug 6900 - comma in mysql insert command, in db tracks, in fields replay_gain & replay_peak
: comma in mysql insert command, in db tracks, in fields replay_gain & replay_peak
Status: CLOSED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: Scanner
: 7.0
: PC Windows (legacy)
: P2 normal (vote)
: ---
Assigned To: Andy Grundman
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-02-01 06:32 UTC by Rudy
Modified: 2009-09-08 09:30 UTC (History)
0 users

See Also:
Category: ---


Attachments
file with gain problem (1.18 MB, application/octet-stream)
2008-02-01 12:25 UTC, Rudy
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rudy 2008-02-01 06:32:23 UTC
Windows 2000 server, English, locale nl-NL, running mysql 5.0.27
The scanner is trying to insert '-0,160000' & '0,610275' in de float fields `replay_gain` & `replay_peak`
Wrong float->string conversion?
Uppon this error the scanner will crash and failing to find the rest of the tracks.
It can be done right because the `secs` fields in the same insert is good!

[08-02-01 14:12:59.6315] Slim::Schema::Debug::query_start (26) SELECT me.id FROM years me WHERE ( ( me.id = ? ) ): '2005'
[08-02-01 14:12:59.6379] Slim::Utils::Scanner::scanDirectory (308) Adding file:///H:/Muziek/Albums_sept%202004/Yuki%20Kajiura%20-%202003%20-%20Fiction/14%20-%20Echo.mp3 to database.
[08-02-01 14:12:59.6424] Slim::Schema::Debug::query_start (26) SELECT me.id, me.url, me.content_type, me.title, me.titlesort, me.titlesearch, me.album, me.tracknum, me.timestamp, me.filesize, me.disc, me.remote, me.audio, me.audio_size, me.audio_offset, me.year, me.secs, me.cover, me.vbr_scale, me.bitrate, me.samplerate, me.samplesize, me.channels, me.block_alignment, me.endian, me.bpm, me.tagversion, me.drm, me.musicmagic_mixable, me.musicbrainz_id, me.playcount, me.lastplayed, me.lossless, me.lyrics, me.rating, me.replay_gain, me.replay_peak FROM tracks me WHERE ( url = ? ): 'file:///H:/Muziek/Albums_sept%202004/Yuki%20Kajiura%20-%202003%20-%20Fiction/14%20-%20Echo.mp3'
[08-02-01 14:12:59.6906] Slim::Schema::Debug::query_start (26) INSERT INTO tracks (audio, audio_offset, audio_size, bitrate, block_alignment, content_type, drm, filesize, lossless, rating, remote, replay_gain, replay_peak, samplerate, secs, tagversion, timestamp, title, titlesearch, titlesort, tracknum, url, vbr_scale, year) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?): '1', '1777', '1236772', '217000', '1', 'mp3', '0', '1239040', '0', '0', '0', '-0,160000', '0,610275', '44100', '45.5314285714286', 'APEv2', '1060696780', 'echo', 'ECHO', 'ECHO', '14', 'file:///H:/Muziek/Albums_sept%202004/Yuki%20Kajiura%20-%202003%20-%20Fiction/14%20-%20Echo.mp3', '78', '2003'
[08-02-01 14:12:59.6943] Slim::Schema::Storage::throw_exception (67) Error: Error executing 'INSERT INTO tracks (audio, audio_offset, audio_size, bitrate, block_alignment, content_type, drm, filesize, lossless, rating, remote, replay_gain, replay_peak, samplerate, secs, tagversion, timestamp, title, titlesearch, titlesort, tracknum, url, vbr_scale, year) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)': DBD::mysql::st execute failed: Data truncated for column 'replay_gain' at row 1 at C:\PROGRA~1\SQUEEZ~1\server\CPAN/DBIx/Class/Storage/DBI.pm line 771.
[08-02-01 14:12:59.6960] Slim::Schema::Storage::throw_exception (67) Backtrace:

   frame 0: Slim::Utils::Log::logBacktrace (C:/PROGRA~1/SQUEEZ~1/server/Slim/Schema/Storage.pm line 67)
   frame 1: Slim::Schema::Storage::throw_exception (C:\PROGRA~1\SQUEEZ~1\server\CPAN/DBIx/Class/Storage/DBI.pm line 773)
   frame 2: DBIx::Class::Storage::DBI::_execute (C:\PROGRA~1\SQUEEZ~1\server\CPAN/DBIx/Class/Storage/DBI.pm line 788)
   frame 3: DBIx::Class::Storage::DBI::insert (C:\PROGRA~1\SQUEEZ~1\server\CPAN/DBIx/Class/Row.pm line 75)
   frame 4: DBIx::Class::Row::insert (C:\PROGRA~1\SQUEEZ~1\server\CPAN/DBIx/Class/PK/Auto.pm line 43)
   frame 5: DBIx::Class::PK::Auto::insert (C:\PROGRA~1\SQUEEZ~1\server\CPAN/DBIx/Class/ResultSet.pm line 1335)
   frame 6: DBIx::Class::ResultSet::create (/<C:\PROGRA~1\SQUEEZ~1\server\scanner.exe>Slim/Schema.pm line 863)
   frame 7: Slim::Schema::newTrack (/<C:\PROGRA~1\SQUEEZ~1\server\scanner.exe>Slim/Schema.pm line 1027)
   frame 8: Slim::Schema::updateOrCreate (/<C:\PROGRA~1\SQUEEZ~1\server\scanner.exe>Slim/Utils/Scanner.pm line 310)
   frame 9: Slim::Utils::Scanner::scanDirectory (/<C:\PROGRA~1\SQUEEZ~1\server\scanner.exe>Slim/Music/MusicFolderScan.pm line 79)
   frame 10: Slim::Music::MusicFolderScan::startScan (/<C:\PROGRA~1\SQUEEZ~1\server\scanner.exe>Slim/Music/Import.pm line 463)
   frame 11: Slim::Music::Import::runImporter (/<C:\PROGRA~1\SQUEEZ~1\server\scanner.exe>Slim/Music/Import.pm line 310)
   frame 12: Slim::Music::Import::runScan (scanner.pl line 204)
   frame 13: (eval) (scanner.pl line 198)
   frame 14: main::main (scanner.pl line 345)

[08-02-01 14:12:59.7023] main::main (210) Error: 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, rating, remote, replay_gain, replay_peak, samplerate, secs, tagversion, timestamp, title, titlesearch, titlesort, tracknum, url, vbr_scale, year) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)': DBD::mysql::st execute failed: Data truncated for column 'replay_gain' at row 1 at C:\PROGRA~1\SQUEEZ~1\server\CPAN/DBIx/Class/Storage/DBI.pm line 771.
]
Comment 1 Blackketter Dean 2008-02-01 11:01:43 UTC
Andy: is this for 7.0?
Comment 2 Andy Grundman 2008-02-01 11:07:55 UTC
Hmm, what values are stored in the affected file?  Do they have commas?
Comment 3 Rudy 2008-02-01 12:25:12 UTC
Created attachment 2796 [details]
file with gain problem

This is the file, according to winamp there is no gain info.
btw scanner is the 7.0 version from 31-01-2008
Comment 4 Andy Grundman 2008-02-01 12:45:36 UTC
Here's the metadata for this file:

 ALBUM => "Fiction",
  ARTIST => "Yuki Kajiura",
  BITRATE => 217_000,
  BLOCKALIGN => 1,
  COMMENT => ["Ripped by r09 [20030809]"],
  COPYRIGHT => 0,
  FRAMES => 1743,
  FRAME_LENGTH => 709,
  FREQUENCY => "44.1",
  GENRE => "Pop",
  LAME => { encoder_version => "LAME3.90.", end_padding => 2280, start_delay => 576 },
  LAYER => 3,
  MM => 0,
  MODE => 1,
  MS => "531.42857142857",
  OFFSET => 1777,
  PADDING => 0,
  RATE => 44_100,
  "REPLAYGAIN_ALBUM_GAIN" => "-8,190000 dB",
  "REPLAYGAIN_ALBUM_PEAK" => "1,132240",
  "REPLAYGAIN_TRACK_GAIN" => "-0,160000 dB",
  "REPLAYGAIN_TRACK_PEAK" => "0,610275",
  SECS => "45.5314285714286",
  SIZE => 1_236_772,
  SS => 45,
  STEREO => 1,
  TAGVERSION => "APEv2",
  TIME => "00:45",
  TITLE => "echo",
  TRACK => 14,
  TRACKNUM => 14,
  VBR => 1,
  VBR_SCALE => 78,
  VERSION => 1,
  YEAR => 2003,

Looks like the gain tags were entered using a locale where commas are used as decimal points.  These fields should be floats in your tags.  However, this file is scanned OK on my system, there are no db errors.  The gain fields just get set to:

replay_gain: -0
replay_peak: 0

So the question is, do we handle this in the server by replacing a comma with a decimal point, or should you fix your tags?
Comment 5 Andy Grundman 2008-02-01 12:47:07 UTC
Missed one bit of info, the album gain values in the db get set to:

replay_gain: -8
replay_peak: 1
Comment 6 Blackketter Dean 2008-02-01 13:06:42 UTC
Andy:  is this a 7.0 bug?
Comment 7 Blackketter Dean 2008-02-01 17:36:05 UTC
Ping Andy
Comment 8 Andy Grundman 2008-02-02 08:08:48 UTC
Up to you, should we fix it or should he fix his bad tags?
Comment 9 Blackketter Dean 2008-02-02 08:11:02 UTC
I think so.  A simple regex on the replay gain tag would solve it, no?

If it just ignored the tags, I'd say we punt, but since it's a crasher...
Comment 10 Andy Grundman 2008-02-02 08:26:09 UTC
It's not a crasher, but I will fix.
Comment 11 Andy Grundman 2008-02-03 06:03:28 UTC
Fixed in change 17131.
Comment 12 Chris Owens 2008-03-07 09:03:31 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.