Error : Websocket connection is failed

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

1 Like

Is the navigator working?

1 Like

yes @ManishGrover

1 Like

Hi @palanisamyc ,

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

1 Like

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.

1 Like

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?

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.

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

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).

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

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…

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.

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