Page 1 of 1

Subsonic did not have read writes, now does but refuses to.

PostPosted: Wed Jan 25, 2017 1:13 pm
by cadilhac
Hi there;

This is a problem I've had multiple times: the music directory on my server is owned by user A that is different from the user subsonic is run with, user B. Sometimes A would put a new album from a new artist in her directory, but would forget to set the rights correctly, and B would not be allowed to read the files. Subsonic, the next day, lists the new artist, but displays the directory as empty, e.g.:

Image

Now A would set the correct reading writes on the server, but neither "Clean-up database" nor "Scan media folders now" would change the above listing. The only solution I could find is to *delete* the database in /var/lib/subsonic/db and recreate it. Is there any clean solution?

Cheers!

Re: Subsonic did not have read writes, now does but refuses

PostPosted: Wed Jan 25, 2017 3:06 pm
by acroyear
you have to do something inside the folder to get it to recognize that it changed, and sometimes that requires doing something to change the *parent* folder.

try to rename the folder that just got its permissions changed to something else (Toh Kay REMOVETHIS), scan, then rename it back and scan again.

changing a file or folder's permissions doesn't change its "last modified" time, which is what the scanner checks in order to not dig any deeper in file loading than it has to, as an optimization.

Re: Subsonic did not have read writes, now does but refuses

PostPosted: Wed Jan 25, 2017 4:53 pm
by toolman
If you're running subsonic on Windows you can run the Subsonic service under an administrator account with all priveleges in all mediafolders. In that way it doesn't matter who creates a new folder in your mediafolders, the changes will always be picked up and displayed in Subsonic.

Re: Subsonic did not have read writes, now does but refuses

PostPosted: Thu Jan 26, 2017 6:01 pm
by cadilhac
@acroyear: AH! Truly simple indeed, thanks for pointing that out! Running:

Code: Select all
$ chmod a+rX -R "Toh Kay" && find "Toh Kay" -exec touch '{}' \; 


and starting a scan did the trick. Thanks!

@toolman: Not running on Windows, and I like to have processes with an internet access to be nonroot. Thanks!

Re: Subsonic did not have read writes, now does but refuses

PostPosted: Sat Jan 28, 2017 9:02 pm
by toolman
Running the subsonic service as admin has no nothing to do with internet acces.

Re: Subsonic did not have read writes, now does but refuses

PostPosted: Sun Feb 05, 2017 4:57 am
by mortiiscof
I just had this same issue. I wasn't able to get a number of albums to update (I have ~2500 artists in library) and I decided to try a trick that previously worked, removing the media folder and readding it to subsonic. After this I hoped the scan would again run across everything and index many of the "missing" albums/artists. It didn't work!

I then tried removing (first backing up!) and recreating the DB... It still would only refresh "1" node:

Code: Select all
[2017-02-03 22:18:29,805] INFO VersionService - Resolved latest Subsonic final version to: 6.0
[2017-02-03 22:18:29,805] INFO VersionService - Resolved latest Subsonic beta version to: 6.0.beta2
[2017-02-03 22:18:59,888] INFO MusicFolderDao - Created music folder /var/music
[2017-02-03 22:18:59,888] INFO MediaScannerService - Automatic media library scanning scheduled to run every 1 day(s), starting at Sat Feb 04 21:00:00 EST 2017
[2017-02-03 22:19:03,537] INFO MediaScannerService - Starting to scan media library.
[2017-02-03 22:19:03,578] INFO MediaScannerService - Scanned media library with 1 entries.
[2017-02-03 22:19:03,578] INFO MediaScannerService - Marking non-present files.
[2017-02-03 22:19:03,578] INFO MediaScannerService - Marking non-present artists.
[2017-02-03 22:19:03,579] INFO MediaScannerService - Marking non-present albums.
[2017-02-03 22:19:03,580] INFO MediaScannerService - Completed media library scan.
[2017-02-03 22:19:03,680] INFO PlaylistService - Starting playlist import.
[2017-02-03 22:19:03,682] INFO PlaylistService - Completed playlist import.
[2017-02-03 22:19:10,945] INFO MediaScannerService - Automatic media library scanning scheduled to run every 1 day(s), starting at Sat Feb 04 03:00:00 EST 2017
[2017-02-03 22:19:30,862] INFO MediaScannerService - Starting to scan media library.
[2017-02-03 22:19:30,867] INFO MediaScannerService - Scanned media library with 1 entries.
[2017-02-03 22:19:30,867] INFO MediaScannerService - Marking non-present files.
[2017-02-03 22:19:30,868] INFO MediaScannerService - Marking non-present artists.
[2017-02-03 22:19:30,868] INFO MediaScannerService - Marking non-present albums.
[2017-02-03 22:19:30,868] INFO MediaScannerService - Completed media library scan.
[2017-02-03 22:19:30,957] INFO PlaylistService - Starting playlist import.
[2017-02-03 22:19:30,957] INFO PlaylistService - Completed playlist import.
[2017-02-03 22:23:12,754] INFO PodcastService - Starting scheduled Podcast refresh.
[2017-02-03 22:23:12,754] INFO PodcastService - Completed scheduled Podcast refresh.


Frustrating!

I made sure the install ("media") user had full read/write to the directory... I made sure the music was actually there... I recreated the DB and everything again... still only "1 entries."

I then noticed something strange. The man library folder (/var/music) had a modified date of sometime in 1969! Strange... but I do update this from a mounted Windows share with rsync... I've seen stranger things.

After running 'touch' on that folder and also those inside the library the scan proceeded as expected and my library was reindexed and available.

Thank you for the idea!

Cheers,
Bryce

Re: Subsonic did not have read writes, now does but refuses

PostPosted: Thu Apr 06, 2017 2:22 pm
by jeffgt14
I’m having these same issues however using the touch method described above doesn’t seem to work. Any idea what else I can do to trigger subsonic to not skip over these files during a scan?

Re: Subsonic did not have read writes, now does but refuses

PostPosted: Fri Oct 20, 2017 9:27 am
by lonesomerider
jeffgt14 wrote:I’m having these same issues however using the touch method described above doesn’t seem to work. Any idea what else I can do to trigger subsonic to not skip over these files during a scan?


Did you try to open up the url

<UrlOfSubsonic>/db.view

and execute the follwing sql:

Code: Select all
UPDATE MEDIA_FILE
SET children_last_updated = '1970-01-01 01:00:00.0'
WHERE TYPE IN ( 'ALBUM', 'DIRECTORY')


then do a rescan of the library.

this helped me to recover 2% of missing songs after the upgrade to 6.1.1