{"action":"created","issue":{"url":"https://api.github.com/repos/Azure/azure-iot-sdk-c/issues/746","repository_url":"https://api.github.com/repos/Azure/azure-iot-sdk-c","labels_url":"https://api.github.com/repos/Azure/azure-iot-sdk-c/issues/746/labels{/name}","comments_url":"https://api.github.com/repos/Azure/azure-iot-sdk-c/issues/746/comments","events_url":"https://api.github.com/repos/Azure/azure-iot-sdk-c/issues/746/events","html_url":"https://github.com/Azure/azure-iot-sdk-c/issues/746","id":385852896,"node_id":"MDU6SXNzdWUzODU4NTI4OTY=","number":746,"title":"device client will never connect if started before networking is ready","user":{"login":"larsonmpdx","id":12436438,"node_id":"MDQ6VXNlcjEyNDM2NDM4","avatar_url":"https://avatars2.githubusercontent.com/u/12436438?v=4","gravatar_id":"","url":"https://api.github.com/users/larsonmpdx","html_url":"https://github.com/larsonmpdx","followers_url":"https://api.github.com/users/larsonmpdx/followers","following_url":"https://api.github.com/users/larsonmpdx/following{/other_user}","gists_url":"https://api.github.com/users/larsonmpdx/gists{/gist_id}","starred_url":"https://api.github.com/users/larsonmpdx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/larsonmpdx/subscriptions","organizations_url":"https://api.github.com/users/larsonmpdx/orgs","repos_url":"https://api.github.com/users/larsonmpdx/repos","events_url":"https://api.github.com/users/larsonmpdx/events{/privacy}","received_events_url":"https://api.github.com/users/larsonmpdx/received_events","type":"User","site_admin":false},"labels":[{"id":494742749,"node_id":"MDU6TGFiZWw0OTQ3NDI3NDk=","url":"https://api.github.com/repos/Azure/azure-iot-sdk-c/labels/investigation-required","name":"investigation-required","color":"1d76db","default":false}],"state":"open","locked":false,"assignee":{"login":"ewertons","id":12401690,"node_id":"MDQ6VXNlcjEyNDAxNjkw","avatar_url":"https://avatars0.githubusercontent.com/u/12401690?v=4","gravatar_id":"","url":"https://api.github.com/users/ewertons","html_url":"https://github.com/ewertons","followers_url":"https://api.github.com/users/ewertons/followers","following_url":"https://api.github.com/users/ewertons/following{/other_user}","gists_url":"https://api.github.com/users/ewertons/gists{/gist_id}","starred_url":"https://api.github.com/users/ewertons/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ewertons/subscriptions","organizations_url":"https://api.github.com/users/ewertons/orgs","repos_url":"https://api.github.com/users/ewertons/repos","events_url":"https://api.github.com/users/ewertons/events{/privacy}","received_events_url":"https://api.github.com/users/ewertons/received_events","type":"User","site_admin":false},"assignees":[{"login":"ewertons","id":12401690,"node_id":"MDQ6VXNlcjEyNDAxNjkw","avatar_url":"https://avatars0.githubusercontent.com/u/12401690?v=4","gravatar_id":"","url":"https://api.github.com/users/ewertons","html_url":"https://github.com/ewertons","followers_url":"https://api.github.com/users/ewertons/followers","following_url":"https://api.github.com/users/ewertons/following{/other_user}","gists_url":"https://api.github.com/users/ewertons/gists{/gist_id}","starred_url":"https://api.github.com/users/ewertons/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ewertons/subscriptions","organizations_url":"https://api.github.com/users/ewertons/orgs","repos_url":"https://api.github.com/users/ewertons/repos","events_url":"https://api.github.com/users/ewertons/events{/privacy}","received_events_url":"https://api.github.com/users/ewertons/received_events","type":"User","site_admin":false}],"milestone":null,"comments":14,"created_at":"2018-11-29T17:48:05Z","updated_at":"2018-12-12T21:01:03Z","closed_at":null,"author_association":"NONE","body":"- **OS and version used:** <VERSION> <!-- Windows 10, Ubuntu 15.04... --> buildroot linux 4.1.15 on arm\r\n\r\n- **SDK version used:** <VERSION> <!-- Please include the SDK version --> Nov 20 2018 1.2.11\r\n\r\n\r\n# Description of the issue:\r\nIf the iot device client application is started before network connectivity is ready (dns not yet working and connections can't be opened), it can get stuck and may never connect even with unlimited time and retries.  if it's started after network connectivity is ready it will work normally and can become disconnected through network faults and then reconnect later and so on, working as expected.\r\n\r\n# Code sample exhibiting the issue:\r\nan application more or less the same as https://github.com/Azure/azure-iot-sdk-c/blob/master/iothub_client/samples/iothub_ll_client_x509_sample/iothub_ll_client_x509_sample.c\r\nbut running in a loop and relying on the iot library's retry functionality\r\n\r\n# Console log of the issue:\r\nthis is repeated forever, each time the iot library tries to reconnect (at some interval based on the azure iot reconnect policy):\r\n````\r\nError: Time:Thu Nov 29 17:04:08 2018 File:/azure-iot-sdk-c/c-utility/adapters/socketio_berkeley.c Func:wait_for_connection Line:386 Failure: connect failure 111.\r\nError: Time:Thu Nov 29 17:04:08 2018 File:/azure-iot-sdk-c/c-utility/adapters/socketio_berkeley.c Func:socketio_open Line:770 wait_for_connection failed\r\nError: Time:Thu Nov 29 17:04:08 2018 File:/azure-iot-sdk-c/c-utility/adapters/tlsio_openssl.c Func:on_underlying_io_open_complete Line:760 Invalid tlsio_state. Expected state is TLSIO_STATE_OPENING_UNDERLYING_IO.\r\nError: Time:Thu Nov 29 17:04:08 2018 File:/azure-iot-sdk-c/c-utility/adapters/tlsio_openssl.c Func:tlsio_openssl_open Line:1258 Failed opening the underlying I/O.\r\nError: Time:Thu Nov 29 17:04:08 2018 File:/azure-iot-sdk-c/umqtt/src/mqtt_client.c Func:mqtt_client_connect Line:1001 Error: io_open failed\r\nError: Time:Thu Nov 29 17:04:08 2018 File:/azure-iot-sdk-c/iothub_client/src/iothubtransport_mqtt_common.c Func:SendMqttConnectMsg Line:2141 failure connecting to address [address].\r\n````\r\n"},"comment":{"url":"https://api.github.com/repos/Azure/azure-iot-sdk-c/issues/comments/446742084","html_url":"https://github.com/Azure/azure-iot-sdk-c/issues/746#issuecomment-446742084","issue_url":"https://api.github.com/repos/Azure/azure-iot-sdk-c/issues/746","id":446742084,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0Njc0MjA4NA==","user":{"login":"ewertons","id":12401690,"node_id":"MDQ6VXNlcjEyNDAxNjkw","avatar_url":"https://avatars0.githubusercontent.com/u/12401690?v=4","gravatar_id":"","url":"https://api.github.com/users/ewertons","html_url":"https://github.com/ewertons","followers_url":"https://api.github.com/users/ewertons/followers","following_url":"https://api.github.com/users/ewertons/following{/other_user}","gists_url":"https://api.github.com/users/ewertons/gists{/gist_id}","starred_url":"https://api.github.com/users/ewertons/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ewertons/subscriptions","organizations_url":"https://api.github.com/users/ewertons/orgs","repos_url":"https://api.github.com/users/ewertons/repos","events_url":"https://api.github.com/users/ewertons/events{/privacy}","received_events_url":"https://api.github.com/users/ewertons/received_events","type":"User","site_admin":false},"created_at":"2018-12-12T21:01:03Z","updated_at":"2018-12-12T21:01:03Z","author_association":"COLLABORATOR","body":"I see, thanks for trying that.\r\nI will ask our field engineer to contact you to get some more details.\r\n\r\nHave you tried using AMQP instead of MQTT for protocol?\r\nIf you can try that, please also enable [verbose logs](https://github.com/Azure/azure-iot-sdk-c/pull/754/files#diff-bb352a1a08fd67cc950d8b756b67c148R243)."}}
{"actor":{"display_login":"ewertons"}}