Anbox stream failed Error: signaling timed out

Bug #2025058 reported by chaowen guo
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Anbox Cloud
Fix Released
Medium
Gary.Wang

Bug Description

I install anbox cloud on oracle cloud 4ocpu 24g memeory 100G disk. I follow:
https://anbox-cloud.io/docs/tut/installing-appliance and https://anbox-cloud.io/docs/tut/getting-started-dashboard and then I get Anbox stream failed Error: signaling timed out in the 2. Launch and test the virtual device step 3 When the stream has loaded, you can interact with your virtual device. You can see that in the attachment stream.png

Revision history for this message
chaowen guo (chaowenguo) wrote :
Revision history for this message
Simon Fels (morphis) wrote :

Hey Chaowen,

can you provide us the output of

$ sudo anbox-cloud-appliance.buginfo

Furthermore have you opened all ports in the security group for the instance as documented on https://anbox-cloud.io/docs/ref/network-ports#appliance?

Changed in anbox-cloud:
status: New → Incomplete
Revision history for this message
chaowen guo (chaowenguo) wrote :

the output of $ sudo anbox-cloud-appliance.buginfo is in the attachment bug.txt and I already open all the ports in the oci vm.

Revision history for this message
chaowen guo (chaowenguo) wrote (last edit ):

I see there is 2023-06-20T10:46:08Z anbox-cloud-appliance.bootstrapper[8446]: Error: Failed to run bootstrap process, you can find more information at /var/snap/anbox-cloud-appliance/common/logs/bootstrap.log in the bug.txt. I copy the bootstrap.log in the attachment

Revision history for this message
Simon Fels (morphis) wrote :

Thanks!

Can you give us also the output of

$ amc exec cicn3s78dq6093s8d5k0 -- journalctl --no-pager

Revision history for this message
Simon Fels (morphis) wrote :

> 2023-06-20T10:46:08Z anbox-cloud-appliance.bootstrapper[8446]: Error: Failed to run bootstrap process

That can be ignored. It looks like you ran the bootstrap process twice. The appliance is correctly setup from what I see in the logs.

Revision history for this message
chaowen guo (chaowenguo) wrote :

the output of $ amc exec cicn3s78dq6093s8d5k0 -- journalctl --no-pager is journalctl.txt which is in the attachment

Revision history for this message
Simon Fels (morphis) wrote :

Thanks!

It looks like both sides fail to establish a connection over the signaling layer.

Are there any errors in the web console of your browser? I see you use chromium so you will need to enable the web dev tools to see the console (see https://developer.chrome.com/docs/devtools/open/).

Revision history for this message
chaowen guo (chaowenguo) wrote :

In the console:

Mixed Content: The page at 'https://192.9.129.20/sessions/cicn3s78dq6c2rvmnl80' was loaded over HTTPS, but requested an insecure element 'https://192.9.129.20/assets/Anbox_Logo-7562962b.svg'. This request was not upgraded to HTTPS because its URL's host is an IP address.
cicn3s78dq6c2rvmnl80:1 Mixed Content: The page at 'https://192.9.129.20/sessions/cicn3s78dq6c2rvmnl80' was loaded over HTTPS, but requested an insecure element 'https://192.9.129.20/assets/Anbox_Logo-7562962b.svg'. This request was not upgraded to HTTPS because its URL's host is an IP address.
index-a8b94cc2.js:3 The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page. https://goo.gl/7K7WLu
_createPlaceholderAudioTrack @ index-a8b94cc2.js:3
index-a8b94cc2.js:3 The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page. https://goo.gl/7K7WLu
_createPlaceholderAudioTrack @ index-a8b94cc2.js:3
cicn3s78dq6c2rvmnl80:1 Uncaught (in promise) DOMException: Failed to execute 'setRemoteDescription' on 'RTCPeerConnection': Failed to set remote answer sdp: The order of m-lines in answer doesn't match order in offer. Rejecting answer.

Revision history for this message
Simon Fels (morphis) wrote :

> cicn3s78dq6c2rvmnl80:1 Uncaught (in promise) DOMException: Failed to execute 'setRemoteDescription' on 'RTCPeerConnection': Failed to set remote answer sdp: The order of m-lines in answer doesn't match order in offer. Rejecting answer.

That is the problematic part here. What browser are you running? Name and exact version would be helpful.

Revision history for this message
chaowen guo (chaowenguo) wrote :

Chromium
Version 114.0.5735.106 (Official Build) snap (64-bit)
run in ubuntu 22.04

Revision history for this message
chaowen guo (chaowenguo) wrote :

I also try
Google Chrome
Version 114.0.5735.133 (Official Build) (64-bit)
run in linuxmint
the same problem appear.

Revision history for this message
chaowen guo (chaowenguo) wrote :

I may figure out part of the problem. I did not open firewall for udp traffic. Now I open traffic for all tcp and udp and create a new container, a new session. Now the problem is sometime working, sometime not working

Revision history for this message
Simon Fels (morphis) wrote :

> Now I open traffic for all tcp and udp and create a new container

What do you mean by "all tcp and udp"?

Gary.Wang (gary-wzl77)
Changed in anbox-cloud:
status: Incomplete → Confirmed
assignee: nobody → Gary.Wang (gary-wzl77)
importance: Undecided → Medium
Revision history for this message
Gary.Wang (gary-wzl77) wrote :

The error message in the above logs has implied that something is wrong during the signaling.

```
cicn3s78dq6c2rvmnl80:1 Uncaught (in promise) DOMException: Failed to execute 'setRemoteDescription' on 'RTCPeerConnection': Failed to set remote answer sdp: The order of m-lines in answer doesn't match order in offer. Rejecting answer.
```
I don't think it's related to the browser the chaowen has been using.
The issue here was that: the Anbox Cloud that chaowen has deployed on OCI may not be as near as possible. So when he tried to create/join a new session, due to the fact that a short timeout of discover message(0.5), the client used the fallback API for the signaling, which will send the settings and answer to the container via the chain(gw->nats->agent). However later the `resp:discover` message was arriving on the client side. With our current SDK, we will send the settings and offer second time.
So from the chrome:://webrtc-internals, we'll see there're 6 lines of `m-lines` in the offer

https://pastebin.ubuntu.com/p/FBdn9yXM4h/

but 3 lines of 'm-lines' in the answer received by the client.

https://pastebin.ubuntu.com/p/nWCtS5fyxk/

This essentially caused the issue you saw in the console.
```
cicn3s78dq6c2rvmnl80:1 Uncaught (in promise) DOMException: Failed to execute 'setRemoteDescription' on 'RTCPeerConnection': Failed to set remote answer sdp: The order of m-lines in answer doesn't match order in offer. Rejecting answer.
```
I can easily reproduce the same issue when streaming from China and connecting to the Anbox Cloud deployed APAC or US.

What you saw the following
```
Now the problem is sometime working, sometime not working
```
has nothing to do with open ports. It totally depends on the network condition the time you launch the stream. If it worked for you, it implies the the timeout of the discover message didn't occur and API version 2 is in use in this case while API version 1 is in use but a bug in JS SDK blocked the signaling process due to the above bug.

There is a fix for this but need to discuss with the team internally how we deliver this and in which version.

BR
Gary

Gary.Wang (gary-wzl77)
Changed in anbox-cloud:
status: Confirmed → In Progress
Gary.Wang (gary-wzl77)
Changed in anbox-cloud:
status: In Progress → Fix Committed
milestone: none → 1.18.2
Gary.Wang (gary-wzl77)
Changed in anbox-cloud:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.