jansmolders86 / mediacenterjs

A HTML/CSS/Javascript (NodeJS) based Media center
http://mediacenterjs.com
1.29k stars 243 forks source link

Socket.io keeps getting connection refused #107

Closed TheSisb closed 10 years ago

TheSisb commented 10 years ago

In my console I see an error on all the sub-pages:

GET http://127.0.0.1:3001/socket.io/1/?t=1400285414613 net::ERR_CONNECTION_REFUSED 

Checking terminal where the server is running, I see:

Current version up to date.
Screen ready...
Database error: Error: near line 2: no such table: tvshows

/bin/sh: 1: node: not found

Metadata fetching for tv complete...
Child process exited for:  tv
Metadata fetcher error:  { [Error: Command failed: /bin/sh: 1: node: not found
] killed: false, code: 127, signal: null }
Database error: Error: near line 4: no such table: tvshows

Could not index any tv shows, please check given movie collection path...

Any ideas? I followed these instructions: https://github.com/jansmolders86/mediacenterjs/wiki/User-manual:---installing-MediacenterJS I'm installing and running on Ubuntu 14.04 and I opened up TCP/UDP 3000 / 3001

TheSisb commented 10 years ago

Solved it. My server is messed up and doesn't understand 127.0.0.1 for some weird reason. Replacing the JS with the domain worked lol.

jansmolders86 commented 10 years ago

I'm very glad you solved it. :) Thanks for trying the project!

TheSisb commented 10 years ago

Hey sorry I did more digging and I want to point something out. The reason my server didn't understand 127.0.0.1 was because that was a connection being attempted from my desktop machine through JS, while I had installed MediacenterJS on a different machine on another network. So my desktop was looking for a local socketio connection, not my server.

I will probably send a pull request replacing all those connections from 127.0.0.1 to document.domain shortly.

I also pasted some other code which is a log of some kind, it was a separate issue actually. My server didn't know what "node" was because on Ubuntu 14.04 installing through apt only creates the command "nodejs", so what I had to do to fix it was:

sudo ln -s /usr/bin/nodejs /usr/bin/node

Hope this helps others in the future trying to get it working remotely!

jansmolders86 commented 10 years ago

Thank you very much for elaborating. I built nodejs on my Ubuntu 14.04 hence being able to use node. I will add your virual link method to the faq for the time being. Thanks again for your time and effort!