othmar52 / slimpd

PHP/JS based MPD-web-client for large music collections
GNU Affero General Public License v3.0
41 stars 11 forks source link

ERROR: database file not readable #71

Closed gerroon closed 6 years ago

gerroon commented 6 years ago

Hi

This is my Mpd database file (set in mpd.conf)

ERROR: databasefile /home/MYUSER/.config/mpd/tag_cache not readable

This whole folder is 777, so I do not understand why it is compalining about this. Is it talking about something else? I am runnign Mpd under my user name.

sudo -u www-data php slimpd hard-reset --force
deleting .lock file
All data of database:slimpd will be lost! Continue? [y/n]
y
Dropping database
Recreating database
Will migrate: Sun, 17 Jul 2016 09:53:46 +0000  (slimpd_v1) ---> Sun, 10 Jun 2018 05:11:11 +0000  

APPLY:    Fri, 06 Jan 2017 06:44:30 +0000  
NOW AT:   Fri, 06 Jan 2017 06:44:30 +0000  
Deleting files and directories inside localdata/cache/
Deleting files and directories inside localdata/embedded/
Deleting files and directories inside localdata/peakfiles/
STARTING import phase 0 triggerImport()
STARTING import phase 1 waitForMpd()
mpd seems to be ready. continuing...
FINISHED import phase 1 waitForMpd()
STARTING import phase 2 processMpdDatabasefile()
FINISHED import phase 2 processMpdDatabasefile()
ERROR: databasefile /home/MYUSER/.config/mpd/tag_cache not readable
FINISHED import phase 0 finishBatch()
deleting .lock file
othmar52 commented 6 years ago

i assume your configuration value of mpd's database is invalid.

[mpd]
dbfile = /home/MYUSER/.config/mpd/tag_cache

depending on your OS it might be something like /var/lib/mpd/database or /var/lib/mpd/mpd.db

gerroon commented 6 years ago

Hi

dbfile = /home/MYUSER/.config/mpd/tag_cache (which is how it is also setup in mpd.conf given that I can use mpd just fine)

Do you know how I can get www-data to access to this file properly? I assume www-data user is the one that needs to update the database?

othmar52 commented 6 years ago

Just to verify the problem is the file access... Try to create a symlink to your db-file

MYUSER@yourMachine /path/to/slimpddocroot $ ln -s /home/MYUSER/.config/mpd/tag_cache

and change your config to

[mpd]
dbfile = /path/to/slimpddocroot/tag_cache

or temporary replace the symlink with a hard copy of the file

gerroon commented 6 years ago

Hi

Thanks for your help, your response made me think it sure was a permission issue. I ran with sudo and it works so I need to find a reasoanble solution to this.