-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MQTT Connection interrupted with error: `libaws-c-mqtt: AWS_ERROR_MQTT_UNEXPECTED_HANGUP, The connection was closed unexpectedly #464
Comments
Hello @ramg44 , from the description of this issue it looks like you are not setting up your device correctly. I believe you might be making some mistake while starting the client. Can you share the steps to reproduce this issue? |
yeah, when starting it as a service seems like i have not set it up correctly. So what i have done is passed the config file to the executable file. which then picks up the config file but now i see a different error in the logs. could you please help me on this ? Below is thee command i have executed in the build folder to start the client Below is the config file:
Here i the error i see in the logs 2024-07-13T01:18:08.950Z [DEBUG] {Retry.cpp}: Retryable function returned unsuccessfully, sleeping for 900000 milliseconds |
@HarshGandhi-AWS now seeing the below error after using the ats endpoint 2024-07-15T13:46:11.859Z [INFO] {Main.cpp}: Sensor Publish is disabled |
@HarshGandhi-AWS i see below error for disconnection, { |
there were two certificated one with greengrass and the other with thing i created. deactivated one. Then it started working |
After providing the endpoint in the .conf file also it is throwing error like below ERROR] {Config.cpp}: *** AWS IOT DEVICE CLIENT FATAL ERROR: Endpoint is missing
Loaded: loaded (/etc/systemd/system/aws-iot-device-client.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Fri 2024-07-12 12:57:18 EDT; 1min 15s ago
Process: 287010 ExecStart=/sbin/aws-iot-device-client --config-file $CONF_PATH (code=exited, status=1/FAILURE)
Main PID: 287010 (code=exited, status=1/FAILURE)
Jul 12 12:57:18 ubuntu aws-iot-device-client[287012]: 2024-07-12T16:57:18.763Z [INFO] {Config.cpp}: Succesfully create default file: /root/.aws-iot-device-client/sample-shadow/default-sample-shadow-doc>
Jul 12 12:57:18 ubuntu aws-iot-device-client[287012]: 2024-07-12T16:57:18.768Z [DEBUG] {Config.cpp}: Did not find a runtime configuration file, assuming Fleet Provisioning has not run for this device
Jul 12 12:57:18 ubuntu aws-iot-device-client[287012]: 2024-07-12T16:57:18.769Z [DEBUG] {Config.cpp}: Did not find a http proxy config file /root/.aws-iot-device-client/http-proxy.conf, assuming HTTP pro>
Jul 12 12:57:18 ubuntu aws-iot-device-client[287012]: 2024-07-12T16:57:18.770Z [ERROR] {Config.cpp}: *** AWS IOT DEVICE CLIENT FATAL ERROR: Endpoint is missing ***
Jul 12 12:57:18 ubuntu aws-iot-device-client[287012]: 2024-07-12T16:57:18.771Z [ERROR] {Main.cpp}: *** AWS IOT DEVICE CLIENT FATAL ERROR: AWS IoT Device Client must abort execution, reason: Invalid conf>
Jul 12 12:57:18 ubuntu aws-iot-device-client[287012]: 2024-07-12T16:57:18.772Z [DEBUG] {SharedCrtResourceManager.cpp}: Attempting to disconnect MQTT connection
Jul 12 12:57:18 ubuntu aws-iot-device-client[287012]: AWS IoT Device Client must abort execution, reason: Invalid configuration
Jul 12 12:57:18 ubuntu aws-iot-device-client[287012]: Please check the AWS IoT Device Client logs for more information
Jul 12 12:57:18 ubuntu systemd[1]: aws-iot-device-client.service: Main process exited, code=exited, status=1/FAILURE
Jul 12 12:57:18 ubuntu systemd[1]: aws-iot-device-client.service: Failed with result 'exit-code'.
Note :
But when i execute the bin file in /opt/aws-iot-device-client/build by passing the conf file getting below error
root@ubuntu:/opt/aws-iot-device-client/build# ./aws-iot-device-client --config-file /etc/.aws-iot-device-client/aws-iot-device-client.conf
AWS IoT Device Client must abort execution, reason: Failed to establish MQTT connection due to credential/configuration error
Please check the AWS IoT Device Client logs for more information
root@ubuntu:/opt/aws-iot-device-client/build#
below is the error i see in sdk.log
[ERROR] [2024-07-12T18:33:27Z] [0000ffff92ffbd50] [tls-handler] - ctx: Failed to add certificate and private key: No certificate in PEM (Error encountered in /opt/aws-iot-device-client/build/aws-iot-device-sdk-cpp-v2-src/crt/aws-crt-cpp/crt/s2n/crypto/s2n_certificate.c:55)
The text was updated successfully, but these errors were encountered: