Closed BrentonWatt closed 5 years ago
At the time of this posting the AWS SDK was updated 12 hours ago. I'm not sure if the issue is there.
I am getting a similar error... claudia 5.4, aws-serverless-express 3.3.5
`claudia create --handler lambda.handler --deploy-proxy-api --region us-east-1 packaging files npm install -q --no-audit --production npm WARN server@1.0.0 No description npm WARN server@1.0.0 No repository field.
validating package npm dedupe -q --no-package-lock
creating REST API apigateway.setAcceptHeader
{ BadRequestException: Invalid request input
at Object.extractError (/usr/local/lib/node_modules/claudia/node_modules/aws-sdk/lib/protocol/json.js:51:27)
at Request.extractError (/usr/local/lib/node_modules/claudia/node_modules/aws-sdk/lib/protocol/rest_json.js:55:8)
at Request.callListeners (/usr/local/lib/node_modules/claudia/node_modules/aws-sdk/lib/sequential_executor.js:106:20)
at Request.emit (/usr/local/lib/node_modules/claudia/node_modules/aws-sdk/lib/sequential_executor.js:78:10)
at Request.emit (/usr/local/lib/node_modules/claudia/node_modules/aws-sdk/lib/request.js:683:14)
at Request.transition (/usr/local/lib/node_modules/claudia/node_modules/aws-sdk/lib/request.js:22:10)
at AcceptorStateMachine.runTo (/usr/local/lib/node_modules/claudia/node_modules/aws-sdk/lib/state_machine.js:14:12)
at /usr/local/lib/node_modules/claudia/node_modules/aws-sdk/lib/state_machine.js:26:10
at Request.
@pjay79 According to @gojko it is an issue with the AWS-SDK dependancy, there was an update to it last night and it's caused a backwards compatibility issue. I'm waiting for more feedback. You can follow here if you want https://gitter.im/claudiajs/claudia
I narrowed this down to a single method, but the bug is in aws-sdk
, so I don't really have a way of fixing it. I logged it as https://github.com/aws/aws-sdk-js/issues/2588. Meanwhile, downgrade your aws-sdk
to the previous version (npm i aws-sdk@2.423.0 -S) and it should work
@gojko how would we do this in a pipeline deployment scenario because I assume we’ll have to run “npm I aws-sdk@2.423.0” inside Claudia’s globally installed location? Or would we just do it at a project level?
@BrentonWatt claudia needs a much older version in its package.json, so your project is likely asking for a newer one (or just asking for the latest one). try downgrading the requirements in your project to that aws sdk until they fix the bug
I have a potential fix for this (https://github.com/claudiajs/claudia/commit/d52e99d34254ed9644d8119a4f28299737c91898) and now running integration tests to check if any other regression bugs were introduced in the last aws-sdk release. expect a new version to come out in a few hours once the tests pass
this seems to be a much wider bug than I initially thought, so we'll have to wait for aws-sdk to fix it. they seem to have a patch in process now (https://github.com/aws/aws-sdk-js/issues/2588)
aws just released 2.426.0 that fixes this issue, so just update to latest aws-sdk and the problem should no longer appear
claudia 5.4.1 is now on NPM, using the fixed version of aws-sdk, so you should no longer have to use the workaround
As of this morning running claudia update on a lambda built with API Builder doesn't work. My local machine was running claudia v5.3.0 and I could successfully update my lambda. My pipeline was getting the latest version on every run, v5.4.0. As of this morning the pipeline started failing. I updated my local machine to 5.4.0 and got the same error. I rolled back to 5.3.0 and now I still have the same error. (It's worth noting, this only affects my APIBuilder lambdas, the other lambdas are fine)
Deploy lambda and connect with API Gateway
{ BadRequestException: Invalid request input at Object.extractError (/usr/lib/node_modules/claudia/node_modules/aws-sdk/lib/protocol/json.js:51:27) at Request.extractError (/usr/lib/node_modules/claudia/node_modules/aws-sdk/lib/protocol/rest_json.js:55:8) at Request.callListeners (/usr/lib/node_modules/claudia/node_modules/aws-sdk/lib/sequential_executor.js:106:20) at Request.emit (/usr/lib/node_modules/claudia/node_modules/aws-sdk/lib/sequential_executor.js:78:10) at Request.emit (/usr/lib/node_modules/claudia/node_modules/aws-sdk/lib/request.js:683:14) at Request.transition (/usr/lib/node_modules/claudia/node_modules/aws-sdk/lib/request.js:22:10) at AcceptorStateMachine.runTo (/usr/lib/node_modules/claudia/node_modules/aws-sdk/lib/state_machine.js:14:12) at /usr/lib/node_modules/claudia/node_modules/aws-sdk/lib/state_machine.js:26:10 at Request.<anonymous> (/usr/lib/node_modules/claudia/node_modules/aws-sdk/lib/request.js:38:9) at Request.<anonymous> (/usr/lib/node_modules/claudia/node_modules/aws-sdk/lib/request.js:685:12) message: 'Invalid request input', code: 'BadRequestException', time: 2019-03-20T07:11:39.380Z, requestId: '67edc9bb-4adf-11e9-8d81-7d57af31f424', statusCode: 400, retryable: false, retryDelay: 84.7705582463123 }
The reason that it's not working even after a version roll-back leads me to believe a dependancy is causing the issue. If I'm missing something painfully obvious, feel free to point it out and close the issue