Error during WebSocket handshake
Hi! I'm install Gekko on debian VM and configure nginx as described here: https://gekko.wizb.it/docs/installation/installing_gekko_on_a_server.html
But only for websocket requests i got this: WebSocket connection to 'wss://192.168.1.139/api/' failed: Error during WebSocket handshake: Unexpected response code: 404 reconnecting-websocket.min.js: formatted:46
pls, help me with this beautiful this project
The response is 404, which means wss://192.168.1.139/api/ resolves to a server (most likely NGINX) but NGINX does not know how to properly upstream it. The IP address sounds like you are running Gekko in a local network. Can you try connecting to Gekko without NGINX?
I deploy gekko to VM, all working fine when inside VM, but when i try connect from host - UI working fine, ws request failing with error above
my nginx config
gekko vue UIconfig
Your config looks fine, it might be a problem with your VM environment. What kind of VM software are you using?
EDIT:
Actually, can you change this:
upstream websocket {
server localhost:3000;
}
to:
upstream websocket {
server http://localhost:3000;
}
Hypper-V on windows 10, Debian 8 on VM
Nevermind my previous EDIT, do you have access to nginx logs? Usually they are stored in /var/log/nginx/access.log and /var/log/nginx/error.log. They might have more information about why NGINX is returning a 404.
errors
access

So the error log is saying that the connection was refused by http://127.0.0.1/api/. Which seems to indicate a problem with the Gekko server not listening. If you run the following command:
sudo netstat -pantu
Do you see anything listening on part 3000?
Hmmm, should i run 2 gekko instances for api and ui?
after i run "node gekko --ui" netstat:

also host in the ui should be set to server name as per your nginx conf as server_name
const CONFIG = {
headless: true,
api: {
host: '127.0.0.1',
port: 3000,
},
ui: {
ssl: true,
host: 'some.server.name',
port: 443,
path: '/'
},
adapter: 'postgresql'
}
if(typeof window === 'undefined')
module.exports = CONFIG;
else
window.CONFIG = CONFIG;
You need to run gekko once (node gekko --ui), but it needs to keep running.
So when it was not working, you still had it running?
On May 21, 2017 14:30, "generalectric" [email protected] wrote:
also host in the ui should be set to server name as per your nginx conf as server_name
const CONFIG = { headless: true, api: { host: '127.0.0.1', port: 3000, }, ui: { ssl: true, host: 'some.server.name', port: 443, path: '/' }, adapter: 'postgresql' }
if(typeof window === 'undefined') module.exports = CONFIG; else window.CONFIG = CONFIG;
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/askmike/gekko/issues/752#issuecomment-302936807, or mute the thread https://github.com/notifications/unsubscribe-auth/AA7MD7ge7Fk0UWUGDtqPcoVghGhZ-9kHks5r8DxfgaJpZM4Ngzt0 .
when i try it all requests in my browser go to some.server.name and all failing when dns server on router can't resolve it
yes, i run one gekko instance in separate session
headless should be true... though i believe that just prevents a call for local browser open... and change some.server.name to 192.168.1.39 in both configs or set it to a domain name though you still need ports 80 and 443 forwarded to your local ip. is some.server.name a FQDN? looking at your error line server is blank
General: you don't need to specify a servername, if you don't use one nginx will always serve using that config. Also the error log states that nginx tried to upstream but could not. So the issue is between nginx and gekko.
So just to be clear: in the VM you can access the UI fine, but outside it (from the host) you cannot. Are both these situations using nginx? Are you able the use the UI from the host machine without nginx (by directly connecting to the UI)?
On May 21, 2017 14:48, "generalectric" [email protected] wrote:
headless should be true... though i believe that just prevents a call for local browser open... and change some.server.name to 192.168.1.39 in both configs or set it to a domain name though you still need ports 80 and 443 forwarded to your local ip. is some.server.name a FQDN? looking at your error line server is blank
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/askmike/gekko/issues/752#issuecomment-302937870, or mute the thread https://github.com/notifications/unsubscribe-auth/AA7MD4f1YFPHFfN3ycRTuFsbkW3KKF9Dks5r8ECegaJpZM4Ngzt0 .
and what is the result of netcat -v 127.0.0.1 3000
generalectric:

askmike:
yes, but i can't test all on VM - no UI, cli installation. From host not working only websocket communications. Js UI loaded fine, take a look gekko output:

Are you able the use the UI from the host machine without nginx (by directly connecting to the UI)?
How to check it?
Check here: https://gekko.wizb.it/docs/installation/installing_gekko_on_a_server.html#Configuring-Gekko-to-run-headless-in-a-trusted-environment
Follow the steps under "Configuring Gekko to run headless in a trusted environment" And not the ones under "Configuring Gekko to run in the cloud".