Kurento / bugtracker

[ARCHIVED] Contents migrated to monorepo: https://github.com/Kurento/kurento
46 stars 10 forks source link

Error adding candidate when browser runs on windows 10 #425

Closed gaorongfu closed 4 years ago

gaorongfu commented 4 years ago

Kurento version:6.13.0 Ubuntu version:18.04 Browser:Chrome on windows 10 64bit I install a turn server on cloud server and test successfully in https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice/ when I use browser on linux. But when I user a chrome on windows 10, turn test first result is a strange address sucn as : c0e0d043-d877-4920-9c10-ba9bdb2ba8d6.local and ice test returned message: "STUN server address is incompatible",but the ip address routing list is correct.

I put kurento-player web resources on cloud server and add my stun/turn settings. I install kurento-media-server on a PC in my lan.

And when I use kurento-player tutorials to test a rtsp video stream, some times I got this Exception(It seemed libnice doesn't recognized windows 10 specially address c0e0d043-d877-4920-9c10-ba9bdb2ba8d6.local): KurentoServerException: Error adding candidate (Code:40401, Type:null, Data: {"type":"ICE_ADD_CANDIDATE_ERROR"})

the whole json message send by java client is : {"id":"onIceCandidate","candidate":{"candidate":"candidate:3175630248 1 udp 2113939711 c0e0d043-d877-4920-9c10-ba9bdb2ba8d6.local 53160 typ host generation 0 ufrag s0EG network-cost 999","sdpMid":"1","sdpMLineIndex":1}}

And the whole exception is below: 2020-01-02 10:05:45.216 ERROR 3839 --- [ntainer#0-0-C-1] c.f.n.kurento.player.KafkaPlayerHandler : Exception handling message {"id":"onIceCandidate","candidate":{"candidate":"candidate:3175630248 1 udp 2113939711 c0e0d043-d877-4920-9c10-ba9bdb2ba8d6.local 53160 typ host generation 0 ufrag s0EG network-cost 999","sdpMid":"1","sdpMLineIndex":1}} in sessionId 0195C3445A1BC6A42BC63FC932F08A5C###1000001907481847

org.kurento.client.internal.server.KurentoServerException: Error adding candidate (Code:40401, Type:null, Data: {"type":"ICE_ADD_CANDIDATE_ERROR"}) at org.kurento.client.internal.transport.jsonrpc.RomClientJsonRpcClient.sendRequest(RomClientJsonRpcClient.java:264) ~[kurento-client-6.13.0.jar:6.13.0] at org.kurento.client.internal.transport.jsonrpc.RomClientJsonRpcClient.invoke(RomClientJsonRpcClient.java:117) ~[kurento-client-6.13.0.jar:6.13.0] at org.kurento.client.internal.transport.jsonrpc.RomClientJsonRpcClient.invoke(RomClientJsonRpcClient.java:99) ~[kurento-client-6.13.0.jar:6.13.0] at org.kurento.client.internal.client.RomManager.invoke(RomManager.java:162) ~[kurento-client-6.13.0.jar:6.13.0] at org.kurento.client.internal.client.RemoteObject.invoke(RemoteObject.java:186) ~[kurento-client-6.13.0.jar:6.13.0] at org.kurento.client.internal.client.RemoteObjectInvocationHandler.invoke(RemoteObjectInvocationHandler.java:182) ~[kurento-client-6.13.0.jar:6.13.0] at org.kurento.client.internal.client.RemoteObjectInvocationHandler.internalInvoke(RemoteObjectInvocationHandler.java:142) ~[kurento-client-6.13.0.jar:6.13.0] at org.kurento.client.internal.client.DefaultInvocationHandler.invoke(DefaultInvocationHandler.java:39) ~[kurento-client-6.13.0.jar:6.13.0] at com.sun.proxy.$Proxy94.addIceCandidate(Unknown Source) ~[na:na] at com.fj.nvr.kurento.player.KafkaPlayerHandler.onIceCandidate(KafkaPlayerHandler.java:286) ~[classes/:na] at com.fj.nvr.kurento.player.KafkaPlayerHandler.handleTextMessage(KafkaPlayerHandler.java:114) ~[classes/:na] at com.fj.nvr.kurento.player.KafkaPlayerHandler.onMessage(KafkaPlayerHandler.java:82) ~[classes/:na] at jdk.internal.reflect.GeneratedMethodAccessor65.invoke(Unknown Source) ~[na:na] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na] at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na] at org.springframework.messaging.handler.invocation.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:171) ~[spring-messaging-5.1.7.RELEASE.jar:5.1.7.RELEASE] at org.springframework.messaging.handler.invocation.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:120) ~[spring-messaging-5.1.7.RELEASE.jar:5.1.7.RELEASE] at org.springframework.kafka.listener.adapter.HandlerAdapter.invoke(HandlerAdapter.java:48) ~[spring-kafka-2.2.6.RELEASE.jar:2.2.6.RELEASE] at org.springframework.kafka.listener.adapter.MessagingMessageListenerAdapter.invokeHandler(MessagingMessageListenerAdapter.java:283) ~[spring-kafka-2.2.6.RELEASE.jar:2.2.6.RELEASE] at org.springframework.kafka.listener.adapter.RecordMessagingMessageListenerAdapter.onMessage(RecordMessagingMessageListenerAdapter.java:79) ~[spring-kafka-2.2.6.RELEASE.jar:2.2.6.RELEASE] at org.springframework.kafka.listener.adapter.RecordMessagingMessageListenerAdapter.onMessage(RecordMessagingMessageListenerAdapter.java:50) ~[spring-kafka-2.2.6.RELEASE.jar:2.2.6.RELEASE] at org.springframework.kafka.listener.KafkaMessageListenerContainer$ListenerConsumer.doInvokeOnMessage(KafkaMessageListenerContainer.java:1263) ~[spring-kafka-2.2.6.RELEASE.jar:2.2.6.RELEASE] at org.springframework.kafka.listener.KafkaMessageListenerContainer$ListenerConsumer.invokeOnMessage(KafkaMessageListenerContainer.java:1256) ~[spring-kafka-2.2.6.RELEASE.jar:2.2.6.RELEASE] at org.springframework.kafka.listener.KafkaMessageListenerContainer$ListenerConsumer.doInvokeRecordListener(KafkaMessageListenerContainer.java:1217) ~[spring-kafka-2.2.6.RELEASE.jar:2.2.6.RELEASE] at org.springframework.kafka.listener.KafkaMessageListenerContainer$ListenerConsumer.doInvokeWithRecords(KafkaMessageListenerContainer.java:1198) ~[spring-kafka-2.2.6.RELEASE.jar:2.2.6.RELEASE] at org.springframework.kafka.listener.KafkaMessageListenerContainer$ListenerConsumer.invokeRecordListener(KafkaMessageListenerContainer.java:1118) ~[spring-kafka-2.2.6.RELEASE.jar:2.2.6.RELEASE] at org.springframework.kafka.listener.KafkaMessageListenerContainer$ListenerConsumer.invokeListener(KafkaMessageListenerContainer.java:933) ~[spring-kafka-2.2.6.RELEASE.jar:2.2.6.RELEASE] at org.springframework.kafka.listener.KafkaMessageListenerContainer$ListenerConsumer.pollAndInvoke(KafkaMessageListenerContainer.java:749) ~[spring-kafka-2.2.6.RELEASE.jar:2.2.6.RELEASE] at org.springframework.kafka.listener.KafkaMessageListenerContainer$ListenerConsumer.run(KafkaMessageListenerContainer.java:698) ~[spring-kafka-2.2.6.RELEASE.jar:2.2.6.RELEASE] at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[na:na] at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[na:na] at java.base/java.lang.Thread.run(Thread.java:834) ~[na:na]

