"You have no connection to mpd." even though when starting Groovebasin in console I get no errors #87

Closed
PonderingGrower opened this Issue Oct 16, 2012 · 44 comments

3 participants

@PonderingGrower

I've set up everything as you suggested and the only warning I get is the one about localhost. But I can't add bind_to_address "localhost" because I get:

Failed to bind to '127.0.0.1:6600': Address already in use

Everything seems start up fine but I still get "You have no connection to mpd." when I access the URL.

The hell?

@andrewrk
Owner

Are you sure there isn't something other than mpd already listening on 6600? Try lsof -i :6600.

@PonderingGrower

I already did that and with netstat. Nope. Nothing else is listening on that port when I start mpd. Not even some zombie mpd processes. When I just leave bind_to_address "any" it works flawlessly.

From a little bit of googling this seems to be an mpd bug. But I doubt that's the thing that stops me from accessing the groovebasin interface at all. After all I only need the localhost line for uploading right?

@andrewrk
Owner

Groove Basin wants both a socket connection for elevated permissions and a by-port connection for limited permissions which it shares with the browser. There are in-progress plans to make this setup easier, but for now that's how it is.

The relevant part from my /etc/mpd.conf looks like this:

# For network
bind_to_address     "localhost"
# And for Unix Socket
bind_to_address     "/home/andy/.mpd/socket"

Which version of mpd are you using?
Are you installing groove basin from npm or git?

@andrewrk
Owner

Also try to do this:

$ telnet localhost 6600
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
OK MPD 0.17.0
stats
artists: 27
albums: 20
songs: 121
uptime: 1269275
playtime: 3325
db_playtime: 46787
db_update: 1350309915
OK
^]

telnet> Connection closed.

If you can't do this, then mpd isn't running correctly.

@PonderingGrower

My version of mpd is 0.17.2 and I go groove basin from npm. I'll try git in a moment.

Also:

Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
OK MPD 0.17.0
stats
artists: 1318
albums: 1422
songs: 16068
uptime: 452
playtime: 0
db_playtime: 3936978
db_update: 1350234251
OK

Seems to work just fine with bind_to_address "any". This makes it even more likely that not being able to use bind_to_address "localhost" might be an mpd bug.

@andrewrk
Owner

According to your telnet paste, your version is 0.17.0. You might try upgrading to 0.17.2 and seeing if that solves the problem.

@andrewrk
Owner

Oops, I'm sorry. That appears to be an mpd bug as well, that it says the wrong version in the protocol.

@andrewrk
Owner

One thing you can try is just wait a while. If you have a large library and it takes a while for mpd to scan your entire library on startup, groove basin thinks it's not connected, but really it's just waiting on the scan.

@PonderingGrower

Right. I was just beginning to think my package manager(portage) was lying to me.

Also, how do I start the git downloaded version? npm doesn't want to start it.

And I don't see mpd scanning anything, I connected through ncmpcppcpcppcppppcpcpc and I don't see that it's updating. I've had the page open for good half an hour in one of the tabs and nothing changes.

@PonderingGrower

This is what I get from npm-debug.log. Is there some other recommended way of starting groove basin?

0 info it worked if it ends with ok
1 verbose cli [ 'node', '/usr/bin/npm', 'start', 'groovebasin' ]
2 info using npm@1.1.61
3 info using node@v0.9.2
4 verbose read json /home/sochan/node_modules/groovebasin/package.json
5 verbose run-script [ 'prestart', 'start', 'poststart' ]
6 info prestart groovebasin@0.1.2
7 info start groovebasin@0.1.2
8 verbose unsafe-perm in lifecycle true
9 silly exec sh "-c" "naught start lib/server.js"
10 silly sh,-c,naught start lib/server.js,/home/sochan/node_modules/groovebasin spawning
11 info groovebasin@0.1.2 Failed to exec start script
12 error groovebasin@0.1.2 start: naught start lib/server.js
12 error sh "-c" "naught start lib/server.js" failed with 127
13 error Failed at the groovebasin@0.1.2 start script.
13 error This is most likely a problem with the groovebasin package,
13 error not with npm itself.
13 error Tell the author that this fails on your system:
13 error naught start lib/server.js
13 error You can get their info via:
13 error npm owner ls groovebasin
13 error There is likely additional logging output above.
14 error System Linux 3.6.2-gentoo
15 error command "node" "/usr/bin/npm" "start" "groovebasin"
16 error cwd /home/sochan
17 error node -v v0.9.2
18 error npm -v 1.1.61
19 error code ELIFECYCLE
20 verbose exit [ 1, true ]

Btw, how do I put all this messy stuff in a nice box as you did in one of the comments?

EDIT: close enough

@andrewrk
Owner

There's a link at the top right of the comment box that tells you how.

Hang on for a couple minutes. I'm going to go ahead and make a release of master. It's been a long time.

@PonderingGrower

Sure thing man, nice of you to respond so quickly and seriously to me issue.

