Bug 9434 - Scanner fails to add any tracks to database
: Scanner fails to add any tracks to database
Status: CLOSED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: Scanner
: 7.2
: PC Debian Linux
: P1 major with 1 vote (vote)
: 7.x
Assigned To: Andy Grundman
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-09-07 14:02 UTC by Max Spicer
Modified: 2009-07-31 10:29 UTC (History)
12 users (show)

See Also:
Category: ---


Attachments
Log file from scanner showing the error (17.05 KB, text/plain)
2008-09-07 14:02 UTC, Max Spicer
Details
Scanner log with error results while trying to do a rescan (5.53 KB, text/plain)
2008-09-27 12:32 UTC, Mike Richichi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Max Spicer 2008-09-07 14:02:33 UTC
Created attachment 3953 [details]
Log file from scanner showing the error

On the 7.2 trunk, the scanner crashes with database errors whenever it runs, with the end result that it fails to add any tracks to the database.  See attachment for details - line 129 first shows the null id value.

The problem is when a new track is created via Slim::Schema->resultset, the resultant Row object does not get the id column value filled in.  All subsequent scanner operations that operate on the track and require the id therefore fail.  See Slim/Schema.pm:931 and onwards.

This problem does not occur in the 7.2 release, but does in the latest 7.2 trunk.  The problem appears to be within the bundled CPAN modules, as switching just the CPAN directory back to the 7.2 tag fixes it.  I haven't been able to work out which module is responsible.
Comment 1 KDF 2008-09-08 13:13:42 UTC
Only updates in 7.2 CPAN recently appear to be Log4Perl (change 22935) and Class::C3 (change 22991)
Comment 2 Andy Grundman 2008-09-08 17:23:18 UTC
Are you able to reproduce this every time, or only some of the time?

The only thing that changed recently related to this was Class::C3 and Class::C3::XS.  Try renaming the CPAN/Class/C3/XS.pm file so it won't be able to load, and see if you can still reproduce.
Comment 3 Max Spicer 2008-09-09 01:02:15 UTC
It happens every time.  Removing just CPAN/Class/C3/XS.pm has no effect.

As the changes since the 7.2 tag added the whole CPAN/Class/C3 directory and modified CPAN/Class/C3.pm, I removed the new C3 directory and restored C3.pm to its 7.2 tag state.  This cures the problem.

Why is this bug's version now 7.2-new-streaming, by the way?
Comment 4 Alan Young 2008-09-09 08:43:43 UTC
*** Bug 9442 has been marked as a duplicate of this bug. ***
Comment 5 KDF 2008-09-09 11:16:17 UTC
bug 9442 was marked a dupe of this, but it seems from the log that bug 9424 is almost exactly like bug 9442 (content_type reference at Schema.pm line 1155).

This bug is something different. If the specific CPAN changes noted don't directly match up, it could have been coincidence that the whole CPAN copy seemed to fix it.  Perhaps revert through svn and see if you can narrow down a block of changes that may be at fault.
Comment 6 Max Spicer 2008-09-09 11:31:12 UTC
It's just the changes that were made to C3 since 7.2 was released.
Comment 7 Chris Owens 2008-09-10 16:22:31 UTC
Andy suggests that you're the right person to look at this, Brandon.
Comment 8 James Richardson 2008-09-10 16:22:31 UTC
*** Bug 9424 has been marked as a duplicate of this bug. ***
Comment 9 Andy Grundman 2008-09-16 14:17:09 UTC
*** Bug 9504 has been marked as a duplicate of this bug. ***
Comment 10 Gordon Harris 2008-09-16 14:58:39 UTC
Is this a problem that C3 is having with Perl 5.10?  I'm not seeing this with Perl 5.8.8.
Comment 11 Alan Young 2008-09-16 23:27:30 UTC
I am reasonably sure, but not certain, that I have also hit this with perl 5.8.8. The only place that I can reproduce it consistently, however, is with perl 5.10.
Comment 12 Max Spicer 2008-09-17 08:19:46 UTC
I'm running 5.10.
Comment 13 sasu.tikkanen@gmail.com 2008-09-17 09:34:29 UTC
I'm running Perl 5.8.8 and could reproduce the bug 9424 (which was merged to this bug) consistently. However, now that I removed all playlist files and reorganised the music files, the bug does not occur anymore.
Comment 14 Gordon Harris 2008-09-17 10:00:39 UTC
With my systems with the latest svn:

Perl 5.10  : can't scan ever, no matter what content is in the music library.  Even with no playlists and only a couple of super-easy-to-digest flac files, nothing gets scanned at all.

