Bug 3560 - Clear and rescan broken
: Clear and rescan broken
Status: RESOLVED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: Scanner
: 6.5b1
: PC Debian Linux
: P2 major (vote)
: ---
Assigned To: Dan Sully
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2006-06-15 01:53 UTC by Keith Jolley
Modified: 2008-09-15 14:39 UTC (History)
4 users (show)

See Also:
Category: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Keith Jolley 2006-06-15 01:53:36 UTC
Latest nightly (2006-06-15) installed from apt respository

Clear library and rescan everything results in the following entry in slimserver.log:

2006-06-15 09:48:24.8371 About to look for files in /usr/sbin/scanner.pl
Use of uninitialized value in subroutine entry at /usr/share/perl5/Slim/Utils/Scanner.pm line 104.
2006-06-15 09:48:24.8430 ERROR: scanner - while running txn_commit: [Can't use string ("") as a subroutine ref while "strict refs" in use at /usr/share/perl5/Slim/Utils/Scanner.pm line 104.

Web interface then reports "0 albums with 0 songs by 0 artists."
Comment 1 Keith Jolley 2006-06-15 05:43:09 UTC
Running the scanner manually with

sudo /usr/sbin/scanner --wipe

seems to work ok.  The problem occurs when rescanning from the web interface.
Comment 2 KDF 2006-06-15 08:58:02 UTC
same error line as in 3494, probably exact same underlying issue.
Comment 3 snarlydwarf 2006-06-17 11:11:40 UTC
Not quite the same message: for some reason the debian version isn't finding the library path, but is scanning scanner.pl...  which doesn't have any files of course.

It should be: About to look for files in /path/to/music
not scanner.pl.

Oddly, slimserver-scanner is finding the prefs just fine by itself, since it does work from the command line, so without looking, I suspect the invocation of the scanner changed and broke it.
Comment 4 KDF 2006-06-18 01:31:15 UTC
I'm referring to the lines given in the last line of the logs.  The number is different, but they are the same line of code, having moved over a few days of changes.  I see this too on some startups, restarting then seems to go ok.  Running the scanner manually seems to work so it's hard to track down at my end.  Debug is a bit hard when running the launched process as there seems to be no way to get those messages to come back to the console.  Maybe a logfile option for splitscanner that copies the logfile pref for the main server as it does for prefsfile. 
Comment 5 Dan Sully 2006-06-18 13:20:20 UTC
Fixed in change 8046
Comment 6 Keith Jolley 2006-06-19 03:33:25 UTC
Thanks Dan, but the problem still persists.  The log now reads:

2006-06-19 11:21:36.0903 scanPathOrURL: Finding valid files in: /usr/sbin/scanner.pl
                      7 Query       SELECT me.name, me.value FROM metainformation me WHERE ( name = 'lastRescanTime' )
2006-06-19 11:21:36.2611 About to look for files in /usr/sbin/scanner.pl
                      7 Query       SELECT me.name, me.value FROM metainformation me WHERE ( ( name = 'lastRescanTime' ) )

It still seems to be looking for music in /usr/sbin/scanner.pl rather than the music directory.  Running the scanner manually still works fine.
Comment 7 Olivier Abad 2006-06-26 23:25:11 UTC
Here is a correction to Import.pm to make scanning work again. It works for me on ubuntu dapper :

sub launchScan {
        my ($class, $args) = @_;

        # Pass along the prefs file - might need to do this for other flags,
        # such as logfile as well.
        if (defined $::prefsfile && -r $::prefsfile) {
                $args->{"prefsfile=$::prefsfile"} = 1;
        }

        # Add in the various importer flags
        for my $importer (qw(itunes musicmagic moodlogic)) {

                if (Slim::Utils::Prefs::get($importer)) {

                        $args->{$importer} = 1;
                }
        }

        my @scanArgs = map { "--$_" } keys %{$args};

        my $command  = "$Bin/scanner.pl";

        # Check for different scanner types.
        if (Slim::Utils::OSDetect::OS() eq 'win' && -x "$Bin/scanner.exe") {

                $command  = "$Bin/scanner.exe";

        } elsif (Slim::Utils::OSDetect::isDebian() && -x '/usr/sbin/slimserver-scanner') {

                $command  = '/usr/sbin/slimserver-scanner';
        }

        # Bug: 3530 - use the same version of perl we were started with.
        if ($Config{'perlpath'} && -x $Config{'perlpath'}) {

                unshift @scanArgs, $command;
                $command  = $Config{'perlpath'};
        }

        $class->scanningProcess(
                Proc::Background->new($command, @scanArgs)
        );

        return 1;
}
Comment 8 Dan Sully 2006-06-27 10:41:13 UTC
Thanks Oliver - commited as change 8151