YunoHost-Apps / navidrome_ynh

Navidrome package for YunoHost
https://www.navidrome.org/
GNU General Public License v3.0
17 stars 5 forks source link

Error updating folder in the DB: attempt to write a readonly database #9

Closed SpencerDub closed 3 years ago

SpencerDub commented 4 years ago

I'm just stress-testing the heck out of this package. Thanks for your patience. 😅

As discussed in #6, I updated navidrome.toml to include the line DataFolder = "/var/lib/navidrome", then ran /opt/yunohost/navidrome/navidrome -c /var/lib/navidrome/navidrome.toml scan -f in order to force a rescan of my database. The results included a lot of blocks that looked like this (with different albums and artists):

ERRO[0013] Error writing albums to the DB                error="attempt to write a readonly database"
INFO[0013] Finished processing changed folder            dir="/media/mediashare/Music/Weird Al Yankovic/Bad Hair Day" elapsed=7.278687ms purged=0 updated=0
ERRO[0013] Error updating folder in the DB               error="attempt to write a readonly database" path="/media/mediashare/Music/Weird Al Yankovic/Bad Hair Day"
ERRO[0013] SQL: `UPDATE album SET album_artist = ?, album_artist_id = ?, artist = ?, artist_id = ?, compilation = ?, cover_art_id = ?, cover_art_path = ?, duration = ?, full_text = ?, genre = ?, id = ?, max_year = ?, min_year = ?, name = ?, order_album_artist_name = ?, order_album_name = ?, song_count = ?, sort_album_artist_name = ?, sort_album_name = ?, sort_artist_name = ?, updated_at = ? WHERE id = ?`  args="['\"Weird Al\" Yankovic','497f580d81bcd41a8d8b93cc882df07e','\"Weird Al\" Yankovic','497f580d81bcd41a8d8b93cc882df07e',false,'al-d3956df195beaa2578ed036fe3bd0026','/media/mediashare/Music/Weird Al Yankovic/Poodle Hat/folder.jpg',216.4,' al hat poodle weird yankovic','Comedy','d3956df195beaa2578ed036fe3bd0026',2003,2003,'Poodle Hat','\"Weird Al\" Yankovic','Poodle Hat',1,'','','','2020-08-17T13:28:26.009227564-07:00','d3956df195beaa2578ed036fe3bd0026']" elapsedTime="74.197µs" error="attempt to write a readonly database" rowsAffected=0

I suspect this is part of why album art isn't updating according to the rules in my navidrome.toml file. What can I do to fix these errors upon rescan?

ericgaspar commented 4 years ago

What happens if you try with a sudo at the beginning? sudo /opt/yunohost/navidrome/navidrome -c /var/lib/navidrome/navidrome.toml scan -f

SpencerDub commented 4 years ago

Darn it, I was clearly staring at a screen too long yesterday, because that should have been obvious.

sudo worked for eliminating this particular error. Still no album art on some albums, though. :thinking:

deluan commented 4 years ago

Does this package install an user specifically for Navidrome? If yes, you should not use sudo without specifying the user, or else you may end up with files with root permissions, which will cause Navidrome to fail when trying to read them.

If there is a user for Navidrome the command to rescan should be:

sudo  -u <navidrome's user> /opt/yunohost/navidrome/navidrome -c /var/lib/navidrome/navidrome.toml scan -f
qbmiller commented 2 years ago

chown -R /path/data user:user