Perl 5.8.8 : never has a problem scanning.  The C3 code isn't a problem.  Is this because the offending section of code is 5.10 only and so doesn't get called?


Comment 15 Thomas Stewart 2008-09-20 07:49:13 UTC
I'm running squeezecenter 7.2.1~23223 and seem to be getting similar errors in /var/log/squeezecenter/scanner.log:

[08-09-20 15:36:03.7645] Slim::Schema::newTrack (939) Warning: Use of uninitialized value in sprintf at /usr/share/perl5/Slim/Schema.pm line 940.
[08-09-20 15:36:03.7930] Slim::Schema::Storage::throw_exception (70) Error: Error executing 'INSERT INTO genre_track (genre, track) VALUES (?, ?)': DBD::mysql::st execute failed: Column 'track' cannot be null at /usr/share/squeezecenter/CPAN/DBIx/Class/Storage/DBI.pm line 771.
[08-09-20 15:36:03.7939] Slim::Schema::Storage::throw_exception (70) Backtrace:

   frame 0: Slim::Utils::Log::logBacktrace (/usr/share/perl5/Slim/Schema/Storage.pm line 70)
   frame 1: Slim::Schema::Storage::throw_exception (/usr/share/squeezecenter/CPAN/DBIx/Class/Storage/DBI.pm line 773)
   frame 2: DBIx::Class::Storage::DBI::_execute (/usr/share/squeezecenter/CPAN/DBIx/Class/Storage/DBI.pm line 788)
   frame 3: DBIx::Class::Storage::DBI::insert (/usr/share/squeezecenter/CPAN/DBIx/Class/Row.pm line 75)
   frame 4: DBIx::Class::Row::insert (/usr/share/squeezecenter/CPAN/DBIx/Class/ResultSet.pm line 1335)
<SNIP?

-- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (400, 'testing'), (300, 'unstable')
Architecture: i386 (i686)

Kernel: Linux 2.6.26-1-686 (SMP w/2 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages squeezecenter depends on:
ii  adduser                      3.110       add and remove users and groups
ii  flac                         1.2.1-1.2   Free Lossless Audio Codec - comman
ii  libmysqlclient15-dev         5.0.51a-12  MySQL database development files
ii  mysql-client-5.0             5.0.51a-12  MySQL database client binaries
ii  mysql-server-5.0             5.0.51a-12  MySQL database server binaries
ii  perl                         5.10.0-13   Larry Wall's Practical Extraction
ii  sox                          14.0.1-2+b1 Swiss army knife of sound processi
Comment 16 Mike Richichi 2008-09-27 12:32:17 UTC
Created attachment 4077 [details]
Scanner log with error results while trying to do a rescan
Comment 17 Mike Richichi 2008-09-27 12:34:53 UTC
This is also a bug in the 7.3 trunk.  Occurs during rescans or Browse Music Folder (which makes that process unpredictable as well.)
Comment 18 Nick Orlov 2008-10-01 18:39:07 UTC
I can confirm getting rid of Class/C3/ and reverting
Class/C3.pm to the one from r22982 fixes it for me.

Not sure if it helps though...




Comment 19 Thomas Stewart 2008-10-04 15:25:57 UTC
For anyone else experiencing this and wants a quick fix to get working, installing squeezecenter in an etch chroot with debootstrap worked for me.
Comment 20 Gordon Harris 2008-10-05 06:24:47 UTC
Thomas: which version of perl do you have there?
Comment 21 Thomas Stewart 2008-10-05 06:53:40 UTC
The main system is running Debian lenny, so is perl 5.10.0-14 and does not work.
The working chroot is running Debian etch, so is perl 5.8.8-7etch3.
Comment 22 Chris Owens 2008-10-06 09:19:57 UTC
Andy to revert the change
Comment 23 Andy Grundman 2008-10-07 12:03:28 UTC
Fixed in 7.2.1 change 23442, reverted Class::C3 to previous version.
Comment 24 Keith Briscoe 2008-10-07 14:26:30 UTC
Is this being reverted on the 7.3 trunk as well?
Comment 25 Andy Grundman 2008-10-07 14:32:26 UTC
Yes, it was already merged.
Comment 26 Chris Owens 2008-10-13 09:45:30 UTC
*** Bug 9658 has been marked as a duplicate of this bug. ***
Comment 27 James Richardson 2008-12-15 12:07:27 UTC
This bug has been fixed in the 7.3.0 release version of SqueezeCenter!

Please download the new version from http://www.slimdevices.com/su_downloads.html if you haven't already.  

If you are still experiencing this problem, feel free to reopen the bug with your new comments and we'll have another look.
Comment 28 Chris Owens 2009-07-31 10:29:36 UTC
Reduce number of active targets for SC