Skip to content
Discussions/App Development/Error : Websocket connection is failedForum ↗

Error : Websocket connection is failed

App Development13 posts848 views5 likesLast activity Dec 2020
PA
palanisamycOP
Dec 2020

I am deploying my sample app which is built on top of DAML UI template in the Azure VM (Ubuntu 18.04). I have opened the required ports like 7500, 3000, 6865 and 7575. The application is running successfully on localhost. However, after deployed into the Azure VM getting the “Websocket connection is failed” error. Can someone help me out to move forward on this?

@ManishGrover @Levente_Barczy

MA
ManishGrover
Dec 2020

Is the navigator working?

PA
palanisamyc
Dec 2020

yes @ManishGrover

LE
Levente_Barczy
Dec 2020

Hi @palanisamyc ,

Can you describe the architecture a bit more? Are you trying to run the sandbox in an Azure VM?

PA
palanisamyc
Dec 2020

Yes, @Levente_Barczy I have the sandbox/JSON-API running on the same VM. I have updated the /etc/hosts file for the localhost. also i have updated the config.ts with the VM’s public IP. Let me know if you need more information.

BE
bernhard
Dec 2020

Can you do a simple curl to the normal non-streaming query endpoint? Does it work through http and/or https? Are you going through any reverse proxies? Is SSL set up?

CO
cocreature
Dec 2020

Looking at the error, it looks like you are using the webpack-dev-server provided by yarn start/npm start. Outside of your local machine, I would strongly recommend to avoid webpack-dev-server and instead use Nginx or another reverse proxy to host your static files and proxy the JSON API.

PA
palanisamyc
Dec 2020

Its http. No i am not configured any reverse proxies.

LE
Levente_Barczy
Dec 2020

Adding to the questions from Bernhard above, how do you know that the sandbox and the json server are running? (It likely is, just checking).

PA
palanisamyc
Dec 2020

@Levente_Barczy the daml navigator is running without any issues. The issue is only when we try to query the contracts from DAML UI

BE
bernhard
Dec 2020

Ah… The dev server doesn’t by default accept connections from external interfaces and additionally does a host check. You’ll need to set some unsafe flags to use that on Azure…

CO
cocreature
Dec 2020
bernhard:

You’ll need to set some unsafe flags to use that on Azure…

As I said before, I highly recommend going down the NGinx route for this. webpack-dev-server is intended for development not for deploying it on external servers.

CO
cocreature
Dec 2020

You can find an Nginx config for proxying the JSON APi and hosting some static files in one of our example projects at davl/nginx.conf.sh at 91aa619d134d3c1fa893b8d73d21c69ece133233 · digital-asset/davl · GitHub

← Back to Discussions