You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The aws iot device client always tries to write a sample-shadow-output directory or file, even when sample shadow is disabled.
Our filesystem is read-only so the AWS IoT device client refuses to start.
To Reproduce
Steps to reproduce the behavior:
Make the shadow-output file unwritable for some reason (e.g. read-only fs, lack of permissions, etc)
aws iot device client will fail to launch
Expected behavior
The AWS IoT device client should not try to write a sample shadow output file if the sample shadow feature is disabled. Even if it did try to write it, it should not abort if the sample shadow feature is disabled.
Actual behavior
The aws iot device client fails with "Failed to access/create default directories: ~/.aws-iot-device-client/sample-shadow/ required for storage of shadow document".
Hello @antoine-sac , thank you for bringing up this issue. After taking a look at the code, I observed that we are creating shadow files while reading the CLI input from user over here.
To resolve this issue, we will have to move the shadow file creation logic to initialization method over here with the condition of shadow feature is enabled.
Meanwhile to unblock yourself, you can start your client with user permission to create the file and directory so that the device client will be able to create the shadow file and directory and will not terminate with the error you are seeing right now.
Another way of temporarily fixing the issue is to manually create the shadow output file and directory with correct permissions (700/S_IRWXU) and pass the the file path via config file so the device client will not try to create the file/directory. Your config file should look like this:
Thanks for providing a possible workaround. Note that using a shadow-output-file in the config file doesn't work.
The only way to get around the problem (assuming the DEFAULT_SHADOW_OUTPUT_FILE is really not writeable) is to provide a --shadow-output-file in the CLI.
We have implemented this fix for now but would appreciate a proper resolution !
Describe the bug
The aws iot device client always tries to write a sample-shadow-output directory or file, even when sample shadow is disabled.
Our filesystem is read-only so the AWS IoT device client refuses to start.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The AWS IoT device client should not try to write a sample shadow output file if the sample shadow feature is disabled. Even if it did try to write it, it should not abort if the sample shadow feature is disabled.
Actual behavior
The aws iot device client fails with "Failed to access/create default directories: ~/.aws-iot-device-client/sample-shadow/ required for storage of shadow document".
Logs
Running
/sbin/aws-iot-device-client --config-file /etc/aws-iot-device-client/aws-iot-device-client.conf
Environment :
** Additional context **
We use this recipe to build the aws-iot-device-client in our yocto image : https://github.com/aws4embeddedlinux/meta-aws/blob/2550d80f70777303caeb5daa5195d3e36a772b66/recipes-iot/aws-iot-device-client/aws-iot-device-client_1.9.bb
The text was updated successfully, but these errors were encountered: