Greengrass V2的IDT显示错误,请求包含的安全令牌无效,尽管环境已设置了正确的AWS_SECRET_ACCESS_KEY和AWS_ACCESS_KEY_ID

0

【以下的问题经过翻译处理】 已经检查了环境是否设置了AWS_ACCESS_KEY_ID和AWS_SECRET_ACCESS_KEY,并且也检查了这两个密钥没有过期。 使用相同的AWS_ACCESS_KEY_ID和AWS_SECRET_ACCESS_KEY greengrass.service可以连接到aws,但是idt显示错误,logs/lambdadeployment/lambdaDeploymentTest下的日志显示如下:

更新以下日志

2023-03-15T10:03:37.995Z [INFO] (main) com.aws.greengrass.util.platforms.Platform: Getting platform instance com.aws.greengrass.util.platforms.unix.linux.LinuxPlatform.. {}
2023-03-15T10:03:38.136Z [INFO] (main) com.aws.greengrass.lifecyclemanager.Kernel: No ongoing deployment detected. Proceed as default. {}
2023-03-15T10:03:38.506Z [INFO] (main) com.aws.greengrass.config.Configuration: config-loading. Read configuration from a file path. {path=/test/greengrass/v2/config/config.tlog}
2023-03-15T10:03:38.711Z [INFO] (main) com.aws.greengrass.lifecyclemanager.Kernel: effective-config-dump-complete. {file=/test/greengrass/v2/config/effectiveConfig.yaml}
2023-03-15T10:03:39.243Z [INFO] (main) com.aws.greengrass.deployment.DeviceConfiguration: Copy Nucleus artifacts to component store. {destination=/test/greengrass/v2/packages/artifacts-unarchived/aws.greengrass.Nucleus/2.9.4/aws.greengrass.nucleus, source=/test/GreengrassInstaller}
2023-03-15T10:03:45.808Z [ERROR] (main) com.aws.greengrass.easysetup.GreengrassSetup: Error while trying to setup Greengrass Nucleus. {}
software.amazon.awssdk.services.iot.model.IotException: The security token included in the request is invalid. (Service: Iot, Status Code: 403, Request ID: 58a47128-daf5-4850-8b45-bdd4985dcd5b)

我的 idts/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"
  }
}

lambdaDeploymentTest日志如下:

time="2023-03-25T09:32:14+08:00" level=info msg="Device architecture: aarch64"
time="2023-03-25T09:32:15+08:00" level=info msg="Executing lambda deployment test setup"
time="2023-03-25T09:32:15+08:00" level=info msg="Fetching installed Greengrass provisioning configuration"
time="2023-03-25T09:32:15+08:00" level=warning msg="Encountered error fetching provisioned Thing: InvalidParameter: 1 validation error(s) found.\n- minimum field size of 1, DescribeThingInput.ThingName.\n"
time="2023-03-25T09:32:15+08:00" level=error msg="Setting up device for testing failed with error Encountered error fetching provisioned Thing: InvalidParameter: 1 validation error(s) found.\n- minimum field size of 1, DescribeThingInput.ThingName.\n"
time="2023-03-25T09:32:15+08:00" level=info msg="Cleaning up test resources..."
time="2023-03-25T09:32:15+08:00" level=info msg="Executing lambda deployment test cleanup"
time="2023-03-25T09:32:15+08:00" level=info msg="Pulled component logs to /home/user/test/devicetester_greengrass_v2_linux/results/20230325T093026/logs/lambdadeployment/lambdaDeploymentTest/.log"
time="2023-03-25T09:32:15+08:00" level=warning msg="Copying lambda component log from DUT failed: Command '{sudo /test/greengrass/tmp/busybox cat /test/greengrass/v2/logs/.log map[] 0s}' exited with code 1. Error output: cat: can't open '/test/greengrass/v2/logs/.log': No such file or directory\n."
time="2023-03-25T09:32:15+08:00" level=warning msg="Deleting lambda qualification component failed:  failed to get componentArn"
time="2023-03-25T09:32:15+08:00" level=info msg="Skipping the cleanup of installed Greengrass"
profile picture
专家
已提问 6 个月前32 查看次数
1 回答
0

【以下的回答经过翻译处理】 不需要设置AWS_SESSION_TOKEN。

您能也检查下 ~/.aws/credentials中得AWS凭证文件吗?此问题的说明在此处(https://docs.aws.amazon.com/greengrass/v2/developerguide/troubleshooting.html#error-invalid-security-token)。 请反馈这是否有效。

-Sai

profile picture
专家
已回答 6 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则