Skip to content

Getting CONNECTION_LOST on device #521

@AleksandarGT

Description

@AleksandarGT

Describe the bug

Sometimes a device loses connection to iot core and from the fleet indexing status I can see CONNECTION_LOST. I'm not sure what may cause this as there aren't any logs produced by the iot client to show that internet connection has stopped.

While IoT core shows the device as offline due to the connection lost, if I connect to the device via ssh through cloudflare I see that it's online and working as expected. The problem with connection lost goes away if I restart the iot device client.

From the logs you can see that on 2025-08-20T10:02:47.248Z I manually restarted the service for iot device client.

Logs


2025-08-20T09:17:52.586Z [WARN]  {FileUtils.cpp}: Permissions to given file/dir path '/home/sens/.aws-iot-device-client/aws-iot-device-client.conf' is not set to recommended value... {Permissions: {desired: 640, actual: 644}}
2025-08-20T09:17:52.588Z [INFO]  {Config.cpp}: Successfully fetched JSON config file from /home/sens/.aws-iot-device-client/aws-iot-device-client.conf : {...}
2025-08-20T09:17:52.589Z [INFO]  {Config.cpp}: Not creating directory ~/.aws-iot-device-client/sample-shadow/ since sample shadow is disabled
2025-08-20T09:17:52.589Z [INFO]  {Config.cpp}: Successfully fetched JSON config file from /home/sens/.aws-iot-device-client/aws-iot-device-client-runtime.conf : {
"runtime-config": {
    "completed-fp": true,
    "cert": "/home/sens/.aws-iot-device-client/keys/active-certificate.pem.crt",
    "key": "/home/sens/.aws-iot-device-client/keys/active-private.pem.key",
    "thing-name": "hvam-xx",
    "device-config": {
        
        }
    }
}
2025-08-20T09:17:52.589Z [INFO]  {Config.cpp}: Successfully fetched Runtime config file '~/.aws-iot-device-client/aws-iot-device-client-runtime.conf' and validated its content.
2025-08-20T09:17:52.589Z [DEBUG] {Config.cpp}: Did not find a http proxy config file /home/sens/.aws-iot-device-client/http-proxy.conf, assuming HTTP proxy is disabled on this device
2025-08-20T10:02:47.248Z [ERROR] {SharedCrtResourceManager.cpp}: MQTT Connection interrupted with error: `aws-c-io: AWS_IO_SOCKET_CLOSED, socket is closed.`. Device Client will retry connection until it is successfully connected to the core. 
2025-08-20T10:03:07.450Z [WARN]  {FileUtils.cpp}: Permissions to given file/dir path '/home/sens/.aws-iot-device-client/aws-iot-device-client.conf' is not set to recommended value... {Permissions: {desired: 640, actual: 644}}
2025-08-20T10:03:07.450Z [INFO]  {Config.cpp}: Successfully fetched JSON config file from /home/sens/.aws-iot-device-client/aws-iot-device-client.conf : {...}

Environment (please complete the following information):

  • OS: Debian
  • Raspberry PI 4
  • Architecture: ARM
  • Device Client commit: 7f9547b

Additional context

Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions