Bug 17639 - Rescan buttons scans the wrong folder
: Rescan buttons scans the wrong folder
Status: CLOSED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: Scanner
: 7.7.0
: PC Other
: P2 major with 1 vote (vote)
: 7.7.1
Assigned To: Michael Herger
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-10-10 08:59 UTC by Mikael Nyberg
Modified: 2011-12-13 22:22 UTC (History)
3 users (show)

See Also:
Category: ---


Attachments
scanner log (79.36 KB, text/x-log)
2011-10-10 08:59 UTC, Mikael Nyberg
Details
server log (8.78 KB, text/x-log)
2011-10-10 09:00 UTC, Mikael Nyberg
Details
Basic settings (22.21 KB, image/png)
2011-10-10 09:01 UTC, Mikael Nyberg
Details
Information (30.31 KB, image/png)
2011-10-10 09:02 UTC, Mikael Nyberg
Details
scanner.log (1.29 MB, text/x-log)
2011-10-10 10:20 UTC, Mikael Nyberg
Details
Server.log (678.56 KB, text/x-log)
2011-10-10 10:21 UTC, Mikael Nyberg
Details
scanner log (1.33 MB, text/plain)
2011-10-11 10:50 UTC, Mikael Nyberg
Details
server.log (1.19 MB, text/plain)
2011-10-15 03:00 UTC, Mikael Nyberg
Details
scanner.log (21.93 KB, text/x-log)
2011-10-15 03:01 UTC, Mikael Nyberg
Details
crash_server.log (14.47 KB, text/plain)
2011-10-17 10:09 UTC, Mikael Nyberg
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mikael Nyberg 2011-10-10 08:59:48 UTC
Created attachment 7500 [details]
scanner log

Rescan buttons scans the wrong folder.

It actually looks like it's scanning every folder *but* the one you choose ?
Comment 1 Mikael Nyberg 2011-10-10 09:00:29 UTC
Created attachment 7501 [details]
server log
Comment 2 Mikael Nyberg 2011-10-10 09:01:23 UTC
Created attachment 7502 [details]
Basic settings
Comment 3 Mikael Nyberg 2011-10-10 09:02:03 UTC
Created attachment 7503 [details]
Information
Comment 4 Mikael Nyberg 2011-10-10 09:03:04 UTC
I proved it by putting new music in my music folder and ordered a scan of my picture folder.
Comment 5 Michael Herger 2011-10-10 09:06:03 UTC
did you at the same time change some of your settings? Or was another scan still going on in the background?
Comment 6 Mikael Nyberg 2011-10-10 09:16:53 UTC
No other scan afaik ? server has not been running for very long .
And the whole machine was recently rebooted .
Comment 7 Mikael Nyberg 2011-10-10 09:20:13 UTC
The actual scan went very well btw new music added.

Btw I did not have any new pictures. I saw this behavior a while back, but I had not reprodueced it properly , and you latest fix made it possible to get past the deleting files stage, so I could let the scan complete.
Comment 8 Mikael Nyberg 2011-10-10 10:20:09 UTC
Created attachment 7504 [details]
scanner.log

Scan without any new files at all, log would probably contain previus scan
Comment 9 Mikael Nyberg 2011-10-10 10:21:52 UTC
Created attachment 7505 [details]
Server.log

A server log .

I notice that my total album count was 3 albums less after this scan ? without adding or removing any files
Comment 10 Mikael Nyberg 2011-10-11 10:47:48 UTC
yet another scan for pictures that finds music and do a lot of stuff .

The Björk album is new the Ane Brun Album was scanned via BMF this did not stop the scanner from rescanning it

