You are not logged in.

#1 2011-08-22 15:51:36

Natanji
Member
Registered: 2009-09-22
Posts: 133

[solved] MPD doesn't create database

Hello everyone,
I've started using mpd, it runs on a home server. And it works great, except that it never creates a database file.
In my /etc/mpd.conf I have:
db_file "/home/mpd/mpd.db"

This file is never created. Even when I create it, it is never filled with any data. This means that on restart of mpd, the database is empty again (so it gets lost after closing mpd). What am I doing wrong?

Last edited by Natanji (2011-08-28 18:39:26)

Offline

#2 2011-08-22 16:23:57

litemotiv
Forum Fellow
Registered: 2008-08-01
Posts: 5,026

Re: [solved] MPD doesn't create database

You have to update the database from the client you are using. Previous mpd versions had a --create-database commandline parameter, but this was deprecated and removed.


ᶘ ᵒᴥᵒᶅ

Offline

#3 2011-08-24 08:58:42

Natanji
Member
Registered: 2009-09-22
Posts: 133

Re: [solved] MPD doesn't create database

That's exactly what I am doing. I use ario as a client, connect and tell the mpd server that it should update the database. This takes a while and after restarting ario and reconnecting, I see all the music.

However, when I stop mpd on the server, the database is not saved. So when I reboot the server for instance, I have to re-scan the whole database. The database is only saved in memory apparently, while mpd is running - but not saved to the hard drive. And I would like to know why.

Offline

#4 2011-08-24 09:01:09

litemotiv
Forum Fellow
Registered: 2008-08-01
Posts: 5,026

Re: [solved] MPD doesn't create database

Possibly the user which you are running MPD under has no write permission for the location of the database?


ᶘ ᵒᴥᵒᶅ

Offline

#5 2011-08-24 09:45:50

Natanji
Member
Registered: 2009-09-22
Posts: 133

Re: [solved] MPD doesn't create database

I also wondered about that, but it can't be. In my config I also have:
state_file "/home/mpd/mpdstate"

The state file is successfully created. Same goes for the PID file that resides in the same directory. So unless mpd creates the database with a different user than it creates the state and PID files (which wouldn't make any sense), the error you suggest is impossible.

Offline

#6 2011-08-27 09:01:53

Natanji
Member
Registered: 2009-09-22
Posts: 133

Re: [solved] MPD doesn't create database

*bump* Anyone?
Can someone at least tell me when the database file is created for them - at startup of mpd, or when shutting down the daemon, or when first running update? If it's working for you, trying this out for me would be greatly appreciated.

Offline

#7 2011-08-27 10:32:01

Gooru
Member
From: Poland
Registered: 2010-08-25
Posts: 53

Re: [solved] MPD doesn't create database

I think database is created during first update. You may also try this: https://bbs.archlinux.org/viewtopic.php?id=79542  especially #2

Offline

#8 2011-08-27 11:24:17

ilusi0n
Member
Registered: 2010-06-09
Posts: 187

Re: [solved] MPD doesn't create database

Like someone said, database is create automatically or by the client you are using. Really check the path where is being saved and if you have permissions. Also use full paths for it. I recommend saving all the files on your home (no permission problems).

If you still have problems on creating the database, delete all files create by mpd. Start ario (you mention you were using it) and create the database with it and check if you still have the same problem.

edit: And as far as I know mpd updates automatically the database when some file is changed.

Last edited by ilusi0n (2011-08-27 11:24:55)

Offline

#9 2011-08-27 11:46:28

Rasi
Member
From: Germany
Registered: 2007-08-14
Posts: 1,914
Website

Re: [solved] MPD doesn't create database

Also important: the file is NOT created, before the initial scan is completed. Its first dumped to RAM and then written to disk, when finished.


He hoped and prayed that there wasn't an afterlife. Then he realized there was a contradiction involved here and merely hoped that there wasn't an afterlife.

Douglas Adams

Offline

#10 2011-08-28 09:14:06

Natanji
Member
Registered: 2009-09-22
Posts: 133

Re: [solved] MPD doesn't create database

Thanks for the replies. Could it be that if something goes wrong during initial scan, that this prevents the database from being saved? I notice that not all of my music is added to mpd although it is on the hard drive. I can't find any errors in the log file though, and the files and directories are all readable (and in the case of directories, executable) by the group that my mpd user is in.

Offline

#11 2011-08-28 14:33:36

Rasi
Member
From: Germany
Registered: 2007-08-14
Posts: 1,914
Website

Re: [solved] MPD doesn't create database

Natanji wrote:

Thanks for the replies. Could it be that if something goes wrong during initial scan, that this prevents the database from being saved? I notice that not all of my music is added to mpd although it is on the hard drive. I can't find any errors in the log file though, and the files and directories are all readable (and in the case of directories, executable) by the group that my mpd user is in.

start mpd with "mpd --verbose --stdout --no-daemon" to see files that fail to be added (and other errors)


He hoped and prayed that there wasn't an afterlife. Then he realized there was a contradiction involved here and merely hoped that there wasn't an afterlife.

Douglas Adams

Offline

#12 2011-08-28 16:35:51

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: [solved] MPD doesn't create database

Rasi wrote:
Natanji wrote:

Thanks for the replies. Could it be that if something goes wrong during initial scan, that this prevents the database from being saved? I notice that not all of my music is added to mpd although it is on the hard drive. I can't find any errors in the log file though, and the files and directories are all readable (and in the case of directories, executable) by the group that my mpd user is in.

start mpd with "mpd --verbose --stdout --no-daemon" to see files that fail to be added (and other errors)

This is what needs to be done. MPD was broken for a while and quitely had segfaults. When it did segfault, the database creation or updating function was not working properly anymore.

Offline

#13 2011-08-28 18:39:04

Natanji
Member
Registered: 2009-09-22
Posts: 133

Re: [solved] MPD doesn't create database

Thanks, that helped a lot! In one folder I had a video .mp4 file that mpd considered being an audio file, tried to scan it and apparently got stuck with it.

Offline

Board footer

Powered by FluxBB