Closed fatonsopa closed 6 years ago
FYI.
Just tested, when I run "node socket.js" in terminal and run a deploy i see that the socket is receiving message from deployment as:
Message received from event REBELinBLUE\Deployer\Events\ServerLogChanged to channel serverlog Message received from event REBELinBLUE\Deployer\Events\ModelChanged to channel deployment Message received from event REBELinBLUE\Deployer\Events\ModelChanged to channel project
However, i still get the "Server error" on deployer
Sorry for the late reply. It looks to me that port 6001 is being blocked by your host
On your machine (not the server) you can try connecting to the port with telnet
$ telnet hostname 6001
You should see something like
Trying ::1...
Connected to localhost.
Escape character is '^]'.
if it is blocked you'll get telnet: Unable to connect to remote host: Connection refused
You could try changing the port, just need to edit the value in .env
and then restart the node server.
However, you might want to try proxying the request to the socket server so that it the frontend can connect from port 80 (this is how the nginx config works by default)
Here is how you do it in Apache, although I've never tried https://stackoverflow.com/questions/36472920/apache-proxy-configuration-for-socket-io-project-not-in-root
Hi,
Thanks for the reply :)
Here is what I get:
Refreshs-MacBook-Pro:~ sopa$ telnet {IP} 6001 Trying {IP}... telnet: connect to address {IP}: Connection refused telnet: Unable to connect to remote host Refreshs-MacBook-Pro:~ sopa$
I'm going to try the port change and proxy (I"m using Apache) and than see the result.
Thanks.
Sorry, what I put hostname I meant to replace it with the hostname, i.e. from your example
$ telnet deployer.xx.xx 6001
Hi,
Following your suggestions:
Refreshs-MacBook-Pro:~ sopa$ telnet deployer.site.com 8080 Trying 104.27.183.175... Connected to deployer.site.com. Escape character is '^]'.
supervisor
sysuer@linuxbox:/var/www/html/deployer$ sudo service supervisor start Starting supervisor: 2018-02-06 15:33:39,508 CRIT Supervisor running as root (no user in config file) 2018-02-06 15:33:39,508 WARN Included extra file "/etc/supervisor/conf.d/deployer.conf" during parsing 2018-02-06 15:33:39,510 INFO supervisord started with pid 7717 2018-02-06 15:33:40,513 INFO spawned: 'queue_2' with pid 7757 2018-02-06 15:33:40,516 INFO spawned: 'queue_1' with pid 7758 2018-02-06 15:33:40,519 INFO spawned: 'queue_0' with pid 7759 2018-02-06 15:33:40,522 INFO spawned: 'deployer-broadcast' with pid 7760 2018-02-06 15:33:40,523 INFO spawned: 'deployer-socketio' with pid 7761 2018-02-06 15:33:42,132 INFO success: queue_2 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) 2018-02-06 15:33:42,132 INFO success: queue_1 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) 2018-02-06 15:33:42,132 INFO success: queue_0 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) 2018-02-06 15:33:42,132 INFO success: deployer-broadcast entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) 2018-02-06 15:33:42,132 INFO success: deployer-socketio entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
package.json
... "scripts": { "start": "PORT=8080 node socket.js", "postinstall": "touch ./node_modules/.install" }
env
... SOCKET_URL:http://deployer.site.com:8080 SOCKET_PORT=8080 ....
Im just blocked!!
The other alternative didn't work :(
This is really odd, can you show me the headers tab?
Also I see the connection is appearing multiple times on the left pane there, do any of those look any different?
Also, can you try setting APP_DEBUG
in the .env
to true and run the node server manually then try again, should log some additional info to the terminal output then
here is the headers tab
(do any of those look any different?): They are the same: only the "Sec-WebSocket-Key" is different
The debug is now true. here is what I'm getting
root@linuxbox:/var/www/html/deployer# npm start > deployer@ start /var/www/html/deployer > PORT=8080 node socket.js Server is running on port: 8080 psubscribe
You don't need the PORT
in the package.json, in fact it is SOCKET_PORT
But that is neither here not there. So the server appears to be running successfully but the client is failing to connect. Could you try setting these variables https://socket.io/docs/logging-and-debugging/ ?
Hi @REBELinBLUE ,
Sorry for late response. I was completely out of this for some time.
Thanks for the debugging info.
This is the log I was able to produce on the console.
These logs are only being repeated (in a loop)
I installed Deployer on a local computer (while on dynamic IP, and set domain in /etc/hosts) and everything was working fine. However, when I put the static IP address on the Ethernet Network Connection, sockets don't work anymore. I talked to ISP and they confirmed that none of ports are blocked from their side.
I'm trying to figure out if It has to do with port or number of connections
For anyone experiencing this issue.
I was able to solve it by adding the following piece of lines in /etc/hosts
{MY_IP} deployer.mysite.com
This is strange because deployer.site.com domain points to the same IP Address as the one that I added on /etc/hosts on the same server.
It may be that port 6001 is blocked by cloudflare, so by adding the IP address to /etc/hosts I'm bypassing cloudflare's ip addresses and connecting directly to my host.
Cheers :)
Hmm, that is very odd. Maybe cloudflare is blocking port 6001, I shall have to set up a free account to try it out
Yes, confirmed. Cloudflare is blocking 6001 port. I used server's IP address instead of our domain, and the socket is working like a charm now
Thanks :)
HI,
Just installed the deployer on our local server. Everything else seems to work as expected beside socket. The message I'm getting is:
I researched for the error on google and none of the solutions seems to work for me.
Expected behaviour
Make the deploy
Actual behaviour
A connection could not be established to the socket at http://deployer.xx.xx:6001. This is required for reporting the status on running deployments. Please reload, if the issue continues please contact the system administrator
Steps to reproduce
Add a project Add server Deploy a project
Environment info
project path
/var/www/html/deployer
my deployer.conf
ps aux
IP Listen
supervisord.lo empty
deployer-socket-stdout.log empty
deployer-broadcast-stdout.log
$ sudo netstat -peanut | grep ":6001"