Closed beyondhong closed 7 years ago
Hi @beyondhong ,
the issue is actually different, it is printed here:
<- [DETACH] {3,true, {amqp:not-found,{"errorCode":404006,"trackingId":"c6f75a3404b54748ad90849ef5a469f9-G:2-TimeStamp:08/17/2017 10:48:44","message":"The link address 'amqps://four-faith-router-20170801.azure-devices.cn/devices/fourfaith_dev002/twin' did not match any of the expected formats.","timestampUtc":"2017-08-17T10:48:44.5309043Z"},{[com.microsoft:is-filtered:true]}}}
This was a known issue happening while the last update to IoT Hubs was happening. It most likely meant that your IoTHub service was still not updated by the time you run the sample.
Could you please try again and see if the issue is resolved for you? And please get the latest version of the C SDK, to ensure you take advantage of the new fixes and improvements.
Hi, @ewertons I git clone a newer version: git clone -b 2017-09-25 --recursive https://github.com/Azure/azure-iot-sdk-c.git and build it, still both http and mqtt work fine, but not amqp the errorCode still 404006, I don't kown how to fix it
Starting the IoTHub client sample AMQP... Info: IoT Hub SDK for C, version 1.1.24 Info: Retry policy set (5, timeout = 0) IoTHubClient_SetMessageCallback...successful. IoTHubClient_SendEventAsync accepted data for transmission to IoT Hub. IoTHubClient_SendEventAsync accepted data for transmission to IoT Hub. IoTHubClient_SendEventAsync accepted data for transmission to IoT Hub. IoTHubClient_SendEventAsync accepted data for transmission to IoT Hub. IoTHubClient_SendEventAsync accepted data for transmission to IoT Hub. -> Header (AMQP 0.1.0.0) <- Header (AMQP 0.1.0.0)
.....
Error: Time:Sat Sep 30 14:24:21 2017 File:/home/hong/azure-iot-sdk-c_0925/iothub_client/src/iothubtransport_amqp_connection.c Func:on_cbs_error Line:157 CBS Error occured Error: Time:Sat Sep 30 14:24:21 2017 File:/home/hong/azure-iot-sdk-c_0925/iothub_client/src/iothubtransport_amqp_telemetry_messenger.c Func:process_state_changes Line:1776 messagesender reported unexpected state 0 while messenger was started Error: Time:Sat Sep 30 14:24:21 2017 File:/home/hong/azure-iot-sdk-c_0925/iothub_client/src/iothubtransport_amqp_messenger.c Func:process_state_changes Line:1400 messagesender reported unexpected state 4 while messenger is starting Error: Time:Sat Sep 30 14:24:21 2017 File:/home/hong/azure-iot-sdk-c_0925/iothub_client/src/iothubtransport_amqp_twin_messenger.c Func:on_amqp_messenger_state_changed_callback Line:1625 Unexpected AMQP messenger state (fourfaith_dev001, TWIN_MESSENGER_STATE_STARTING, AMQP_MESSENGER_STATE_ERROR) <- [DETACH] {3,true, {amqp:not-found,{"errorCode":404006,"trackingId":"bf94eee4e3924c86815e057ff2f7b2f6-G:2-TimeStamp:09/30/2017 06:24:21","message":"The link address 'amqps://fourfaithiothub.azure-devices.cn/devices/fourfaith_dev001/twin' did not match any of the expected formats.","timestampUtc":"2017-09-30T06:24:21.530269Z"},{[com.microsoft:is-filtered:true]}}} -> [END] { {amqp:session:unattached-handle,}}
@ewertons , an old version: 2017-06-30 amqp demo works!
Starting the IoTHub client sample AMQP... Info: IoT Hub SDK for C, version 1.1.18 Info: Retry policy set (5, timeout = 0) ......... <- [DISPOSITION] {true,2,NULL,true, {},NULL} Confirmation[0] received for message tracking id = 1 with result = IOTHUB_CLIENT_CONFIRMATION_OK <- [DISPOSITION] {true,3,NULL,true, {},NULL} Confirmation[1] received for message tracking id = 2 with result = IOTHUB_CLIENT_CONFIRMATION_OK <- [DISPOSITION] {true,4,NULL,true, {},NULL} Confirmation[2] received for message tracking id = 3 with result = IOTHUB_CLIENT_CONFIRMATION_OK <- [DISPOSITION] {true,1,NULL,true, {},NULL} Confirmation[3] received for message tracking id = 0 with result = IOTHUB_CLIENT_CONFIRMATION_OK <- [DISPOSITION] {true,5,NULL,true, {},NULL} Confirmation[4] received for message tracking id = 4 with result = IOTHUB_CLIENT_CONFIRMATION_OK
Hi @beyondhong , thanks for testing the different versions, that's good info! I am following up here to see what happened with your server. I'll update you soon.
Also I'm changing the title of the issue to reflect the real problem.
Hi @beyondhong , I believe your server is now updated.
Could you try the sample again against the same server you used before please? If possible, wait for a couple hours to make sure we don't hit any configuration replication issues.
Hi, @ewertons it maybe work now, no error message is printed, Thanks! :+1:
Thanks for confirming, @beyondhong !
Please let us know if we can help in any other way. Thanks for using and contributing to Azure IoT!
OS and version used:
ubuntu 14.04 x86_64, gcc4.9.4
ubuntu 16.04.3 x86_64, gcc5.4.0
SDK version used:
IoT Hub SDK for C, version 1.1.21
Description of the issue:
http and mqtt demo works fine, but AMQP demo just doesn't work iothub_client_sample_amqp
iothub_client_sample_amqp_websockets
Code sample exhibiting the issue:
Console log of the issue:
hong@ubuntu:~/azure-iot-sdk-c/cmake/iotsdk_linux/iothub_client/samples/iothub_client_sample_amqp$ ./iothub_client_sample_amqp Starting the IoTHub client sample AMQP... Info: IoT Hub SDK for C, version 1.1.21 Info: Retry policy set (5, timeout = 0) IoTHubClient_SetMessageCallback...successful. IoTHubClient_SendEventAsync accepted data for transmission to IoT Hub. Info: Transport state changed from AMQP_TRANSPORT_STATE_NOT_CONNECTED to AMQP_TRANSPORT_STATE_CONNECTING Info: Transport state changed from AMQP_TRANSPORT_STATE_CONNECTING to AMQP_TRANSPORT_STATE_CONNECTED IoTHubClient_SendEventAsync accepted data for transmission to IoT Hub. IoTHubClient_SendEventAsync accepted data for transmission to IoT Hub. IoTHubClient_SendEventAsync accepted data for transmission to IoT Hub. IoTHubClient_SendEventAsync accepted data for transmission to IoT Hub. -> Header (AMQP 0.1.0.0) <- Header (AMQP 0.1.0.0) -> [OPEN] {2a1bda59-1ba0-475f-a996-3cbaf0ab27f2,four-faith-router-20170801.azure-devices.cn,4294967295,65535,120000} <- [OPEN] {DeviceGateway_bbd0378d30cd4e27b8601b3441843948,10.0.0.24,65536,8191,240000,NULL,NULL,NULL,NULL,NULL} -> [BEGIN] {NULL,0,4294967295,100,4294967295} <- [BEGIN] {0,1,5000,4294967295,262143,NULL,NULL,NULL} -> [ATTACH] {$cbs-sender,0,false,0,0, {$cbs}, {$cbs},NULL,NULL,0,0} -> [ATTACH] {$cbs-receiver,1,true,0,0, {$cbs}, {$cbs},NULL,NULL,NULL,0} <- [ATTACH] {$cbs-sender,0,true,0,0, {$cbs,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, {$cbs,NULL,NULL,NULL,NULL,NULL,NULL},NULL,NULL,NULL,1048576,NULL,NULL,NULL} <- [FLOW] {0,5000,1,4294967295,0,0,100,0,NULL,false,NULL} -> [TRANSFER] {0,0,<01 00 00 00>,0,false,false} <- [ATTACH] {$cbs-receiver,1,false,0,0, {$cbs,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, {$cbs,NULL,NULL,NULL,NULL,NULL,NULL},NULL,NULL,0,1048576,NULL,NULL,NULL} -> [FLOW] {1,4294967295,1,99,1,0,10000} <- [DISPOSITION] {true,0,NULL,true, {},NULL} <- [TRANSFER] {1,0,<01 00 00 00>,0,NULL,false,NULL,NULL,NULL,NULL,false} -> [DISPOSITION] {true,0,0,true, {}} -> [ATTACH] {link-snd-fourfaith_dev002-12968d4e-303f-4401-bbd2-e5bad5d3ae90,2,false,0,0, {link-snd-fourfaith_dev002-12968d4e-303f-4401-bbd2-e5bad5d3ae90-source}, {amqps://four-faith-router-20170801.azure-devices.cn/devices/fourfaith_dev002/messages/events},NULL,NULL,0,18446744073709551615,NULL,NULL,{[com.microsoft:client-version:iothubclient/1.1.21 (Linux; x86_64)]}} -> [ATTACH] {link-snd-fourfaith_dev002-b4fa82cf-846b-446a-8edd-85c13c497c59,3,false,0,0, {link-snd-fourfaith_dev002-b4fa82cf-846b-446a-8edd-85c13c497c59-source}, {amqps://four-faith-router-20170801.azure-devices.cn/devices/fourfaith_dev002/twin},NULL,NULL,0,18446744073709551615,NULL,NULL,{[com.microsoft:client-version:iothubclient/1.1.21 (Linux; x86_64)],[com.microsoft:channel-correlation-id:twin:49b38708-b992-4182-82ad-4c9cf7956fc3],[com.microsoft:api-version:2016-11-14]}} <- [ATTACH] {link-snd-fourfaith_dev002-12968d4e-303f-4401-bbd2-e5bad5d3ae90,2,true,0,NULL, {link-snd-fourfaith_dev002-12968d4e-303f-4401-bbd2-e5bad5d3ae90-source,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, {amqps://four-faith-router-20170801.azure-devices.cn/devices/fourfaith_dev002/messages/events,NULL,NULL,NULL,NULL,NULL,NULL},NULL,NULL,NULL,1048576,NULL,NULL,{[com.microsoft:client-version:iothubclient/1.1.21 (Linux; x86_64)]}} <- [FLOW] {1,5000,2,4294967295,2,0,1000,0,NULL,false,NULL} -> [ATTACH] {link-rcv-fourfaith_dev002-77e01b43-cbe3-4b15-b535-0503173d5f9e,4,true,0,0, {amqps://four-faith-router-20170801.azure-devices.cn/devices/fourfaith_dev002/messages/devicebound}, {link-rcv-fourfaith_dev002-77e01b43-cbe3-4b15-b535-0503173d5f9e-target},NULL,NULL,NULL,65536,NULL,NULL,{[com.microsoft:client-version:iothubclient/1.1.21 (Linux; x86_64)]}} <- [ATTACH] {link-snd-fourfaith_dev002-b4fa82cf-846b-446a-8edd-85c13c497c59,3,true,1,0,NULL,NULL,NULL,NULL,NULL,1048576,NULL,NULL,{[com.microsoft:client-version:iothubclient/1.1.21 (Linux; x86_64)],[com.microsoft:channel-correlation-id:twin:49b38708-b992-4182-82ad-4c9cf7956fc3],[com.microsoft:api-version:2016-11-14]}} -> [END] { {amqp:decode-error,Cannot get link source from ATTACH frame}} Error: Time:Thu Aug 17 03:48:43 2017 File:/home/hong/azure-iot-sdk-c/iothub_client/src/iothubtransport_amqp_connection.c Func:on_cbs_error Line:156 CBS Error occured <- [DETACH] {3,true, {amqp:not-found,{"errorCode":404006,"trackingId":"c6f75a3404b54748ad90849ef5a469f9-G:2-TimeStamp:08/17/2017 10:48:44","message":"The link address 'amqps://four-faith-router-20170801.azure-devices.cn/devices/fourfaith_dev002/twin' did not match any of the expected formats.","timestampUtc":"2017-08-17T10:48:44.5309043Z"},{[com.microsoft:is-filtered:true]}}} -> [END] { {amqp:session:unattached-handle,}} Error: Time:Thu Aug 17 03:48:43 2017 File:/home/hong/azure-iot-sdk-c/iothub_client/src/iothubtransport_amqp_telemetry_messenger.c Func:process_state_changes Line:1512 messagesender reported unexpected state 0 while messenger was started Error: Time:Thu Aug 17 03:48:43 2017 File:/home/hong/azure-iot-sdk-c/iothub_client/src/iothubtransport_amqp_messenger.c Func:process_state_changes Line:1400 messagesender reported unexpected state 4 while messenger is starting Error: Time:Thu Aug 17 03:48:43 2017 File:/home/hong/azure-iot-sdk-c/iothub_client/src/iothubtransport_amqp_twin_messenger.c Func:on_amqp_messenger_state_changed_callback Line:1625 Unexpected AMQP messenger state (fourfaith_dev002, TWIN_MESSENGER_STATE_STARTING, AMQP_MESSENGER_STATE_ERROR) Error: Time:Thu Aug 17 03:48:43 2017 File:/home/hong/azure-iot-sdk-c/iothub_client/src/iothubtransport_amqp_device.c Func:device_do_work Line:985 Device 'fourfaith_dev002' messenger failed to be started (messenger got into error state) Error: Time:Thu Aug 17 03:48:43 2017 File:/home/hong/azure-iot-sdk-c/iothub_client/src/iothubtransport_amqp_device.c Func:device_do_work Line:1027 Device 'fourfaith_dev002' twin messenger failed to be started (messenger got into error state) Error: Time:Thu Aug 17 03:48:43 2017 File:/home/hong/azure-iot-sdk-c/iothub_client/src/iothubtransport_amqp_common.c Func:IoTHubTransport_AMQP_Common_Device_DoWork Line:1058 Failed performing DoWork for device 'fourfaith_dev002' (device reported state 6; number of previous failures: 0) Error: Time:Thu Aug 17 03:48:43 2017 File:/home/hong/azure-iot-sdk-c/uamqp/src/cbs.c Func:cbs_put_token_async Line:456 put token called while closed or in error Error: Time:Thu Aug 17 03:48:43 2017 File:/home/hong/azure-iot-sdk-c/iothub_client/src/iothubtransport_amqp_cbs_auth.c Func:put_SAS_token_to_cbs Line:228 Failed putting SAS token to CBS for device 'fourfaith_dev002' (cbs_put_token failed) Error: Time:Thu Aug 17 03:48:43 2017 File:/home/hong/azure-iot-sdk-c/iothub_client/src/iothubtransport_amqp_cbs_auth.c Func:create_and_put_SAS_token_to_cbs Line:347 Failed putting SAS token to CBS Error: Time:Thu Aug 17 03:48:43 2017 File:/home/hong/azure-iot-sdk-c/iothub_client/src/iothubtransport_amqp_cbs_auth.c Func:authentication_do_work Line:692 Failed authenticating device 'fourfaith_dev002' using device keys Error: Time:Thu Aug 17 03:48:43 2017 File:/home/hong/azure-iot-sdk-c/iothub_client/src/iothubtransport_amqp_common.c Func:IoTHubTransport_AMQP_Common_Device_DoWork Line:1058 Failed performing DoWork for device 'fourfaith_dev002' (device reported state 4; number of previous failures: 1) Error: Time:Thu Aug 17 03:48:43 2017 File:/home/hong/azure-iot-sdk-c/uamqp/src/cbs.c Func:cbs_put_token_async Line:456 put token called while closed or in error Error: Time:Thu Aug 17 03:48:43 2017 File:/home/hong/azure-iot-sdk-c/iothub_client/src/iothubtransport_amqp_cbs_auth.c Func:put_SAS_token_to_cbs Line:228 Failed putting SAS token to CBS for device 'fourfaith_dev002' (cbs_put_token failed) Error: Time:Thu Aug 17 03:48:43 2017 File:/home/hong/azure-iot-sdk-c/iothub_client/src/iothubtransport_amqp_cbs_auth.c Func:create_and_put_SAS_token_to_cbs Line:347 Failed putting SAS token to CBS Error: Time:Thu Aug 17 03:48:43 2017 File:/home/hong/azure-iot-sdk-c/iothub_client/src/iothubtransport_amqp_cbs_auth.c Func:authentication_do_work Line:692 Failed authenticating device 'fourfaith_dev002' using device keys Error: Time:Thu Aug 17 03:48:43 2017 File:/home/hong/azure-iot-sdk-c/iothub_client/src/iothubtransport_amqp_common.c Func:IoTHubTransport_AMQP_Common_Device_DoWork Line:1058 Failed performing DoWork for device 'fourfaith_dev002' (device reported state 4; number of previous failures: 2) Error: Time:Thu Aug 17 03:48:43 2017 File:/home/hong/azure-iot-sdk-c/uamqp/src/cbs.c Func:cbs_put_token_async Line:456 put token called while closed or in error Error: Time:Thu Aug 17 03:48:43 2017 File:/home/hong/azure-iot-sdk-c/iothub_client/src/iothubtransport_amqp_cbs_auth.c Func:put_SAS_token_to_cbs Line:228 Failed putting SAS token to CBS for device 'fourfaith_dev002' (cbs_put_token failed) Error: Time:Thu Aug 17 03:48:43 2017 File:/home/hong/azure-iot-sdk-c/iothub_client/src/iothubtransport_amqp_cbs_auth.c Func:create_and_put_SAS_token_to_cbs Line:347 Failed putting SAS token to CBS Error: Time:Thu Aug 17 03:48:43 2017 File:/home/hong/azure-iot-sdk-c/iothub_client/src/iothubtransport_amqp_cbs_auth.c Func:authentication_do_work Line:692 Failed authenticating device 'fourfaith_dev002' using device keys Error: Time:Thu Aug 17 03:48:43 2017 File:/home/hong/azure-iot-sdk-c/iothub_client/src/iothubtransport_amqp_common.c Func:IoTHubTransport_AMQP_Common_Device_DoWork Line:1058 Failed performing DoWork for device 'fourfaith_dev002' (device reported state 4; number of previous failures: 3) Error: Time:Thu Aug 17 03:48:43 2017 File:/home/hong/azure-iot-sdk-c/uamqp/src/cbs.c Func:cbs_put_token_async Line:456 put token called while closed or in error Error: Time:Thu Aug 17 03:48:43 2017 File:/home/hong/azure-iot-sdk-c/iothub_client/src/iothubtransport_amqp_cbs_auth.c Func:put_SAS_token_to_cbs Line:228 Failed putting SAS token to CBS for device 'fourfaith_dev002' (cbs_put_token failed) Error: Time:Thu Aug 17 03:48:43 2017 File:/home/hong/azure-iot-sdk-c/iothub_client/src/iothubtransport_amqp_cbs_auth.c Func:create_and_put_SAS_token_to_cbs Line:347 Failed putting SAS token to CBS Error: Time:Thu Aug 17 03:48:43 2017 File:/home/hong/azure-iot-sdk-c/iothub_client/src/iothubtransport_amqp_cbs_auth.c Func:authentication_do_work Line:692 Failed authenticating device 'fourfaith_dev002' using device keys Error: Time:Thu Aug 17 03:48:43 2017 File:/home/hong/azure-iot-sdk-c/iothub_client/src/iothubtransport_amqp_common.c Func:IoTHubTransport_AMQP_Common_Device_DoWork Line:1058 Failed performing DoWork for device 'fourfaith_dev002' (device reported state 4; number of previous failures: 4) Error: Time:Thu Aug 17 03:48:43 2017 File:/home/hong/azure-iot-sdk-c/iothub_client/src/iothubtransport_amqp_common.c Func:IoTHubTransport_AMQP_Common_DoWork Line:1525 Device 'fourfaith_dev002' reported a critical failure; connection retry will be triggered. Info: Transport state changed from AMQP_TRANSPORT_STATE_CONNECTED to AMQP_TRANSPORT_STATE_RECONNECTION_REQUIRED Info: Preparing transport for re-connection -> [CLOSE]* {} Error: Time:Thu Aug 17 03:48:43 2017 File:/home/hong/azure-iot-sdk-c/iothub_client/src/iothubtransport_amqp_common.c Func:on_amqp_connection_state_changed Line:697 amqp_connection was closed unexpectedly; connection retry will be triggered.