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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Startup error mpd connection not working #64

Closed
john- opened this issue Oct 7, 2018 · 10 comments · Fixed by #66
Closed

Startup error mpd connection not working #64

john- opened this issue Oct 7, 2018 · 10 comments · Fixed by #66
Labels
bug Something isn't working
Milestone

Comments

@john-
Copy link

john- commented Oct 7, 2018

Describe the bug
I just now undated to most recent version in git and when I access the myMPD user interface I can't browse my music and no information is shown for my running mpd.
When I start at the command line I see this:
sudo ./mympd /etc/mympd/mympd.conf
Parsing config file: /etc/mympd/mympd.conf
Starting myMPD 4.3.0
Document root: /usr/share/mympd/htdocs
Error opening /var/lib/mympd/state/notificationWebError opening /var/lib/mympd/state/notificationPageError opening /var/lib/mympd/state/jukeboxModeError opening /var/lib/mympd/state/jukeboxPlaylistError opening /var/lib/mympd/state/jukeboxQueueLengthDroping privileges to nobody
Listening on http port 8081
MPD Connecting to 127.0.0.1:6600
MPD connected.
MPD protocoll version: 0.20.0
MPD supported tags: Artist ArtistSort Album AlbumSort AlbumArtist AlbumArtistSort Title Track Name Genre Date Composer Performer Disc MUSICBRAINZ_ARTISTID MUSICBRAINZ_ALBUMID MUSICBRAINZ_ALBUMARTISTID MUSICBRAINZ_TRACKID MUSICBRAINZ_RELEASETRACKID
myMPD enabled tags: Artist Album AlbumArtist Title Track Genre Date Composer Performer
Error opening /var/lib/mympd/tmp/playlist.tmpMPD X: Cannot send a new command while receiving another response
MPD X: Cannot send a new command while receiving another response

There is nothing further even when I navigate through myMPD screens.

To Reproduce
Steps to reproduce the behavior:

  1. Compile latest code from git
  2. Changed nothing else in my system
  3. Build and run mympd
  4. See error

Desktop (please complete the following information):

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

@john-
Copy link
Author

john- commented Oct 7, 2018

I went back to myMPD 4.3.0 (6f2edb3)and it worked. It looks that version updated how systemd loads myMPD and I had to fix a couple things in /etc/mympd/options before it would start.

I will try and work through versions to see what changed that broke things (or what brought out something not right in my system).

@jcorporation
Copy link
Owner

jcorporation commented Oct 7, 2018

hi john,