Will attach scan log I may have to zip it
Comment 11 Mikael Nyberg 2011-10-11 10:50:12 UTC
Created attachment 7507 [details]
scanner log
Comment 12 Michael Herger 2011-10-12 01:12:06 UTC
(In reply to comment #11)
> Created an attachment (id=7507) [details]
> scanner log

This last log is from a full wipe/rescan, or it shouldn't run the external scanner. In this case it's expected to scan music as well as other media types.

Did you click the Rescan button right of the path entry?
Comment 13 Mikael Nyberg 2011-10-12 07:36:45 UTC
(In reply to comment #12)
> (In reply to comment #11)
> > Created an attachment (id=7507) [details] [details]
> > scanner log
> 
> This last log is from a full wipe/rescan, or it shouldn't run the external
> scanner. In this case it's expected to scan music as well as other media types.
> 
> Did you click the Rescan button right of the path entry?

yes the rescan button beside the path entry, full rescan not possible it is finished within minutes it takes hours to rescan everything thing.

When I press the rescan button for pictures all other scan buttons also get greyd out ? Is this normal.
Comment 14 Mikael Nyberg 2011-10-12 11:29:18 UTC
I tried after a complete rescan to add a new album, same result.

To me it looks like both buttons actually does almost the same thing for me .

Do you have any objections to my folder structure .

/media/music

/media/music/Mina bilder (pictures)

/media/music/Playlists


Yes playlist and pictures are under music I assume that LMS is smart enough to exclude those ?
Comment 15 Michael Herger 2011-10-12 11:57:18 UTC
> Do you have any objections to my folder structure .
> /media/music
> /media/music/Mina bilder (pictures)
> /media/music/Playlists
> 
> Yes playlist and pictures are under music I assume that LMS is smart enough to
> exclude those ?

Andy - how smart are we about this kind of setting? It seems the audioscan would find images, but "remove" them on every rescan.
Comment 16 Andy Grundman 2011-10-13 05:53:31 UTC
Hmm yeah, nested paths like that may not work right...
Comment 17 Mikael Nyberg 2011-10-13 06:24:55 UTC
(In reply to comment #16)
> Hmm yeah, nested paths like that may not work right...

had the same playlist directory since 6.x  without problems.
It is historical reasons behind this :-/

Can this be related:
https://bugs-archive.lyrion.org/show_bug.cgi?id=16081

Should this be supported ?
If you think this should be supported I can keep my systems as it is and continue to test this.

It might be more common than you think imagine a generic network shared low-budget NAS with a very flat folder structure...

Otherwise I could remount my two discs (music is more than one disc, there is a music2 with even more folders nested inside that :-/ ) .
And modify my samba setup etc.
Comment 18 Mikael Nyberg 2011-10-15 02:50:29 UTC
Tried your theory of my nested mounts ,now my music folders looks like.

/media/sda1/music1      (music )
/media/sdb1/music2      (more music )
/media/sda1/Mina bilder (the picture folder)
/media/sda1/Playlists   (my playlists )

it still scans all/wrong folders whatever i do .

So this bug is still valid

Even if I select a playlist scan it does a look for new and changed in all folders ?

I will upload more scan logs , note that my playlist are broken, I'm adjusting them now (an effect of the relocation)
Comment 19 Mikael Nyberg 2011-10-15 03:00:32 UTC
Created attachment 7513 [details]
server.log
Comment 20 Mikael Nyberg 2011-10-15 03:01:00 UTC
Created attachment 7514 [details]
scanner.log
Comment 21 Michael Herger 2011-10-17 01:39:58 UTC
> /media/sda1/Playlists   (my playlists )

Did you add this folder in the Playlist folder setting, or as one of the media folders?
Comment 22 Michael Herger 2011-10-17 01:42:57 UTC
Mikael - the scan is failing due to a database lock caused by TrackStat. Please disable all 3rd party plugins and try again. In order to know what's going on we really need as little "outside" influence as possible.

Erland should probably add some code to not try to write to the DB while a scan is going on...
Comment 23 Mikael Nyberg 2011-10-17 04:25:26 UTC
(In reply to comment #21)
> > /media/sda1/Playlists   (my playlists )
> 
> Did you add this folder in the Playlist folder setting, or as one of the media
> folders?

This is the playlist folder setting it's not a media folder
Comment 24 Mikael Nyberg 2011-10-17 09:50:50 UTC
Trying out tis without erlands plugins .

Scan for pictures or videos does not find music all is ok there .

However scanning for music in the folder where there is no new music makes the server crash ?
Rebooting and trying again...
Comment 25 Mikael Nyberg 2011-10-17 10:01:07 UTC
And it resumes and endless scan after restart that I have to abort...
Comment 26 Mikael Nyberg 2011-10-17 10:09:55 UTC
Created attachment 7524 [details]
crash_server.log

it actually crashes when I sscan the dir where the new music is i attache log .

Is this another already known bug ?

it actually looks like it's trying the start the scan again after it ended ??
Comment 27 Mikael Nyberg 2011-10-18 08:42:10 UTC
when I removed all erlands plugins this particular bug is resolved .

I create a new one for the segfaults I now get when I actually can do these scans...
Comment 28 Michael Herger 2011-10-18 10:54:58 UTC
Thanks for all the hard testing anyway :-)
Comment 29 Erland Isaksson 2011-10-30 22:30:06 UTC
I don't have the permission to reopen this bug but hopefully someone that sees this comment have the permission to do it.

The issue is not specific to third party plugins, activating the standard MusicIP plugin gives exactly the same behavior in my system. I suspect the same thing might also happen with the iTunes plugin as it also registers an importer.

The issue is probably related to if there is any plugin that calls:
Slim::Music::Import->addImporter
Slim::Music::Import->useImporter

This is currently done in at least:
- MusicIP (bundled with LMS)
- iTunes (bundled with LMS)
- CustomBrowse (third party)
- CustomSkip (third party)
- DynamicPlaylist (third party)
- SQLPlayList (third party)
- TrackStat (third party)
- CustomScan (third party, not sure this affects things as the add/use Importer is only called when launched from external scanner)

There is a suspected change in r33453 but I haven't investigated if that's the cause of these problems.

I'll try to see if I can remove the add/useImporter calls in my own plugins as most of them only use it to register mixers and I'm not sure I need to use importer in 7.6+ for that.

However, Logitech still needs to solve the issues in MusicIP and also in iTunes (if it have the same issues, haven't tried this as I'm on Linux).
Comment 30 Mikael Nyberg 2011-10-31 11:12:20 UTC
I could change it back to unconfirmed . Some one else have to get it back to confirmed.
Comment 31 Michael Herger 2011-11-04 06:38:16 UTC
We need to support singledir mode in the external scanner. Right now whenever the external scanner is being launched (which happens if you have additional importers defined, such as MIP, iTunes, or some of Erland's) a scan of all folders would be triggered.
Comment 32 SVN Bot 2011-11-04 06:40:33 UTC
 == Auto-comment from SVN commit #33657 to the slim repo by mherger ==
 == http://svn.slimdevices.com/slim?view=revision&revision=33657 ==

Fixed Bug: 17639
Description: pass singledir value to external scanner
Comment 33 Dinanath Kumar Singh 2011-12-13 22:22:50 UTC
Verification passed on 7.7.1 r33735, able to scan the media from directories/sub directories including iTunes music on window, mac and ubuntu.