I already tried to run groove basin a long time ago but then I just gave up after maybe half an hour of trying and googling. Now I stream my music to work from my home server and I would like to give my coworkers access to the player as well. You web frontend looked the most clean and functional out of the whole mess(client175 is nice too) that is mpd web frontends.

@andrewrk
Owner

OK try installing from npm now. Be sure to remove any lingering old version first.

npm remove groovebasin
sudo npm remove -g groovebasin

(that was just in case)

npm install --production groovebasin
npm start groovebasin

If you get a bunch of errors, ctrl+c then do

npm stop groovebasin
vim -p ~/node_modules/groovebasin/*.log
@andrewrk
Owner

Thanks for the compliment, btw.

@PonderingGrower

Interesting, now it demonizes by default. No errors, although I am wondering why it disregarded my setting and started on port 16242 instead of the one I set in .npmrc.

Also, it seems to be stuck at "Loading..." now when I open the url.

@PonderingGrower

Wait, I did find some errors in stderr.log

http.js:644
throw new Error('Can\'t set headers after they are sent.');
^
Error: Can't set headers after they are sent.
at ServerResponse.OutgoingMessage.setHeader (http.js:644:11)
at ServerResponse.res.setHeader (/home/sochan/node_modules/groovebasin/node_modules/express/node_modules>/connect/lib/patch.js:59:22)
at SendStream.type (/home/sochan/node_modules/groovebasin/node_modules/express/node_modules/connect/node_modules/send/lib/send.js:444:7)
at SendStream.send (/home/sochan/node_modules/groovebasin/node_modules/express/node_modules/connect/node_modules/send/lib/send.js:343:8)
at /home/sochan/node_modules/groovebasin/node_modules/express/node_modules/connect/node_modules/send/lib/send.js:319:10
at Object.oncomplete (fs.js:308:15)
at process._makeCallback (node.js:248:20)

@andrewrk
Owner

Check the README - in this release variables are set with environment variables.

@PonderingGrower

Well, I'll be working on this tomorrow as well most probably. For now I feel like it's time for sleep.

Thanks a bunch for your help.

@PonderingGrower

Oh, one last question, do you now of any way to run groove basin under some standard webserver like nginx for example or did you make it with only npm in mind?

@andrewrk
Owner

I'm curious, what does running it under nginx give you?

It is running behind naught, which provides stability and daemonization.

Using nginx breaks uploading and long lived connections, which makes for a poor experience.

@PonderingGrower

Looks like I can't sleep because I got my Raspberry Pi today after 4 months or so of waiting.

And I was just wondering. Running it under naught just mean I'll probably have to write another service script to run it at startup. It's just another service I have to worry about. I prefer to keep things simple.

Uploading is not an issue since all my colleagues at work will be allowed to do is browse and queue the playlist and manage playback. Nothing more. Although I haven't heard about that issue with long lived connections, I'll have to google that one.

@PonderingGrower

Now it seems to be throwing a hissing fit and keeps shouting:

node.js:641
var cwd = process.cwd();
^
Error: ENOENT, no such file or directory
at Function.startup.resolveArgv0 (node.js:641:23)
at startup (node.js:55:13)
at node.js:732:3

And the url gives me a black page that keeps loading.

@andrewrk
Owner

Try this:

npm stop groovebasin
cd ~/node_modules/groovebasin
node lib/server.js
@PonderingGrower

warn - error raised: Error: listen EADDRINUSE

This is the only thing out of the ordinary.

stderr.log keeps getting spammed with the same error.

@andrewrk
Owner
@PonderingGrower

Yup, that was it. Now I'm back to the good old:

Error: Can't set headers after they are sent.
at ServerResponse.OutgoingMessage.setHeader (http.js:644:11)
at ServerResponse.res.setHeader (/home/sochan/node_modules/groovebasin/node_modules/express/node_modules/connect/lib/patch.js:59:22)
at SendStream.type (/home/sochan/node_modules/groovebasin/node_modules/express/node_modules/connect/node_modules/send/lib/send.js:444:7)
at SendStream.send (/home/sochan/node_modules/groovebasin/node_modules/express/node_modules/connect/node_modules/send/lib/send.js:343:8)
at /home/sochan/node_modules/groovebasin/node_modules/express/node_modules/connect/node_modules/send/lib/send.js:319:10
at Object.oncomplete (fs.js:308:15)
at process._makeCallback (node.js:248:20)

@andrewrk
Owner

Hmm. Can you give more clues about your environment? I just tried it on several computers and it worked OK.

@PonderingGrower

It's a gentoo installation, completely up to date. My nodejs version is 0.9.2. My jre is icedtea in version 6.1.11.4.

Tomorrow I'll test groove basin at some pcs at work and at another pc here at home. We'll see what makes the difference. For now thank you very much for your help. Sorry I took so much of your time.

@andrewrk
Owner

OK. I'm testing on Ubuntu 12.04 with nodejs version 0.8.12. I'll look into using a gentoo VM and duplicating the issue.

@andrewrk
Owner

I hope we can get it working for you - I'd love to have you as a user.

@PonderingGrower

Yesterday I managed to test a few more things. I upgraded Icedtea to version 7.2.3.2 which did nothing. I also tried switching to sun-jdk and oracle-jdk. All gave me the same errors so I doubt it's related to jre version.

I'll do some work-stuff and then try some more things.

@andrewrk
Owner

The JRE is irrelevant. This project depends only on node.js and mpd.

@PonderingGrower

Okay, I downgraded to 0.8.12 as you said you use that version and the errors from stderr.log are gone, but I'm still only getting "Loading..." on the site.

@andrewrk
Owner

I downloaded a Gentoo image and I have it running in VirtualBox. I have a long day of work ahead of me today, but after that, I'm going to try to duplicate the issue and fix it.

@PonderingGrower

Damn, you are fast.

If you need any help with gentoo just contact me at panswiata [at] gmail.com.

@deff

Hi, exactly the same issue here.
I m running under debian wheezie on arm5 kirkwood ( dockstar )
running node js 9.1 prev
http.js:644
throw new Error('Can\'t set headers after they are sent.');
^
Error: Can't set headers after they are sent.
at ServerResponse.OutgoingMessage.setHeader (http.js:644:11)
at ServerResponse.res.setHeader (/root/node_modules/groovebasin/node_modules/express/node_modules/connect/lib/patch.js:59:22)
at SendStream.type (/root/node_modules/groovebasin/node_modules/express/node_modules/connect/node_modules/send/lib/send.js:444:7)
at SendStream.send (/root/node_modules/groovebasin/node_modules/express/node_modules/connect/node_modules/send/lib/send.js:343:8)
at SendStream.pipe (/root/node_modules/groovebasin/node_modules/express/node_modules/connect/node_modules/send/lib/send.js:319:10)
at Object.oncomplete (fs.js:297:15)
at process.startup.processMakeCallback.process._makeCallback (node.js:238:20)
i got 👍

I noticed the topic on Nginx, well on of the answers is nginx allow you passthrough proxy based on wildcard , that might exist on node but i guess it s a lot less documented, and if you have already a website it s a lot easier to just add a new wildcard with a dns redirect on the ip : my.site.com :ip , my.music.com sameip - get different website.

back to the error i m ok to image my server or let you total ssh acces on it since it s a dev one. you can just pm me and i will give you adress and credentials if you want to check live.

@deff

btw , your work here is awsome, if you come in france free beer on me and i might throw you a headless server with your work on it

@andrewrk
Owner
@deff

Hi! the issue is resolved on my side, I have good and bad news.
Good news since your last update, groovebasin works on armv5t.
Bad news, it seems to be uncompatible with the next release of node, I had to compil back to 0.8.12 to have it running.
keep up your awesome work.

@PonderingGrower

Hi,

I downgraded to 0.8.12 as well and now I'm getting something slightly different. The website just shows "mpd is not running on the server." while the mpd daemon stops responding.

The thing is it is still running and if I set the logging level to "verbose" mpd.log gets filled with:

database: get song: [path to the song]

A lot of these lines. And I mean A LOT.

Is this normal?

@deff
@PonderingGrower

I'm not asking you for help man, I'm just adding comments to this bug reports in regards to downgrading to 0.8.12 based on your last comment. I'm pretty sure superjoe30 will know right away if groove basin should be doing that to mpd when connecting for the first time or something like that.

@deff

Just offering. None offense given or taken, I was wondering about mpd.conf, and network when i rode your message because it is a bit vague. Again, just saying it might be useful to try gmpc for diagnostic purpose to see if mpd is reachable.

"database: get song" seems to be related to the last playlist you had in mpd and not related to grvbsn

here's my log:
""
""
""
database: get song: Rise Against/Siren Song of the Counter Culture/QZLZ.mp3
inotify: initializing inotify /// related to library update i guess
inotify: watching music directory
/// npm start groovebasin :
client: [0] opened from localhost
client: [0] process command "listallinfo"
client: [0] buffer created
client: [0] buffer empty 0
client: [0] buffer created
client: [0] command returned 0
client: [0] buffer empty 0
client: [0] process command "idle"
client: [0] command returned 1
client: [0] buffer created
client: [0] process command "status"
client: [0] command returned 0
client: [0] process command "idle"
client: [0] command returned 1
client: [0] process command "currentsong"
client: [0] command returned 0
client: [0] process command "idle"
client: [0] command returned 1
client: [0] process command "playlistinfo"
client: [0] command returned 0
client: [0] process command "idle"
client: [0] command returned 1
client: [0] process command "listplaylists"
client: [0] command returned 0
client: [0] process command "idle"
client: [0] command returned 1
client: [0] process command "password "*-*""
client: [0] command returned 0
client: [0] process command "idle"
client: [0] command returned 1
client: [0] buffer empty 0

so if there s no client stuff it seems to mean either your mpd daemon died before groovebasin started or groovebasin never connected.
On that I'm out.
hf&gl

@andrewrk
Owner

groove basin no longer depends on mpd.

@andrewrk andrewrk closed this Oct 4, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment