Bug 12655 - Auto-scanner slowly deletes all files
: Auto-scanner slowly deletes all files
Status: NEW
Product: Logitech Media Server
Classification: Unclassified
Component: Scanner
: 7.4.0
: PC Ubuntu Linux
: P3 normal (vote)
: 7.7.x
Assigned To: Andy Grundman
: SQLite
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-07-02 11:07 UTC by radish
Modified: 2011-10-03 09:51 UTC (History)
1 user (show)

See Also:
Category: ---


Attachments
Zipped up copy of squeezecenter.db (7.03 MB, application/x-zip-compressed)
2009-07-07 20:17 UTC, radish
Details

Note You need to log in before you can comment on or make changes to this bug.
Description radish 2009-07-02 11:07:21 UTC
Since the automatic scanner was introduced into 7.4 I've had an issue where it seems to think all my files are deleted when they are still there. A full rescan works fine and gets the same results as 7.3.3, but as soon as it's finished the CPU pegs up to 50% and the track count starts to drop. The logs indicate that it think's it's being notified for file deletes on the entire library.

Log snippet:

[09-06-28 22:59:10.7367] Slim::Utils::Scanner::Local::deleted (311) Handling deleted track /mnt/music/scan/flac-ripped/Artist Albums/John Mayer - Room for Squares/07. 83.flac
[09-06-28 22:59:11.0084] Slim::Utils::Scanner::Local::deleted (311) Handling deleted track /mnt/music/scan/flac-ripped/Artist Albums/John Mayer - Room for Squares/08. 3X5.flac
[09-06-28 22:59:11.1415] Slim::Utils::Scanner::Local::deleted (311) Handling deleted track /mnt/music/scan/flac-ripped/Artist Albums/John Mayer - Room for Squares/09. Love Song for No One.flac
[09-06-28 22:59:11.7524] Slim::Utils::Scanner::Local::deleted (311) Handling deleted track /mnt/music/scan/flac-ripped/Artist Albums/John Mayer - Room for Squares/10. Back to You.flac
[09-06-28 22:59:12.0093] Slim::Utils::Scanner::Local::deleted (311) Handling deleted track /mnt/music/scan/flac-ripped/Artist Albums/John Mayer - Room for Squares/11. Great Indoors.flac
[09-06-28 22:59:12.1311] Slim::Utils::Scanner::Local::deleted (311) Handling deleted track /mnt/music/scan/flac-ripped/Artist Albums/John Mayer - Room for Squares/12. Not Myself.flac
[09-06-28 22:59:12.7614] Slim::Utils::Scanner::Local::deleted (311) Handling deleted track /mnt/music/scan/flac-ripped/Artist Albums/John Mayer - Room for Squares/13. (Untitled).flac


My 7.4 server is running on Ubuntu 8.10 Server on VMware. The music directly (mix of FLAC, Vorbis, AAC & MP3) is mounted over cifs. 

There's some discussion in this forum thread: http://forums.slimdevices.com/showthread.php?p=436276#post436276

I've seen this with every 7.4 nightly over the last week or so.
Comment 1 radish 2009-07-06 19:11:22 UTC
Possibly not strictly related, but I've also noticed that now the auto-scan logic is optional, if I disable it the scanner won't work at all (clicking Rescan just says "preferences saved"). So I can't really use 7.4 at all now.
Comment 2 Andy Grundman 2009-07-06 19:25:19 UTC
Can you send me your squeezecenter.db file?  Kill SC before it deletes all your files.  I want to compare the values in the tracks table to the ones in the scanned_files table.  Files that don't have matching paths in here are the ones that are deleted.  If you're curious, the query for this is:

SELECT url FROM tracks
WHERE  url LIKE '$basedir%'
EXCEPT
SELECT url FROM scanned_files
WHERE  url LIKE '$basedir%'
Comment 3 radish 2009-07-07 20:17:46 UTC
Created attachment 5425 [details]
Zipped up copy of squeezecenter.db

As requested, a copy of my db from after a scan completes but before all of it was deleted. I tried to open it with the command line sqlite client but it said it couldn't read the file - hopefully I was just using the wrong version or something. Other possibility is that it was corrupted during shutdown (I stopped it with init.d).
Comment 4 Andy Grundman 2009-07-07 21:08:16 UTC
I can open that file fine, thanks.  Hmm, are you using symlinks for the paths under /mnt/music/scan?
Comment 5 radish 2009-07-07 22:37:50 UTC
/mnt/music is a mountpoint:

//192.168.2.163/music on /mnt/music type cifs (rw,mand,noexec)

on the remote server, music/scan is a directory of symlinks:

adam@gary:/data1/music/scan$ ls -l
total 0
lrwxrwxrwx 1 adam adam 24 2008-10-26 21:24 amazon -> ../mp3-originals/amazon/
lrwxrwxrwx 1 adam adam 15 2008-07-15 07:45 flac-ripped -> ../flac-ripped/
lrwxrwxrwx 1 adam adam 28 2008-10-27 16:03 individual -> ../mp3-originals/individual/
lrwxrwxrwx 1 adam adam 22 2008-10-26 22:24 misc -> ../mp3-originals/misc/
lrwxrwxrwx 1 adam adam 26 2008-09-10 21:28 podcasts -> ../mp3-originals/podcasts/
lrwxrwxrwx 1 adam adam 17 2008-07-15 07:45 vorbis-ripped -> ../vorbis-ripped/


Hope that makes sense - it's a little complex but it used to work fine with the perl scanner.
Comment 6 Andy Grundman 2009-07-08 06:33:21 UTC
Thanks, that's very helpful.  I will try and reproduce.
Comment 7 Andy Grundman 2011-01-12 12:08:26 UTC
SQLite bugs need to go back to 7.6 target.