Skip to content
This repository has been archived by the owner on Feb 16, 2020. It is now read-only.

Gekko 0.6 ui on server - Websocket disconnected #2273

Closed
ptdev opened this issue Jul 5, 2018 · 6 comments
Closed

Gekko 0.6 ui on server - Websocket disconnected #2273

ptdev opened this issue Jul 5, 2018 · 6 comments

Comments

@ptdev
Copy link
Contributor

ptdev commented Jul 5, 2018

Note: this is the technical bug tracker, please use other platforms for getting support and starting a (non technical) discussion. See the getting help page for details.

I'm submitting a ...
[ X] bug report
[ ] question about the decisions made in the repository

Action taken (what you did)
Clean install of github develop repo (0.6.1)
"npm install --only=production" on main gekko folder and exchange folder.
Copied history folder with previous imported data
Copied 1 strategy and toml for it
Replicated old web/vue/UIConfig.js to the new web/vue/public/UIConfig.js:

const CONFIG = {
  headless: false,
  api: {
    host: '127.0.0.1',
    port: 3000,
    timeout: 120000 // 2 minutes
  },
  ui: {
    ssl: true,
    host: 'example.com',
    port: 443,
    path: '/'
  },
  adapter: 'sqlite'
}

if(typeof window === 'undefined')
  module.exports = CONFIG;
else
  window.CONFIG = CONFIG;

Expected result (what you hoped would happen)
Gekko would startup correctly with new version

Actual result (unexpected outcome)
Gekko loads, but when accessing it through the browser a modal type popup appears immediately with the following information:

Disconnected
Something happened to either Gekko or the connection. Please check the terminal where Gekko is running or your network connection.

This message is shown when the UI is unable to open a websocket connection with the Gekko Server.

Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, etc)

The Gekko terminal shows no errors, last line is the startup line:

Serving Gekko UI on https://example.com:443/"

DevTools show these errors:

WebSocket connection to 'ws://localhost:3000/api' failed: WebSocket is closed before the connection is established.

and

WebSocket connection to 'ws://localhost:3000/api' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED
@askmike
Copy link
Owner

askmike commented Jul 5, 2018

The UIConfig has moved! Make sure you have actually edited the file now located in gekko/web/vue/public/UIconfig.js.

@ptdev
Copy link
Contributor Author

ptdev commented Jul 5, 2018

Hi, thanks for the quick reply.

But yes, as I've stated initially:
Replicated old web/vue/UIConfig.js to the new web/vue/public/UIConfig.js

@askmike
Copy link
Owner

askmike commented Jul 5, 2018

Apologies, read over that.

Very strange, as for your setup: is there something between the Gekko server and your browser (such as NGINX)? ERR_CONNECTION_REFUSED is an error given by something to your browser.

@ptdev
Copy link
Contributor Author

ptdev commented Jul 5, 2018

No problem,

I have no errors on nginx. What I find strange is that my devtools are showing errors like:

client.js:772 XHR failed loading: OPTIONS "http://localhost:3000/api/gekkos

and

reconnecting-websocket.min.js:2 WebSocket connection to 'ws://localhost:3000/api' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED

Which AFAIK means that it's trying to connect to a websocket on my machine's port 3000 (localhost).
This won't work because the socket should be running on the server as well (right?)

@askmike
Copy link
Owner

askmike commented Jul 5, 2018

I found the problem: 0.6 comes with an updated version of vue (frontend framework used) which now behaves differently. The UIconfig stored in gekko/web/vue/public gets copied into gekko/web/vue/dist, this one is used for production builds of vue (whenever you run node gekko --ui), but not for development builds (which I am using to debug most of the time).

Workaround: overwrite both UIconfig files (in web/vue/public and in web/vue/dist).

I will publishing a fix asap!

@ptdev
Copy link
Contributor Author

ptdev commented Jul 5, 2018

Yeah, that fixed it! Thanks 👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants