Comments (7)
OK I found the problem:
my instance of deployer runs in HTTPS with Let's Encrypt on top of Nginx. Because of this, my socket URL into the .env file is https:// too.
But in socket.js, I found these lines:
if (/^https/i.test(process.env.SOCKET_URL)) {
const sslConfig = { ... }
}
So socket.io tries to create an SSL connection when Nginx is already handling this as a proxy.
The connection between Nginx and Socket.io is not supposed to use SSL, at least in my case because they use localhost, on the same server and because the 6001 port is closed in my firewall from the outside.
To fix it permanently, I guess there should be a new variable into the .env file:
SOCKET_SSL=true|false
and replace the previous source lines by:
if (process.env.SOCKET_SSL == true) {
const sslConfig = { ... }
}
That would allow users to choose whether Nginx or Socket.io should handle the SSL connection or not.
That is what I did on my side and it works just fine.
Thanks
from deployer.
I think you need to change your nginx config to use the IP, just 127.0.0.1 for the node server, not the hostname
from deployer.
oops, sorry just realised server
is just the server name, the upstream is the IP.
Hmm
from deployer.
Can you try starting the node server with DEBUG=*
https://socket.io/docs/logging-and-debugging/ and see if there is any additional output in the supervisor log
from deployer.
Thanks, I did not know that DEBUG=* thing
root@dev:/tank/www/deployer# DEBUG=* node socket.js
ioredis:redis status[127.0.0.1:6379]: [empty] -> connecting +0ms
socket.io:server initializing namespace / +0ms
socket.io-parser encoding packet {"type":0,"nsp":"/"} +0ms
socket.io-parser encoded {"type":0,"nsp":"/"} as 0 +0ms
socket.io:server creating engine.io instance with opts {"path":"/socket.io","initialPacket":["0"]} +1ms
socket.io:server attaching client serving req handler +9ms
socket.io:namespace removing initial packet +0ms
ioredis:redis queue command[0] -> psubscribe(*) +32ms
ioredis:redis status[127.0.0.1:6379]: connecting -> connect +4ms
ioredis:redis write command[0] -> info() +1ms
ioredis:redis status[127.0.0.1:6379]: connect -> ready +4ms
ioredis:connection send 1 commands in offline queue +0ms
ioredis:redis write command[0] -> psubscribe(*) +0ms
This line seems to be a problem:
ioredis:connection send 1 commands in offline queue +0ms
(it's red in the output).
Redis is running
Thanks
from deployer.
I forgot to mention that deployments ARE working though. I just need to reload the page to check the status.
from deployer.
Hmm, this is really odd. Is there anything in the Redis log?
Yeah, deployments will continue to work, the websocket is only used for broadcasting updates to the client instead of doing AJAX polling.
from deployer.
Related Issues (20)
- Deployment over 12 hours fails due to expired IdentityFile "no such identity" HOT 3
- how could i run "git clone" and "composer install" command on local machine HOT 1
- Installation not possible due to "Redis not running" HOT 2
- Commands drag and drop reordering doesn't work? HOT 1
- Whoops, looks like something went wrong. HOT 1
- Able to set PHP binary path on server
- Handle Unicode characters
- Migrating step of shared folder issues on shared filesystem
- preg_match: compilation failed error HOT 1
- Cannot use Deployer with submodules HOT 9
- queue:work no response
- Delete Group HOT 1
- Optional steps not run when triggered via Webhook
- A connection could not be established to the socket
- fetching of project not working from git server HOT 3
- Trying to get in touch regarding a security issue HOT 2
- rsync error for new deployment at Install Composer Dependencies step.
- 404 on laravel-migrate-fresh HOT 12
- Is this project dead? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from deployer.