ARTICLE DETAIL

资讯详情

深耕郑州网站建设与运营推广的一线实战洞察。

Puter 自托管日志报 DynamoDB aws config requires both access_key and secret_key 怎么排查?

Puter 自托管日志报 DynamoDB aws config requires both access_key and secret_key 怎么排查? Puter 自托管日志报 DynamoDB aws config requires both access_key and secret_key 怎么排查【免费下载链接】puter The Internet Computer! Free, Open-Source, and Self-Hostable.项目地址: https://gitcode.com/GitHub_Trending/pu/puter用 docker compose 自托管 Puter 后执行docker compose logs puter时看到Error: DynamoDB aws config requires both access_key and secret_key说明 Puter 读取的配置文件里 DynamoDBKV 存储凭据块dynamo.aws的字段名用错了或有字段缺失。这篇文章对应官方自托管文档 doc/self-hosting.md 中 Troubleshooting 一节给出的排查结论适用于docker-compose.yml拉起的标准栈puter MariaDB Valkey DynamoDB-local RustFS Caddy。这个错误的含义dynamo.aws配置块只认snake_case字段名access_key/secret_key。doc/self-hosting.md 的 Troubleshooting 一节给出的原因很直接你在dynamo.aws下写成了accessKeyId/secretAccessKey——那是 camelCase 写法只有s3.s3Config块才使用两个块之间不能互换。代码层面的判定逻辑也印证了这一点DynamoDB 客户端在绑定 AWS 凭据时读取aws.access_key和aws.secret_key任一个缺失或为空就抛出这个错误见 src/backend/clients/dynamodb/DDBClient.ts字段类型定义在 src/backend/types.ts 的IAWSCredentials。所以有两类写法都会触发同一行报错字段名写成了accessKeyId/secretAccessKey最常见从 S3 配置块抄过来的字段名正确但某个字段漏填或为空。错误出现在 puter 容器日志里。如果 puter 容器因此起不来浏览器端访问时会看到 Caddy 返回 502 / Bad Gateway——这也是 doc/self-hosting.md Troubleshooting 中列出的现象docker compose logs puter会指出是哪个依赖拒绝了它。检查puter/config/config.json里的dynamo块自托管安装时一行安装脚本或手动 Step 1生成的配置位于puter/config/config.json容器内挂载为/etc/puter/config.json。启动日志中的[config] override from /etc/puter/config.json一行见后文文档示例可以帮你确认当前加载的就是这份文件。打开该文件找到dynamo块检查aws子块是否满足字段名是access_key和secret_key而不是accessKeyId/secretAccessKey两个字段都非空。修正本地 DynamoDBdynamodb-local的配置标准 compose 栈里 KV 存储是amazon/dynamodb-local容器。官方文档 Step 1 给出的正确dynamo块如下直接对照修正dynamo: { endpoint: http://dynamo:8000, bootstrapTables: true, aws: { access_key: fake, secret_key: fake, region: us-east-1 } }两点说明均来自 doc/self-hosting.mddynamo.aws里的凭据是占位值DynamoDB-local 不校验它们但 AWS SDK 要求有非空的值所以文档示例填fake/fakeconfig.template.jsonc 中的注释同样写明 For dynamodb-local, any non-empty values work。bootstrapTables: true让 Puter 在启动时自动创建 KV 表只对本地模拟器设置文档特别强调 Never set against real AWS。连接真实 AWS DynamoDB 时可选分支如果你的部署不走 compose 栈里的dynamo容器而是指向真实 AWS DynamoDB按 config.template.jsonc 的注释调整删掉endpoint字段Local emulator (dynamodb-local) endpoint. Drop this field for real AWS DynamoDBaccess_key/secret_key换成真实 AWS 凭据仍是 snake_case不要把bootstrapTables设为true真实 AWS 的表要通过 Terraform / IaC 预置doc/self-hosting.md 与 src/backend/types.ts 的说明一致。重启并验证修改完puter/config/config.json后按文档 Additional configuration 一节的做法重启并观察日志docker compose restart puter docker compose logs -f puter判定方式日志中不再出现DynamoDB aws config requires both access_key and secret_keyputer 容器正常进入启动流程文档给出的健康启动日志示例结果长这样供对照[config] override from /etc/puter/config.json [mysql] running migrations from /opt/puter/dist/src/backend/clients/database/migrations/mysql: 2 file(s) [mysql] applied mysql_mig_1.sql (...) [mysql] applied mysql_mig_2.sql (9 statements)如果修正后仍报同一行错误按两个方向复查一是确认你编辑的文件就是实际加载的那份启动日志的[config] override from ...一行会显示生效路径二是确认access_key与secret_key两个字段都真实存在且非空——漏填任一字段与写错字段名抛出的是同一个错误。边界提醒字段名规则只有两个例外点dynamo.aws用 snake_caseaccess_key/secret_keys3.s3Config用 camelCaseaccessKeyId/secretAccessKeydoc/self-hosting.md 明确说 Not interchangeable。改配置时别把两个块的写法互相照抄。bootstrapTables: true仅用于本地模拟器指向真实 AWS 时开启它违反了文档的明确限制。【免费下载链接】puter The Internet Computer! Free, Open-Source, and Self-Hostable.项目地址: https://gitcode.com/GitHub_Trending/pu/puter创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考
返回列表