Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

twilio connection error reason through preflight #1622

Closed
morninng opened this issue Oct 30, 2021 · 7 comments
Closed

twilio connection error reason through preflight #1622

morninng opened this issue Oct 30, 2021 · 7 comments
Assignees

Comments

@morninng
Copy link

morninng commented Oct 30, 2021

I wan to know the reason of failure after peflight test has finished.


I have created twilio preflight feature and tested by blocking twilio IP address.I was expected that I can get a reason of failure from twilio but preflightTest.on('failed') just return {} and do not get any info.
For the purpose to show the reason of error on the screen and investigation of client environment, it is better why that preflight test has failed

Quote of release note

 https://github.com/twilio/twilio-video.js/blob/master/CHANGELOG.md#2160-august-11-2021
preflightTest emits a failed event to indicate test failures. 
You can use the PreflightProgress events to better understand where the test failed 
and refer to this guide for interpreting common errors.
https://www.twilio.com/docs/video/build-js-video-application-recommendations-and-best-practices#connection-errors

These errors are listed on the guide, and I expect these errors from preflightTest.on('failed'), but I have no way to check it., because I cannot reproduce error. Can you tell me whether I can get these errors when the error really happen?

SignalingConnectionError
SignalingServerBusyError
RoomMaxParticipantsExceededError
RoomNotFoundError
MediaConnectionError

my code

this.preflightTest = runPreflight(token);
    this.preflightTest.on('progress', (progress: string) => {
     console.log( ``PROGRESS,` { progress });
    });
    this.preflightTest.on('failed', (error: Error) => {
       console.log( `FAILED`, { error });
    });
    this.preflightTest.on('completed', (report: PreflightTestReport) => 
      console.log( `.COMPLETED`, { report });
    });

logs when connection failed

preflightUpdate STARTED {}
progress: mediaAcquired
progress: connected
progress: mediaSubscribed
preflight error: Error: Timed out waiting for : wait for tracks to start
FAILED {"error":{}}

logs when connection succeed

STARTED - {}
 progress: mediaAcquired
 progress: connected
 progress: mediaSubscribed
 progress: iceConnected
 progress: dtlsConnected
 setTurnServersReachable true
 setProgress dtlsConnected
 progress: peerConnectionConnected
 progress: mediaStarted

 COMPLETED  {"report":{"testTiming":{"start":1635505791878,"end":1635505807198,"duration":15320},"networkTiming":{"dtls":{"start":1635505796743,"end":1635505796963,"duration":220},"ice":{"start":1635505796449,"end":1635505796743,"duration":294},"peerConnection":{"start":1635505796451,"end":1635505796993,"duration":542},"connect":{"start":1635505791908,"end":1635505795479,"duration":3571},"media":{"start":1635505795503,"end":1635505797168,"duration":1665}},"stats":{"jitter":{"min":0.01,"max":0.021,"average":0.013999999999999999},"rtt":{"min":180,"max":544,"average":296.5},"packetLoss":{"min":0,"max":0,"average":0}},"selectedIceCandidatePairStats":{"localCandidate":{"transportId":"RTCTransport_0_1","candidateType":"srflx","port":53186,"address":"49.106.217.239","priority":1685987071,"protocol":"udp"},"remoteCandidate":{"transportId":"RTCTransport_0_1","candidateType":"relay","port":59164,"address":"54.65.63.217","priority":41820159,"protocol":"udp"}},"iceCandidateStats":[{"transportId":"RTCTransport_0_1","candidateType":"host","port":53185,"address":"172.30.112.1","priority":2122260223,"protocol":"udp"},{"transportId":"RTCTransport_0_1","candidateType":"relay","port":59164,"address":"54.65.63.217","priority":41820159,"protocol":"udp"},{"transportId":"RTCTransport_0_1","candidateType":"host","port":53186,"address":"192.168.43.2","priority":2122194687,"protocol":"udp"},{"transportId":"RTCTransport_0_1","candidateType":"srflx","port":53186,"address":"49.106.217.239","priority":1685987071,"protocol":"udp"},{"transportId":"RTCTransport_0_1","candidateType":"relay","port":36411,"address":"54.65.63.217","priority":8265471,"protocol":"udp"},{"transportId":"RTCTransport_0_1","candidateType":"relay","port":26527,"address":"54.65.63.217","priority":41820159,"protocol":"udp","relayProtocol":"udp"}]}}
Test completed in 15320  milliseconds.
It took 3571 milliseconds to connect
It took 1665 milliseconds to receive media

I think it is better to show the report on failure case similar to complete case

@makarandp0
Copy link
Contributor

Thank you for your feedback @morninng, Can you share more about how you blocked twilio IP addresses? I will try to see if we can detect such case and return a better errorcode.
Thanks,
Makarand

@morninng
Copy link
Author

morninng commented Nov 2, 2021

Hi @makarandp0

we have blocked Media server ipaddresses listed here
https://jp.twilio.com/docs/video/ip-addresses#media-servers

these are blocked by firewall

@eroidaaruqaj
Copy link

Hi, I am also facing an issue regarding error reason on preflight, in my case always is displaying an error and the message is 'remote', but didn't find any further information on what could that be related?

@makarandp0
Copy link
Contributor

Hey @eroidaaruqaj, Thank you for your feedback, Can you share console log from the preflight call? We got some good feedback about error cases and will definitely update the API to report better errors and also to include the preflight report in error cases.

@morninng
Copy link
Author

morninng commented Nov 8, 2021

The error message by disconnecting to internet would be "Timed out waiting for : wait for tracks to start".
This does not help in the real world.

I want to test other test case, how can I do?

@eroidaaruqaj
Copy link

Hey @makarandp0, thanks for your reply!

My implementation is below:

const preflight = runPreflight(token);
  preflight.on('completed', (report: Video.PreflightTestReport) => {
    console.log('report ', report);
  });

  preflight.on('failed', (error: Error) => {
    console.log('error ', error);
  });

  preflight.on('progress', (progress: string) => {
    console.log('progress ', progress);
  `});

The logs are as shown:

progress mediaAcquired
progress connected
progress mediaSubscribed
error remote
progress iceConnected
progress dtlsConnected
progress peerConnectionConnected
progress mediaStarted

Also if it helps, I am on windows machine, and tried both on Chrome and Firefox.

@charliesantos
Copy link
Collaborator

Please check out 2.20.0 release.

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

No branches or pull requests

4 participants