cli: Netlify CLI deploy command error when deploying golang binary : Invalid AWS Lambda parameters. Reserved keys used in this request
Hi, i want to try netlify to host my golang project. I clone the hello world project from here https://github.com/netlify/aws-lambda-go-example and have installed netlify via npm install netlify-cli -g. The netlify build command had run successfully and the binary is created under functions folder. The problem happens when i run netlify deploy --prod and it gives me this error (took with DEBUG on):
✔ CDN requesting 0 files and 1 functions
▐|\____________▌ (0/1) Uploading hello-lambda...Warning: JSONHTTPError: undefined 500
at Object.warn (/home/wahyudibo/.nvm/versions/node/v12.18.0/lib/node_modules/netlify-cli/node_modules/@oclif/errors/lib/index.js:49:15)
at DeployCommand.warn (/home/wahyudibo/.nvm/versions/node/v12.18.0/lib/node_modules/netlify-cli/node_modules/@oclif/command/lib/command.js:57:16)
at DeployCommand.run (/home/wahyudibo/.nvm/versions/node/v12.18.0/lib/node_modules/netlify-cli/src/commands/deploy.js:216:16)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
Warning:
{
"name": "JSONHTTPError",
"status": 500,
"json": {
"error": "Invalid AWS Lambda parameters. Reserved keys used in this request"
}
}
at Object.warn (/home/wahyudibo/.nvm/versions/node/v12.18.0/lib/node_modules/netlify-cli/node_modules/@oclif/errors/lib/index.js:49:15)
at DeployCommand.warn (/home/wahyudibo/.nvm/versions/node/v12.18.0/lib/node_modules/netlify-cli/node_modules/@oclif/command/lib/command.js:57:16)
at DeployCommand.run (/home/wahyudibo/.nvm/versions/node/v12.18.0/lib/node_modules/netlify-cli/src/commands/deploy.js:217:16)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
▐_|\___________▌ (0/1) Uploading hello-lambda...JSONHTTPError: Internal Server Error
at parseResponse (/home/wahyudibo/.nvm/versions/node/v12.18.0/lib/node_modules/netlify-cli/node_modules/netlify/src/methods/response.js:12:11)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async callMethod (/home/wahyudibo/.nvm/versions/node/v12.18.0/lib/node_modules/netlify-cli/node_modules/netlify/src/methods/index.js:36:26)
i already tried googling with Invalid AWS Lambda parameters. Reserved keys used in this request keyword and stumbled upon this thread : https://community.netlify.com/t/build-fails-invalid-aws-lambda-parameters/4235/3 and the case is almost similar. The difference is the solution mentioned that
the restriction of the maximum size of environment variables concatenated all together (e.g. VAR1=val1,VAR2=val2) should not be bigger than 4,096 bytes.
but it confuses me more since i have no environment variables to begin with since this is a hello world project. I also take a look at the reserved environment variable at https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#configuration-envvars-runtime but found that my environment variables is not conflicted with the one mentioned in AWS documentation.
My question is: If netlify deploy takes into account my local environment variable size so it violates the 4096 rules, what is the workaround to deploy my functions and site to netlify using netlify cli ? i know there are ways such using trigger from git commits but i want to stick with netlify deploy command if it’s possible. I also read in documentation that it should be run without problem : https://cli.netlify.com/commands/deploy
Thanks in advance!
PS: i’m using go mod and here is my Makefile
build:
GO111MODULE="on"
mkdir -p functions
go get ./...
go build -o functions/hello-lambda ./...
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 8
- Comments: 15 (7 by maintainers)
Hi all! First of all, apologies for the really slow response on this issue.
We’ve been working on a number of improvements to our Go functions offering, namely the new local development experience using the CLI and the ability to build the functions from source. Note that this doesn’t mean we’re forcing people to use our build system, because you can build the functions wherever you like by running
netlify deploy --build. Have you tried using this command?We still want to address the specific use case of folks who prefer to build the binaries themselves, and I’m sorry that this has been a frustrating experience. We’ll look into this and provide an update by the end of this week.
Thanks for your patience.