/etc/mympd/options are not used anymore. All configuration is done through /etc/mympd/mympd.conf.
The first errors (opening /var/lib/mympd/state/*) can be safely ignored. myMPD uses default values, if they are not found. Saving the settings once in the gui should remove this errors. In the next version this would be fixed.

The error "Error opening /var/lib/mympd/tmp/playlist.tmp" seems the problem. Exists the directory /var/lib/mympd/tmp/ and myMPD has the rights to write to it?

@jcorporation jcorporation added the bug Something isn't working label Oct 7, 2018
@jcorporation jcorporation added this to the v4.3.1 milestone Oct 7, 2018
jcorporation added a commit that referenced this issue Oct 7, 2018
@john-
Copy link
Author

john- commented Oct 7, 2018

Thanks. myMPD did not have permissions so I changed it to this:

drwxrwxr-x 2 nobody mympd 4096 Oct 7 16:26 /var/lib/mympd/tmp

Previously it was owned by mympd and group was r-w.

This got things to go farther. See below for full log which shows a retry of some sort that ends in a seg fault.

However, I am not sure what user/permissions should be in general.

My /etc/mympd/mympd.conf has this:

#myMPD user
user nobody

The log below shows this being used when accessing some files.

However from how some files files are installed they are owned by "mympd". For example, /var/lib/mympd/tmp was owned by mympd until I changed it.

Before I start changing things further it probably makes sense that I get that understanding first.

sudo ./mympd /etc/mympd/mympd.conf
Parsing config file: /etc/mympd/mympd.conf
Starting myMPD 4.3.0
Document root: /usr/share/mympd/htdocs
Error opening /var/lib/mympd/state/notificationWebError opening /var/lib/mympd/state/notificationPageError opening /var/lib/mympd/state/jukeboxModeError opening /var/lib/mympd/state/jukeboxPlaylistError opening /var/lib/mympd/state/jukeboxQueueLengthDroping privileges to nobody
Listening on http port 8081
MPD Connecting to 127.0.0.1:6600
MPD connected.
MPD protocoll version: 0.20.0
MPD supported tags: Artist ArtistSort Album AlbumSort AlbumArtist AlbumArtistSort Title Track Name Genre Date Composer Performer Disc MUSICBRAINZ_ARTISTID MUSICBRAINZ_ALBUMID MUSICBRAINZ_ALBUMARTISTID MUSICBRAINZ_TRACKID MUSICBRAINZ_RELEASETRACKID
myMPD enabled tags: Artist Album AlbumArtist Title Track Genre Date Composer Performer
Updated myMPDsmart-mostPlayed with 22 songs, minValue: 2
Updated myMPDsmart-bestRated with 2 songs, minValue: 2
MPD X: Connection closed by the server
Updated myMPDsmart-newestSongs with 0 songs, minValue: -604800
MPD connection failed.
MPD Connecting to 127.0.0.1:6600
MPD connected.
MPD protocoll version: 0.20.0
MPD supported tags: Artist ArtistSort Album AlbumSort AlbumArtist AlbumArtistSort Title Track Name Genre Date Composer Performer Disc MUSICBRAINZ_ARTISTID MUSICBRAINZ_ALBUMID MUSICBRAINZ_ALBUMARTISTID MUSICBRAINZ_TRACKID MUSICBRAINZ_RELEASETRACKID
myMPD enabled tags: Artist Album AlbumArtist Title Track Genre Date Composer Performer
Updated myMPDsmart-mostPlayed with 22 songs, minValue: 2
Updated myMPDsmart-bestRated with 2 songs, minValue: 2
MPD X: Connection closed by the server
Updated myMPDsmart-newestSongs with 0 songs, minValue: -604800
MPD connection failed.
MPD Connecting to 127.0.0.1:6600
MPD connected.
MPD protocoll version: 0.20.0
MPD supported tags: Artist ArtistSort Album AlbumSort AlbumArtist AlbumArtistSort Title Track Name Genre Date Composer Performer Disc MUSICBRAINZ_ARTISTID MUSICBRAINZ_ALBUMID MUSICBRAINZ_ALBUMARTISTID MUSICBRAINZ_TRACKID MUSICBRAINZ_RELEASETRACKID
myMPD enabled tags: Artist Album AlbumArtist Title Track Genre Date Composer Performer
Updated myMPDsmart-mostPlayed with 22 songs, minValue: 2
Updated myMPDsmart-bestRated with 2 songs, minValue: 2
MPD X: Connection closed by the server
Updated myMPDsmart-newestSongs with 0 songs, minValue: -604800
MPD connection failed.
MPD Connecting to 127.0.0.1:6600
MPD connected.
MPD protocoll version: 0.20.0
MPD supported tags: Artist ArtistSort Album AlbumSort AlbumArtist AlbumArtistSort Title Track Name Genre Date Composer Performer Disc MUSICBRAINZ_ARTISTID MUSICBRAINZ_ALBUMID MUSICBRAINZ_ALBUMARTISTID MUSICBRAINZ_TRACKID MUSICBRAINZ_RELEASETRACKID
myMPD enabled tags: Artist Album AlbumArtist Title Track Genre Date Composer Performer
Updated myMPDsmart-mostPlayed with 22 songs, minValue: 2
Updated myMPDsmart-bestRated with 2 songs, minValue: 2
MPD X: Connection closed by the server
Updated myMPDsmart-newestSongs with 0 songs, minValue: -604800
MPD connection failed.
MPD Connecting to 127.0.0.1:6600
MPD connected.
MPD protocoll version: 0.20.0
MPD supported tags: Artist ArtistSort Album AlbumSort AlbumArtist AlbumArtistSort Title Track Name Genre Date Composer Performer Disc MUSICBRAINZ_ARTISTID MUSICBRAINZ_ALBUMID MUSICBRAINZ_ALBUMARTISTID MUSICBRAINZ_TRACKID MUSICBRAINZ_RELEASETRACKID
myMPD enabled tags: Artist Album AlbumArtist Title Track Genre Date Composer Performer
Updated myMPDsmart-mostPlayed with 22 songs, minValue: 2
Updated myMPDsmart-bestRated with 2 songs, minValue: 2
MPD X: Connection closed by the server
Updated myMPDsmart-newestSongs with 0 songs, minValue: -604800
MPD connection failed.
MPD Connecting to 127.0.0.1:6600
MPD connected.
MPD protocoll version: 0.20.0
MPD supported tags: Artist ArtistSort Album AlbumSort AlbumArtist AlbumArtistSort Title Track Name Genre Date Composer Performer Disc MUSICBRAINZ_ARTISTID MUSICBRAINZ_ALBUMID MUSICBRAINZ_ALBUMARTISTID MUSICBRAINZ_TRACKID MUSICBRAINZ_RELEASETRACKID
myMPD enabled tags: Artist Album AlbumArtist Title Track Genre Date Composer Performer
Updated myMPDsmart-mostPlayed with 22 songs, minValue: 2
Updated myMPDsmart-bestRated with 2 songs, minValue: 2
MPD X: Connection closed by the server
Updated myMPDsmart-newestSongs with 0 songs, minValue: -604800
MPD connection failed.
MPD Connecting to 127.0.0.1:6600
MPD connected.
MPD protocoll version: 0.20.0
MPD supported tags: Artist ArtistSort Album AlbumSort AlbumArtist AlbumArtistSort Title Track Name Genre Date Composer Performer Disc MUSICBRAINZ_ARTISTID MUSICBRAINZ_ALBUMID MUSICBRAINZ_ALBUMARTISTID MUSICBRAINZ_TRACKID MUSICBRAINZ_RELEASETRACKID
myMPD enabled tags: Artist Album AlbumArtist Title Track Genre Date Composer Performer
Updated myMPDsmart-mostPlayed with 22 songs, minValue: 2
Updated myMPDsmart-bestRated with 2 songs, minValue: 2
MPD X: Connection closed by the server
Updated myMPDsmart-newestSongs with 0 songs, minValue: -604800
MPD connection failed.
MPD Connecting to 127.0.0.1:6600
MPD connected.
MPD protocoll version: 0.20.0
MPD supported tags: Artist ArtistSort Album AlbumSort AlbumArtist AlbumArtistSort Title Track Name Genre Date Composer Performer Disc MUSICBRAINZ_ARTISTID MUSICBRAINZ_ALBUMID MUSICBRAINZ_ALBUMARTISTID MUSICBRAINZ_TRACKID MUSICBRAINZ_RELEASETRACKID
myMPD enabled tags: Artist Album AlbumArtist Title Track Genre Date Composer Performer
Updated myMPDsmart-mostPlayed with 22 songs, minValue: 2
Updated myMPDsmart-bestRated with 2 songs, minValue: 2
MPD X: Connection closed by the server
Updated myMPDsmart-newestSongs with 0 songs, minValue: -604800
MPD connection failed.
MPD Connecting to 127.0.0.1:6600
MPD connected.
MPD protocoll version: 0.20.0
MPD supported tags: Artist ArtistSort Album AlbumSort AlbumArtist AlbumArtistSort Title Track Name Genre Date Composer Performer Disc MUSICBRAINZ_ARTISTID MUSICBRAINZ_ALBUMID MUSICBRAINZ_ALBUMARTISTID MUSICBRAINZ_TRACKID MUSICBRAINZ_RELEASETRACKID
myMPD enabled tags: Artist Album AlbumArtist Title Track Genre Date Composer Performer
Updated myMPDsmart-mostPlayed with 22 songs, minValue: 2
Updated myMPDsmart-bestRated with 2 songs, minValue: 2
MPD X: Connection closed by the server
Updated myMPDsmart-newestSongs with 0 songs, minValue: -604800
MPD connection failed.
MPD Connecting to 127.0.0.1:6600
MPD connected.
MPD protocoll version: 0.20.0
MPD supported tags: Artist ArtistSort Album AlbumSort AlbumArtist AlbumArtistSort Title Track Name Genre Date Composer Performer Disc MUSICBRAINZ_ARTISTID MUSICBRAINZ_ALBUMID MUSICBRAINZ_ALBUMARTISTID MUSICBRAINZ_TRACKID MUSICBRAINZ_RELEASETRACKID
myMPD enabled tags: Artist Album AlbumArtist Title Track Genre Date Composer Performer
Updated myMPDsmart-mostPlayed with 22 songs, minValue: 2
Updated myMPDsmart-bestRated with 2 songs, minValue: 2
MPD X: Connection closed by the server
Updated myMPDsmart-newestSongs with 0 songs, minValue: -604800
MPD connection failed.
MPD Connecting to 127.0.0.1:6600
MPD connected.
MPD protocoll version: 0.20.0
MPD supported tags: Artist ArtistSort Album AlbumSort AlbumArtist AlbumArtistSort Title Track Name Genre Date Composer Performer Disc MUSICBRAINZ_ARTISTID MUSICBRAINZ_ALBUMID MUSICBRAINZ_ALBUMARTISTID MUSICBRAINZ_TRACKID MUSICBRAINZ_RELEASETRACKID
myMPD enabled tags: Artist Album AlbumArtist Title Track Genre Date Composer Performer
Updated myMPDsmart-mostPlayed with 22 songs, minValue: 2
Updated myMPDsmart-bestRated with 2 songs, minValue: 2
MPD X: Connection closed by the server
Updated myMPDsmart-newestSongs with 0 songs, minValue: -604800
MPD connection failed.
MPD Connecting to 127.0.0.1:6600
MPD connected.
MPD protocoll version: 0.20.0
MPD supported tags: Artist ArtistSort Album AlbumSort AlbumArtist AlbumArtistSort Title Track Name Genre Date Composer Performer Disc MUSICBRAINZ_ARTISTID MUSICBRAINZ_ALBUMID MUSICBRAINZ_ALBUMARTISTID MUSICBRAINZ_TRACKID MUSICBRAINZ_RELEASETRACKID
myMPD enabled tags: Artist Album AlbumArtist Title Track Genre Date Composer Performer
Updated myMPDsmart-mostPlayed with 22 songs, minValue: 2
Updated myMPDsmart-bestRated with 2 songs, minValue: 2
MPD X: Connection closed by the server
Updated myMPDsmart-newestSongs with 0 songs, minValue: -604800
MPD connection failed.
zsh: segmentation fault sudo ./mympd /etc/mympd/mympd.conf

@jcorporation
Copy link
Owner

All directories and files under /var/lib/mympd must be writeable by your mympd user.
chown -R nobody /var/lib/mympd should do the trick.

MPD X: Connection closed by the server
Updated myMPDsmart-newestSongs with 0 songs, minValue: -604800

It seems that myMPD can't get the last-modified value from songs in your database.
I think it was a bug in querying the database. In devel I fixed this, by testing of the returned entity type. Can you test it again?

@john-
Copy link
Author

john- commented Oct 7, 2018

git log
commit dab83d0 (HEAD -> devel, origin/devel)
Author: jcorporation
Date: Sun Oct 7 23:21:44 2018 +0100

Fix: test of entity type in mympd_smartpls_update_newest

Installing this version seemed to change my perms...so:

sudo chown -R nobody /var/lib/mympd

Results are different with this version (emphasis added on first error occurrence):

sudo ./mympd /etc/mympd/mympd.conf

[snip a bunch of repeated attempts; leave some in]

MPD Connecting to 127.0.0.1:6600
MPD connected.
MPD protocoll version: 0.20.0
MPD supported tags: Artist ArtistSort Album AlbumSort AlbumArtist AlbumArtistSort Title Track Name Genre Date Composer Performer Disc MUSICBRAINZ_ARTISTID MUSICBRAINZ_ALBUMID MUSICBRAINZ_ALBUMARTISTID MUSICBRAINZ_TRACKID MUSICBRAINZ_RELEASETRACKID
myMPD enabled tags: Artist Album AlbumArtist Title Track Genre Date Composer Performer
Updated myMPDsmart-mostPlayed with 22 songs, minValue: 2
Updated myMPDsmart-bestRated with 2 songs, minValue: 2
MPD X: Connection closed by the server
Error updating myMPDsmart-newestSongs
MPD connection failed.
MPD Connecting to 127.0.0.1:6600
MPD connected.
MPD protocoll version: 0.20.0
MPD supported tags: Artist ArtistSort Album AlbumSort AlbumArtist AlbumArtistSort Title Track Name Genre Date Composer Performer Disc MUSICBRAINZ_ARTISTID MUSICBRAINZ_ALBUMID MUSICBRAINZ_ALBUMARTISTID MUSICBRAINZ_TRACKID MUSICBRAINZ_RELEASETRACKID
myMPD enabled tags: Artist Album AlbumArtist Title Track Genre Date Composer Performer
Updated myMPDsmart-mostPlayed with 22 songs, minValue: 2
Updated myMPDsmart-bestRated with 2 songs, minValue: 2
MPD X: Connection closed by the server
Error updating myMPDsmart-newestSongs
MPD connection failed.
MPD Connecting to 127.0.0.1:6600
MPD connected.
MPD protocoll version: 0.20.0
MPD supported tags: Artist ArtistSort Album AlbumSort AlbumArtist AlbumArtistSort Title Track Name Genre Date Composer Performer Disc MUSICBRAINZ_ARTISTID MUSICBRAINZ_ALBUMID MUSICBRAINZ_ALBUMARTISTID MUSICBRAINZ_TRACKID MUSICBRAINZ_RELEASETRACKID
myMPD enabled tags: Artist Album AlbumArtist Title Track Genre Date Composer Performer
Updated myMPDsmart-mostPlayed with 22 songs, minValue: 2
Updated myMPDsmart-bestRated with 2 songs, minValue: 2
MPD X: Connection closed by the server
Error updating myMPDsmart-newestSongs
MPD connection failed.
MPD Connecting to 127.0.0.1:6600
MPD connected.
MPD protocoll version: 0.20.0
MPD supported tags: Artist ArtistSort Album AlbumSort AlbumArtist AlbumArtistSort Title Track Name Genre Date Composer Performer Disc MUSICBRAINZ_ARTISTID MUSICBRAINZ_ALBUMID MUSICBRAINZ_ALBUMARTISTID MUSICBRAINZ_TRACKID MUSICBRAINZ_RELEASETRACKID
myMPD enabled tags: Artist Album AlbumArtist Title Track Genre Date Composer Performer
Updated myMPDsmart-mostPlayed with 22 songs, minValue: 2
Updated myMPDsmart-bestRated with 2 songs, minValue: 2
MPD X: Connection closed by the server
Error updating myMPDsmart-newestSongs
MPD connection failed.
zsh: segmentation fault sudo ./mympd /etc/mympd/mympd.conf

@jcorporation
Copy link
Owner

Can you run mpd with verbose logging enabled and post the messages of mpd.log?

@john-
Copy link
Author

john- commented Oct 7, 2018

Attached is from the first (and only time) I attempted to start myMPD after starting mpd:

mpd.log

@jcorporation
Copy link
Owner

The error in the log file is:

Oct 07 18:53 : client: [1] process command "listallinfo "/""
Oct 07 18:53 : exception: error on client 1: Output buffer is full

myMPD is iterating through all songs to find the last-modified songs. It seems this doesn't work on very large databases.

myMPD 4.3.1 will use a better approach to find the newest songs in database. In the meanwhile you can delete /var/lib/mympd/smartpls/myMPDsmart-newestSongs to use myMPD.

Hopefully myMPD 4.3.1 will be released in this week.

@jcorporation
Copy link
Owner

The last commit should fixes your issue. Please reopen this issue, if not.

@john-
Copy link
Author

john- commented Oct 8, 2018

That fixed it...thanks!

Here is the startup:

sudo ./mympd /etc/mympd/mympd.conf
Parsing config file: /etc/mympd/mympd.conf
Starting myMPD 4.3.1
Droping privileges to nobody
Document root: "/usr/share/mympd/htdocs"
Temp dir: "/var/lib/mympd/tmp"
Smartpls dir: "/var/lib/mympd/smartpls"
State dir: "/var/lib/mympd/state"
Reading states
Listening on http port 8081
MPD Connecting to 127.0.0.1:6600
MPD connected.
MPD protocoll version: 0.20.0
MPD supported tags: Artist ArtistSort Album AlbumSort AlbumArtist AlbumArtistSort Title Track Name Genre Date Composer Performer Disc MUSICBRAINZ_ARTISTID MUSICBRAINZ_ALBUMID MUSICBRAINZ_ALBUMARTISTID MUSICBRAINZ_TRACKID MUSICBRAINZ_RELEASETRACKID
myMPD enabled tags: Artist Album AlbumArtist Title Track Genre Date Composer Performer
Updated myMPDsmart-mostPlayed with 22 songs, minValue: 2
Updated myMPDsmart-bestRated with 2 songs, minValue: 2
Updated myMPDsmart-newestSongs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants