AWS IDT problem [Error: 106] problem

0

Hi
I just got some problem when I using device tester
The following are my error message and my config file
I don't know what I missing casue that problem?
I already use IAM create account and export in terminal.
yichen@yichen-desktop:~/devicetester_greengrass_linux/bin$ sudo ./devicetester_linux_x86-64 run-suite
[sudo] password for yichen:
time="2019-10-02T15:23:48+08:00" level=info msg=Using suite: GGQ_1
time="2019-10-02T15:23:48+08:00" level=info msg=Using pool: 1
time="2019-10-02T15:23:48+08:00" level=info msg=Running test case... executionId=9326d229-e4e5-11e9-a446-080027639d9 suiteId=GGQ groupId=version testCaseId=ggc_version_check_test deviceId=123
time="2019-10-02T15:23:48+08:00" level=error msg=AWS credentials not found: EnvAccessKeyNotFound: AWS_ACCESS_KEY_ID or AWS_ACCESS_KEY not found in environment suiteId=GGQ groupId=version testCaseId=ggc_version_check_test deviceId=123 executionId=9326d229-e4e5-11e9-a446-0800276f39d9
time="2019-10-02T15:23:48+08:00" level=info msg=Finished running test case... testCaseId=ggc_version_check_test deviceId=123 executionId=9326d229-e4e5-11e9-a446-0800276f39d9 suiteId=GGQ groupId=version
time="2019-10-02T15:23:48+08:00" level=info msg=--- FAIL: TestGGCVersion (0.00s) suiteId=GGQ groupId=version
testCaseId=ggc_version_check_test deviceId=123 executionId=9326d229-e4e5-11e9-a446-0800276f39d9
time="2019-10-02T15:23:48+08:00" level=info msg=FAIL executionId=9326d229-e4e5-11e9-a446-0800276f39d9 suiteId=GG Q groupId=version testCaseId=ggc_version_check_test deviceId=123
time="2019-10-02T15:23:48+08:00" level=error msg=Test exited unsuccessfully executionId=9326d229-e4e5-11e9-a446-800276f39d9 testCaseId=ggc_version_check_test error=exit status 1
time="2019-10-02T15:23:48+08:00" level=info msg=All tests finished. executionId=9326d229-e4e5-11e9-a446-0800276f9d9
time="2019-10-02T15:23:49+08:00" level=info msg=

========== Test Summary ==========
Execution Time: 1s
Tests Completed: 1
Tests Passed: 0
Tests Failed: 1
Tests Skipped: 0

Test Groups:
version: FAILED

Failed Tests:
Group Name: version
Test Name: Test GGC Version version
Reason: [Error: 106] ValidationError: AWS credentials not found: EnvAccessKeyNotFound: AWS_ACCESS_KEY_ID or AWS_ACCESS_KEY not found in environment. Refer to the logs and troubleshooting section of IDT User Guide https://docs.aws.amazon.com/greengrass/latest/developerguide/device-tester-for-greengrass-ug.html for more information.

Path to AWS IoT Device Tester Report: /home/yichen/devicetester_greengrass_linux/results/9326d229-e4e5-11e9-a446 -0800276f39d9/awsiotdevicetester_report.xml
Path to Test Execution Logs: /home/yichen/devicetester_greengrass_linux/results/9326d229-e4e5-11e9-a446-0800276f9d9/logs
Path to Aggregated JUnit Report: /home/yichen/devicetester_greengrass_linux/results/9326d229-e4e5-11e9-a446-0800276f39d9/GGQ_Report.xml

{
"log": {
"location": "../logs/"
},
"configFiles": {
"root": "../configs",
"device": "../configs/device.json"
},
"testPath": "../tests/",
"reportPath": "../results/",
"certificatePath": "../certificates/",
"awsRegion": "us-west-2",
"auth": {
"method": "environment"
}

[
{
"id": "1",
"sku": "8783d",
"features": [
{
"name": "os",
"value": "ubuntu"
},
{
"name": "arch",
"value": "x86_64"
}
],
"kernelConfigLocation": "",
"greengrassLocation": "/greengrass",
"devices": [
{
"id": "123",
"connectivity": {
"protocol": "ssh",
"ip": "10.1.70.127",
"auth": {
"method": "pki",
"credentials": {
"user": "yichen",
"privKeyPath": "/home/yichen/.ssh/id_rsa"
}
}
}
}
]
}
]

yichen
asked 5 years ago261 views
4 Answers
0

Hi yichen,

IDT needs AWS credentials to run, and allows two way to provision them using credentials file and environment variables(https://docs.aws.amazon.com/greengrass/latest/developerguide/set-config.html).
Based on your config file given below, you seem to be using environment variables( see "auth" set in config.json). The console output shows "AWS credentials not found: EnvAccessKeyNotFound: AWS_ACCESS_KEY_ID or AWS_ACCESS_KEY not found in environment".
IDT is expecting AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY set as environment variables to run. Please set these variables and export them as environment variables. Refer https://docs.aws.amazon.com/greengrass/latest/developerguide/set-config.html for more details.

Thanks,

answered 5 years ago
0

Hi
I already tried but not working.

yichen@yichen-desktop:/devicetester_greengrass_linux/configs$ cat /.aws/credentials
[default]
aws_access_key_id = *********************
aws_secret_access_key = *********************
yichen@yichen-desktop:
/devicetester_greengrass_linux/configs$ cat config.json
{
"log": {
"location": "../logs/"
},
"configFiles": {
"root": "../configs",
"device": "../configs/device.json"
},
"testPath": "../tests/",
"reportPath": "../results/",
"certificatePath": "../certificates/",
"awsRegion": "us-west-2",
"auth": {
"method": "environment"
}
}yichen@yichen-desktop:
/devicetester_greengrass_linux/configs$ export AWS_ACCESS_KEY_ID=*********************
yichen@yichen-desktop:/devicetester_greengrass_linux/configs$ export AWS_SECRET_ACCESS_KEY=*********************
yichen@yichen-desktop:
/devicetester_greengrass_linux/configs$ export -p | grep AWS
declare -x AWS_ACCESS_KEY_ID=""
declare -x AWS_SECRET_ACCESS_KEY="
"
yichen@yichen-desktop:~/devicetester_greengrass_linux/configs$ sudo ./../bin/devicetester_linux_x86-64 run-suite
[sudo] password for yichen:
time="2019-10-03T08:31:38+08:00" level=info msg=Using suite: GGQ_1
time="2019-10-03T08:31:38+08:00" level=info msg=Using pool: 1
time="2019-10-03T08:31:38+08:00" level=info msg=Running test case... suiteId=GGQ groupId=version testCaseId=ggc_version_check_test deviceId=123 executionId=28f97589-e575-11e9-9731-0800276f39d9
time="2019-10-03T08:31:38+08:00" level=error msg=AWS credentials not found: EnvAccessKeyNotFound: AWS_ACCESS_KEY_ID or AWS_ACCESS_KEY not found in environment suiteId=GGQ groupId=version testCaseId=ggc_version_check_test deviceId=123 executionId=28f97589-e575-11e9-9731-0800276f39d9
time="2019-10-03T08:31:38+08:00" level=info msg=Finished running test case... executionId=28f97589-e575-11e9-9731-0800276f39d9 suiteId=GGQ groupId=version testCaseId=ggc_version_check_test deviceId=123
time="2019-10-03T08:31:38+08:00" level=info msg=--- FAIL: TestGGCVersion (0.00s) testCaseId=ggc_version_check_test deviceId=123 executionId=28f97589-e575-11e9-9731-0800276f39d9 suiteId=GGQ groupId=version
time="2019-10-03T08:31:38+08:00" level=info msg=FAIL deviceId=123 executionId=28f97589-e575-11e9-9731-0800276f39d9 suiteId=GGQ groupId=version testCaseId=ggc_version_check_test
time="2019-10-03T08:31:38+08:00" level=error msg=Test exited unsuccessfully testCaseId=ggc_version_check_test error=exit status 1 executionId=28f97589-e575-11e9-9731-0800276f39d9
time="2019-10-03T08:31:38+08:00" level=info msg=All tests finished. executionId=28f97589-e575-11e9-9731-0800276f39d9
time="2019-10-03T08:31:38+08:00" level=info msg=

========== Test Summary ==========
Execution Time: 1s
Tests Completed: 1
Tests Passed: 0
Tests Failed: 1
Tests Skipped: 0

Test Groups:
version: FAILED

Failed Tests:
Group Name: version
Test Name: Test GGC Version version
Reason: [Error: 106] ValidationError: AWS credentials not found: EnvAccessKeyNotFound: AWS_ACCESS_KEY_ID or AWS_ACCESS_KEY not found in environment. Refer to the logs and troubleshooting section of IDT User Guide https://docs.aws.amazon.com/greengrass/latest/developerguide/device-tester-for-greengrass-ug.html for more information.

Path to AWS IoT Device Tester Report: /home/yichen/devicetester_greengrass_linux/results/28f97589-e575-11e9-9731-0800276f39d9/awsiotdevicetester_report.xml
Path to Test Execution Logs: /home/yichen/devicetester_greengrass_linux/results/28f97589-e575-11e9-9731-0800276f39d9/logs
Path to Aggregated JUnit Report: /home/yichen/devicetester_greengrass_linux/results/28f97589-e575-11e9-9731-0800276f39d9/GGQ_Report.xml

yichen
answered 5 years ago
0

Hi yichen,

You have two ways to fix this:
1). You can just run IDT without using sudo command: ./devicetester_linux_x86-64 run-suite.
Because when you use sudo, it will open a new shell which will not have the environment variables you configured before.
2). I noticed that you have configured ~/.aws/credentials, the other way to fix this is to change your config.json to use file instead of environment.
i.e.
"auth": {
"method": "file",
"credentials": {"profile": "default"}
}

Please go to https://docs.aws.amazon.com/greengrass/latest/developerguide/set-config.html for more details.

Thanks

Edited by: aws-jessica on Oct 3, 2019 4:18 PM

answered 5 years ago
0

Run device test without sudo solve error106 problem
Thanks for your help

yichen
answered 5 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions