Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
SpencerDub opened this issue Aug 17, 2020 · 4 comments
Closed

Comments

@SpencerDub
Copy link

SpencerDub commented Aug 17, 2020

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
Copy link
Member

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
Copy link
Author

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. 馃

@deluan
Copy link

deluan commented Aug 18, 2020

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
Copy link

chown -R /path/data user:user

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants