Key must be a buffer

未关闭
#363 5 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
25/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
停滞
技术栈
aws, javascript, nodejs
领域
cli, cloud

调研方向

Start by reproducing the node-lambda deploy flow using EC2 role credentials, then trace the failure through the AWS SDK signing paths shown in the stack trace, especially util.js, v4_credentials.js, and v4.js. Determine whether role-based credentials are expected to work and define completion as either a successful deployment or a clearly documented limitation.

由索引模型根据 Issue 内容生成。

描述

bug
+ node-lambda deploy
=> Moving files to temporary directory
=> Running npm install --production
=> Zipping deployment package
=> Zipping repo. This might take up to 30 seconds
=> Reading zip file to memory
=> Reading event source file to memory
=> Uploading zip file to AWS Lambda eu-west-1 with parameters:
{ FunctionName: 'api-production',
  Code: { ZipFile: <Buffer 50 4b 03 04 14 00 08 00 08 00 48 6c fb 4a 00 00 00 00 00 00 00 00 00 00 00 00 04 00 00 00 2e 65 6e 76 4d 8e 4d 6f 82 40 18 84 ef fc 0c ef da 6a ad 35 ... > },
  Handler: 'index.handler',
  Role: 'arn:aws:iam::123456789012:role/<lambda_role>',
  Runtime: 'nodejs6.10',
  Description: 'api',
  MemorySize: '128',
  Timeout: '3',
  Publish: false,
  VpcConfig: { SubnetIds: [], SecurityGroupIds: [] },
  Environment: { Variables: null },
  DeadLetterConfig: { TargetArn: null },
  TracingConfig: { Mode: null } }
Key must be a buffer
=> Retrying
{ TypeError: Key must be a buffer
    at TypeError (native)
    at new Hmac (crypto.js:91:16)
    at Object.Hmac (crypto.js:89:12)
    at Object.hmac (/usr/lib/node_modules/node-lambda/node_modules/aws-sdk/lib/util.js:401:30)
    at Object.getSigningKey (/usr/lib/node_modules/node-lambda/node_modules/aws-sdk/lib/signers/v4_credentials.js:59:8)
    at V4.signature (/usr/lib/node_modules/node-lambda/node_modules/aws-sdk/lib/signers/v4.js:97:36)
    at V4.authorization (/usr/lib/node_modules/node-lambda/node_modules/aws-sdk/lib/signers/v4.js:92:36)
    at V4.addAuthorization (/usr/lib/node_modules/node-lambda/node_modules/aws-sdk/lib/signers/v4.js:34:12)
    at /usr/lib/node_modules/node-lambda/node_modules/aws-sdk/lib/event_listeners.js:215:18
    at finish (/usr/lib/node_modules/node-lambda/node_modules/aws-sdk/lib/config.js:315:7) retryDelay: 91.55329953571814 }

I suspect that this is because I am not giving it an IAM account credentials, instead opting to use EC2 roles...

"If your application has AWS credentials baked into it, you're "doing it wrong""

主要语言
JavaScript
星标
1.4k
派生
185
PR 合并指标
30 天内没有已合并 PR

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

motdotla/node-lambda 的其他 Issue

查看 motdotla/node-lambda 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。