Failed to communicate with the signaler

I deployed the anbox-cloud-appliance on bare-metal for testing.
It worked well until I attempted to build streaming client. I cloned canonical/cloud-gaming-demo (github.com) from Github and customized the client by following the steps outlined in DEVELOP.md.
The streaming client can be access normal, but it can not start a game. Subsequently, I discovered none of instance could stream correctly, even through the dashboard.

The docker starts without any errors, but it cannot be accessed through a websocket session. It displays the following error.

##### Anbox stream failed
failed to communicate with the signaler: There was an error with the websocket, check debug console for more information

Upon checking the container’s log, I found that it attempted to access the WebSocket server but failed. Also the anbox cloud crashed in a little early time, I am not sure whether it is related to this problem.

Here is the buginfo:

Hi!

It seems like you are using self-signed certificates for your deployment.

In that case, have you accepted the gateway’s certificates? You can find its address by looking at the web console or the container logs. In your case, it seems to be 240.83.0.98:8082. You can point your web browser to that address, e.g., https://240.83.0.98:8082 and accept the certificates.

Could you try that and tell us if it works for you?

Thanks!

Thanks for your prompt response.

I tried to connect to the http://240.83.0.98:8082/ and https://240.83.0.98:8082/ via a web browser, but it just cann’t access.

Hey hidetorio
If you check the debug console in the browser, what did you find? You will probably see something like

WebSocket connection to 'wss://xxx.xxx.xxx.xxx/1.0/sessions/<session_id>/sockets/slave/?token=<token>' failed:

Could you please confirm this? If yes, try visiting any page on the same IP where your cloud demo service and appliance are hosted using https, accept the TLS certificate of the gateway, then try to stream from the demo service again.

If the issue persists, kindly share the debug console log with us.

Thanks.

BR
Gary

Thanks for your advice.

I’ve checked the debug console and configured Gunicorn to use a certified TLS. Now, the debug console doesn’t show any errors, but it displays a ‘Lost WebRTC connection’ error instead. There’s still a small chance (about 1 in 30) of accessing the session, but most attempts fail.

Upon inspecting webrtc-internals in the browser, it appears there’s a failure to connect to the STUN server.

Here is the dump:
WebRTC-internals dump
Docker log

edited:
Docker log when try to connect to the container.
Docker log

There are quite a few factors that could affect the general streaming performance, leading to the Lost WebRTC connection error. For example, high packet loss, container crashes, and so on…
From what i saw in the anbox system log

Jan 25 09:26:33 ams-cmp12snenl7605cffqjg anbox-starter[150]: I0125 09:26:33.980325  2919 streaming_server.cpp:678] Peer connection state changed to failed
Jan 25 09:26:33 ams-cmp12snenl7605cffqjg anbox-starter[150]: I0125 09:26:33.980356  2919 streaming_server.cpp:827] Connection was terminated, preparing for next client ...
Jan 25 09:26:33 ams-cmp12snenl7605cffqjg anbox-starter[150]: I0125 09:26:33.980412  2919 streaming_server.cpp:1674] Idle timer is disabled by configuration

It’s more like the connection wouldn’t be established for some reason.

  1. Could you give us more about your deployment? Is it deployed on the bare metal or public cloud? is there any firewall setup on your server? Is Anbox Cloud deployment closer to your end-users?
  2. How do you launch the stream from the client? via a cloud demo service or dashboard? On which platform (Android/Desktop, Windows/Linux/MAC)? From which network (WiFi or 3G/4G/5G) if streaming from the client.

BR
Gary

  1. The cloud-anbox-appliance is deployed on the bare metal. It didn’t set any firewall on the server and deployment is in the same geographic location.
  2. I tried to launch the stream from both dashboard and cloud demo on Mac and Mobile from WiFi and 4/5G. I also use the share link on different Browser but has the same problem.

We took a closer look at the webrtc dump.
It’s most likely the ‘Lost WebRTC connection’ issue was caused by the enabled mDNS feature in the browser that you’re using as there is no mDNS configured on the server side.
Specifically for the following lines:

    {
     "time": "2024/1/25 16:24:12",
     "type": "icecandidate",
     "value": "sdpMid: 0, sdpMLineIndex: 0, candidate: candidate:1476976817 1 udp 2113937151 30e3492a-845d-4000-8ae1-9e923f2647ce.local 59309 typ host generation 0 ufrag 4sla network-cost 999"
    },
    {
     "time": "2024/1/25 16:24:12",
     "type": "icecandidate",
     "value": "sdpMid: 0, sdpMLineIndex: 0, candidate: candidate:1736247926 1 udp 1677729535 210.138.109.152 59309 typ srflx raddr 0.0.0.0 rport 0 generation 0 ufrag 4sla network-cost 999"
    },

For chrome, you could disable it via the enable-webrtc-hide-local-ips-with-mdns flag.
Could you give it a try?

Thanks

Gary

Thanks for your reply.

I tried to disable the flag but still have the problem.
I tried to launch the appliance on aws ec2 instance and I found there is no problem with connection.
So I want to check the configuration differences between aws and on-premise server, but export the config is not support for the appliance.
Is there other way to find the detailed anbox configuration?

Best regards

Anbox configuration won’t make much difference in this case and we don’t export those configs either.

In your case, it’s most likely that your server is on the same network as the client, that’s why you received a candidate with a value that ends in .local(See above), which requires to be resolved using mDNS to get the IP address of the client. As there is no mDNS configured on the serve side, it led to the error.
The reason why you can manage to get the webrtc connection established when streaming from AWS is that the server where the appliance is deployed on the AWS is not on the same network as your client and the peer connection is established over the Internet via the ICE protocol .

Gary