andrewrk / groovebasin

Music player server with a web-based user interface.
MIT License
1.9k stars 119 forks source link

Not starting: events.js:72 throw er; #227

Closed NachoMas closed 10 years ago

NachoMas commented 10 years ago

Hi!

I'm stuck at a runtime error that I am not able to figure out. The build process worked flawlesly on a Ubuntu Trusty distrib... and when starting I get the following:

$ npm start

groovebasin@1.0.1 start /home/Groove_basin/groovebasin node lib/server.js

Player initialization complete. Listening at http://0.0.0.0:16242/

events.js:72 throw er; // Unhandled 'error' event ^ Error: listen EADDRINUSE at errnoException (net.js:904:11) at Server._listen2 (net.js:1042:14) at listen (net.js:1064:10) at net.js:1146:9 at dns.js:72:18 at process._tickCallback (node.js:415:13)

npm ERR! groovebasin@1.0.1 start: node lib/server.js npm ERR! Exit status 8 npm ERR! npm ERR! Failed at the groovebasin@1.0.1 start script. npm ERR! This is most likely a problem with the groovebasin package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node lib/server.js npm ERR! You can get their info via: npm ERR! npm owner ls groovebasin npm ERR! There is likely additional logging output above. npm ERR! System Linux 3.13.0-24-generic npm ERR! command "/usr/bin/node" "/usr/bin/npm" "start" npm ERR! cwd /home/Groove_basin/groovebasin npm ERR! node -v v0.10.26 npm ERR! npm -v 1.4.3 npm ERR! code ELIFECYCLE npm ERR! npm ERR! Additional logging details can be found in: npm ERR! /home/Groove_basin/groovebasin/npm-debug.log npm ERR! not ok code 0

I have checked whether there was something running on that port, but nothing shows up in netstat:

$ sudo netstat -n -p --tcp --listening Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:49045 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 18109/sshd
tcp 0 0 0.0.0.0:631 0.0.0.0:* LISTEN 23017/cupsd
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 2225/master
tcp 0 0 192.168.1.65:44733 0.0.0.0:* LISTEN 1015/java
tcp 0 0 0.0.0.0:46877 0.0.0.0:* LISTEN 764/rpc.statd
tcp 0 0 0.0.0.0:2049 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:58050 0.0.0.0:* LISTEN 1015/java
tcp 0 0 0.0.0.0:54978 0.0.0.0:* LISTEN 2040/rpc.mountd tcp 0 0 0.0.0.0:58051 0.0.0.0:* LISTEN 1015/java
tcp 0 0 127.0.0.1:10023 0.0.0.0:* LISTEN 1624/postgrey.pid - tcp 0 0 127.0.0.1:4200 0.0.0.0:* LISTEN 2369/shellinaboxd tcp 0 0 0.0.0.0:8200 0.0.0.0:* LISTEN 1992/minidlnad
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 1386/mysqld
tcp 0 0 0.0.0.0:50442 0.0.0.0:* LISTEN 2040/rpc.mountd tcp 0 0 0.0.0.0:5900 0.0.0.0:* LISTEN 24943/x11vnc
tcp 0 0 0.0.0.0:39695 0.0.0.0:* LISTEN 2040/rpc.mountd tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 756/rpcbind
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 2066/nginx
tcp 0 0 127.0.0.1:3632 0.0.0.0:* LISTEN 1875/distccd
tcp6 0 0 :::22 :::* LISTEN 18109/sshd
tcp6 0 0 :::631 :::* LISTEN 23017/cupsd
tcp6 0 0 :::25 :::* LISTEN 2225/master
tcp6 0 0 :::57724 :::* LISTEN 2040/rpc.mountd tcp6 0 0 :::59743 :::* LISTEN 2040/rpc.mountd tcp6 0 0 :::8000 :::* LISTEN 2338/mpd
tcp6 0 0 :::41537 :::* LISTEN -
tcp6 0 0 :::2049 :::* LISTEN -
tcp6 0 0 :::45127 :::* LISTEN 2040/rpc.mountd tcp6 0 0 :::6600 :::* LISTEN 2338/mpd
tcp6 0 0 :::55082 :::* LISTEN 764/rpc.statd
tcp6 0 0 :::5900 :::* LISTEN 24943/x11vnc
tcp6 0 0 :::111 :::* LISTEN 756/rpcbind
tcp6 0 0 :::80 :::* LISTEN 2066/nginx

So I'm lost about what the problem could be. Any ideas?

Thanks! /Ignacio

mynomoto commented 10 years ago

I read http://andrewkelley.me/post/quest-build-ultimate-music-player.html and got interested. So I went to AUR and installed the packages. It compiles ok but when I try to run I got the same error in this issue but with a shorter message:

events.js:72
        throw er; // Unhandled 'error' event
              ^
OpenError: IO error: lock groovebasin.db/LOCK: Resource temporarily unavailable
    at /usr/lib/node_modules/groovebasin/node_modules/level/node_modules/level-packager/node_modules/levelup/lib/levelup.js:114:34
TannerRogalsky commented 10 years ago

@NachoMas When I ran into a similar error it was because mpd was bound to a port that groove basin was trying to use. Try killing your instance of mpd and see if the error persists.

andrewrk commented 10 years ago

Edit the config.js file and change the mpdPort value from 6600 to 6601 or something like that.

mynomoto commented 10 years ago

Changing the port on config.js solved for me. mpdPort made no difference. Thanks @andrewrk

andrewrk commented 10 years ago

You sure about that? In your output, it says that the listen succeded for 16242 and threw an error before it printed "Listening on 6600". Furthermore it shows that MPD was listening on port 6600 in your netstat output.

Anyway, closing as this is working as designed.

NachoMas commented 10 years ago

Yes, sorry for the stupid bug! Changing the port (or stopping MPD) did the trick! Tx!

andrewrk commented 10 years ago

Oops I got you mixed up with @mynomoto . Anyway glad it's resolved.