awslabs / amazon-kinesis-video-streams-producer-c

https://awslabs.github.io/amazon-kinesis-video-streams-producer-c/group__PublicMemberFunctions.html
Apache License 2.0
54 stars 72 forks source link

[BUG] why iot core will return this:parseIotResponse(): IoT response has a length of 0 #447

Closed zhenhuatiger closed 4 months ago

zhenhuatiger commented 4 months ago

this is the log: [2024-04-16 18:54:13] 2024-04-16 10:54:11.992 WARN lwsIotCallbackRoutine(): Client connection failed. Connection error string: Timed out waiting SSL [2024-04-16 18:54:13] [2024/04/16 03:54:11:9922] I: __lws_close_free_wsi: [wsicli|0|GET/h1/c2ng2kvucrnc00.credentials.iot.us-west-2.amaz]: caller: timeout [2024-04-16 18:54:13] [2024/04/16 03:54:11:9923] I: __lws_close_free_wsi: real just_kill_connection: [wsicli|0|GET/h1/c2ng2kvucrnc00.credentials.iot.us-west-2.amaz] (sockfd 23)

[2024-04-16 18:54:13] [2024/04/16 03:54:11:9930] I: rops_destroy_role_h1: ah det due to close [2024-04-16 18:54:13] [2024/04/16 03:54:11:9931] I: lws_header_table_detach: [wsicli|0|GET/h1/c2ng2kvucrnc00.credentials.iot.us-west-2.amaz]: ah 0x1ee938 (tsi=0, count = 1) [2024-04-16 18:54:13] [2024/04/16 03:54:11:9932] I: lws_header_table_detach: nobody usable waiting [2024-04-16 18:54:13] [2024/04/16 03:54:11:9933] I: _lws_destroy_ah: freed ah 0x1ee938 : pool length 0 [2024-04-16 18:54:13] [2024/04/16 03:54:11:9934] I: lws_header_table_detach: [wsicli|0|GET/h1/c2ng2kvucrnc00.credentials.iot.us-west-2.amaz]: ah 0x1ee938 (tsi=0, count = 0) [2024-04-16 18:54:13] [2024/04/16 03:54:11:9936] N: -- [wsicli|0|GET/h1/c2ng2kvucrnc00.credentials.iot.us-west-2.amaz] (0) 6.201s [2024-04-16 18:54:13] [2024/04/16 03:54:11:9938] I: lws_context_destroy: destroy_state 0 [2024-04-16 18:54:13] [2024/04/16 03:54:11:9939] I: lws_context_destroy: starting context destroy flow [2024-04-16 18:54:13] [2024/04/16 03:54:11:9940] I: lws_context_destroy: vh default start close [2024-04-16 18:54:13] [2024/04/16 03:54:11:9941] I: lws_vhost_destroy1 [2024-04-16 18:54:13] [2024/04/16 03:54:11:9942] I: __lws_close_free_wsi: [wsi|0|pipe]: caller: ctx destroy [2024-04-16 18:54:13] [2024/04/16 03:54:11:9943] I: lws_close_free_wsi: real just_kill_connection: [wsi|0|pipe] (sockfd 20)

[2024-04-16 18:54:13] [2024/04/16 03:54:11:9946] N: -- [wsi|0|pipe] (0) 6.213s [2024-04-16 18:54:13] [2024/04/16 03:54:11:9947] I: __lws_close_free_wsi: [vh|0|netlink]: caller: ctx destroy [2024-04-16 18:54:13] [2024/04/16 03:54:11:9948] I: __lws_close_free_wsi: real just_kill_connection: [vh|0|netlink] (sockfd 22)

[2024-04-16 18:54:13] [2024/04/16 03:54:11:9950] N: -- [vh|0|netlink] (1) 6.213s [2024-04-16 18:54:13] [2024/04/16 03:54:11:9951] I: lws_context_destroy: manually destroying pts [2024-04-16 18:54:13] [2024/04/16 03:54:11:9952] I: lws_context_destroy: PT_WAIT_ALL_DESTROYED: 0 alive [2024-04-16 18:54:13] [2024/04/16 03:54:11:9956] N: -- [vh|1|default||-1] (0) 6.213s [2024-04-16 18:54:13] [2024/04/16 03:54:11:9957] I: lws_context_destroy: pt destroy 0 [2024-04-16 18:54:13] [2024/04/16 03:54:11:9958] I: lws_context_destroy: pt 0 fully destroyed [2024-04-16 18:54:13] 2024-04-16 10:54:11.995 ERROR parseIotResponse(): IoT response has a length of 0 [2024-04-16 18:54:13] [2024-04-16 03:54:11.996] [ERROR] [webrtc_main_thread 95]Terminated with status code 0x16000002

disa6302 commented 4 months ago

@zhenhuatiger ,

It indicates a network connectivity issue. Ensure the network is stable. You could also increase the timeouts on curl by using https://github.com/awslabs/amazon-kinesis-video-streams-producer-c/blob/master/src/include/com/amazonaws/kinesis/video/common/Include.h#L671. The parameters to set would be connection and completion timeout.

https://github.com/awslabs/amazon-kinesis-video-streams-pic/blob/master/src/client/include/com/amazonaws/kinesis/video/client/Include.h#L1204-L1205