alexlapa commented 4 years ago

https://github.com/Kurento/bugtracker/issues/405

j1elo commented 4 years ago

In the Ubuntu machine, where Kurento is installed, make sure that mDNS resolution is enabled

There was an error if Kurento runs inside Docker container, that I've fixed today. But I don't think that it affects you, as you didn't mention anything about Docker.

gaorongfu commented 4 years ago

In the Ubuntu machine, where Kurento is installed, make sure that mDNS resolution is enabled

There was an error if Kurento runs inside Docker container, that I've fixed today. But I don't think that it affects you, as you didn't mention anything about Docker.

Yes, I use kurento without docker. When browser and kurento in different lan, mDNS always throw the exception I reported. The only way to resolve it is disable mDNS in chrome settings.

j1elo commented 4 years ago

When browser and kurento in different lan, mDNS always throw the exception I reported.

There are 2 workarounds to the problem:

A. Disable nDNS in Chrome settings B. Make sure that mDNS resolution is enabled

Could you please confirm if B solves the problem, without disabling mDNS in Chrome?

j1elo commented 4 years ago

Duplicate of #432

gaorongfu commented 4 years ago

I already tested, solution B is not working for me , it only can parse mDns address in same lan. when mDns address is in another lan which can not be access directly, the same exception is throwed either. Then I use solution A, every thing has been ok.

j1elo commented 4 years ago

I recently fixed a bug in the mDNS code, so remote mDNS are ignored (so they don't cause errors when they are not from the same LAN). Trying to handle remote mDNS is a mistake anyway, because mDNS only makes sense when it is in the same network.

Commit Kurento/kms-elements@44ca3de should help with this issue. It is not published yet in a Kurento release, but it can be tested with the nightly build.

Please try out the nightly build, to let us know if the patch is actually fixing the problem, to include it in next Kurento release. Thanks!

gaorongfu commented 4 years ago

It is great of this bug fix! I am in China, my test enviroment is in my office , but we are not allowed to go office these days because the virus transmission. I will try to build a new test enviroment in my house ASAP.

gaorongfu commented 4 years ago

I tested the nightly build successfully, and the bug not occured again: After install nightly build as the guild document, I set mDNS enabled in chrome browser and relaunch it. Then I use the tutorial-player page with another internet connection, play a rtsp video stream successfully.

gaorongfu commented 4 years ago

Thank you very much for your effecient work !

j1elo commented 4 years ago

I'm happy that this issue is solved! Thank you. Also, be safe with the virus problem. Closing this as bug is now fixed

gaorongfu commented 4 years ago

Ok, thanks a lot!

ninetwozreo commented 4 years ago

你好 gaorongfu 我是一名中过开发者 在使用kurento的时候遇到了同样的问题 ,希望能与你交流一下 ,email 1853022577@qq.com