Bug 3892 - SlimServer initiates clear/rescan on its own
: SlimServer initiates clear/rescan on its own
Status: RESOLVED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: Database
: 6.5b1
: PC Windows XP
: P2 normal (vote)
: ---
Assigned To: Dan Sully
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2006-08-08 18:53 UTC by Jim McAtee
Modified: 2008-09-15 14:39 UTC (History)
2 users (show)

See Also:
Category: ---


Attachments
log (5.76 KB, text/plain)
2006-08-08 18:56 UTC, Jim McAtee
Details
Log with --d_import --d_scan --d_sql enabled (6.44 KB, text/plain)
2006-08-21 00:53 UTC, Jim McAtee
Details
Log from normal scan that wiped the database (55.32 KB, text/plain)
2006-08-22 12:51 UTC, Jim McAtee
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jim McAtee 2006-08-08 18:53:28 UTC
I shut down SlimServer and SVN'd to r8875.  Upon restarting a clear/rescan began running immediately.
Comment 1 Jim McAtee 2006-08-08 18:56:05 UTC
Created attachment 1405 [details]
log
Comment 2 KDF 2006-08-09 00:52:19 UTC
http://forums.slimdevices.com/showthread.php?t=26188

not actually seeing this myself, linux nor win2k
Comment 3 Jim McAtee 2006-08-09 11:17:35 UTC
Just happened to me again.  I shut down the server, did an SVN update to r8880 and then restarted the server.  It immediately started a scan.  Since reporting the issue in the forum thread, I've restarted the MySQL service and even rebooted the machine, so I would think that if it were a state problem within the database, then that should have been cleared.

Environment: Windows XP Pro server with Perl version of SlimServer 6.5b1, r8880 using ActiveState Perl 5.8.7.  External MySQL 5.0.21 run on the same server.  SlimServer run as a service using srvany.exe and installed with instsrv.exe from the Windows Resource Kit.
Comment 4 Jim McAtee 2006-08-18 15:29:42 UTC
This happened again today.  After having run and completed a clear/rescan I restarted the server.  Upon startup, SlimServer cleared the library and began rescanning.  The thing that's noteworthy about this incident is that it failed to find any artwork in that scan.

I'm thinking now that whatever is going here on may be closely related to bug 3896.  Will do more testing with --d_import --d_sql --d_mysql switches and then with the built-in MySQL server.
Comment 5 Jim McAtee 2006-08-20 12:08:36 UTC
Are there any debugging option(s) that can tell us exactly who/what _initiated_ the scan?  If there aren't, I'd like to suggest logging this information.  Doesn't seem there are too many possibilities: from the web ui, run independently, or because the server thought there was any empty database.
Comment 6 Dan Sully 2006-08-20 12:16:06 UTC
Subject: Re:  SlimServer initiates clear/rescan on its own

Yes - that's pretty easy to do.

Comment 7 Jim McAtee 2006-08-21 00:53:24 UTC
Created attachment 1457 [details]
Log with --d_import --d_scan --d_sql enabled

From the attached log, it looks like SlimServer thinks the tracks table is empty, so it does a wipe/rescan.  This is now happening every time I start up the server (I'd swear that it seems like enabling the debugging switch -d_sql itself has an effect on it).  There's no way COUNT(*) should have returned 0.  I can only think maybe the query failed or timed out for some reason, but that isn't shown in the logs.  If it does fail, should the correct action be to immediately launch a clear/rescan?  Seems dangerous.

I'll try next running with the built-in MySQL and seeing if I can recreate the problem there.
Comment 8 Dan Sully 2006-08-22 10:26:51 UTC
Ok - sounds good.

I assume that after you stop slimserver, and do a select count(*) from tracks, there is a > 0 number in there?
Comment 9 Jim McAtee 2006-08-22 12:51:07 UTC
Created attachment 1461 [details]
Log from normal scan that wiped the database

(In reply to comment #8)
> I assume that after you stop slimserver, and do a select count(*) from tracks,
> there is a > 0 number in there?

Yes, there is.

Here's the log from a related problem I mentioned in the forums - launching a normal scan wiped the database.  I don't see any SQL to clear the tables, but you can see all of the INSERT statements being done.  No artwork pass was made after this scan, so I have no artwork references in the library.  I see that the ID columns were all reset, so the new data begins at id=1, if that's worth noting.
Comment 10 Dan Sully 2006-08-24 11:14:58 UTC
Jim - would it be possible to get a RDC or VNC login to your machine to debug your issues?
Comment 11 Jim McAtee 2006-08-24 11:30:27 UTC
Dan, you can do that, but I'd like to do some more troubleshooting first.

I've switched back to the built-in MySQL and so far I'm not seeing this problem with that server.  I've restarted the server a number of times and it hasn't started a rescan.  The problem may well have been with the config of the outside MySQL server.  Prior to switching back to the included MySQL server, I did a reinstall of MySQL (downgrading to 5.0.18, just in case the problem might have been a library incompatibility with 5.0.24), trying to make the installation as plain vanilla as possible, and I still had the problem.

Haven't had a chance yet, but I'd like to go through and compare the config files from the two installs and see if I can find anything obvious.  The outside MySQL is still running on the server, so it should be easy enough to switch back and forth.
Comment 12 Dan Sully 2006-08-24 18:11:21 UTC
Ok, well it's good that it works with the built-in mysql.

But I'm confused on why your clean install MySQL doesn't.

FWIW, I'm running an external mysql on a Debian box, and I don't have this problem.
Comment 13 Dan Sully 2006-08-28 16:28:16 UTC
Fixed in change 9218

Thanks Phil!