Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.424.0 'Invalid request input' on APIGateway.putIntegrationResponse #2588

Closed
gojko opened this issue Mar 20, 2019 · 4 comments
Closed

2.424.0 'Invalid request input' on APIGateway.putIntegrationResponse #2588

gojko opened this issue Mar 20, 2019 · 4 comments

Comments

@gojko
Copy link

gojko commented Mar 20, 2019

since release 2.424.0, putIntegrationResponse in API gateway refuses to execute valid requests containing httpMethod, resourceId, restApiId and statusCode

this works with [email protected], but does not work with 2.424.0. (of course, relevant resource IDs need to be set up first)

const aws = require('aws-sdk')
const apig = new aws.APIGateway({region: 'us-west-2'})
apig.putIntegrationResponse({httpMethod: "GET", resourceId: "qlss4p", restApiId: "zrsx0azkpc", statusCode: "200"}).promise()

this is an error thrown from 2.424.0

let resp = apig.putIntegrationResponse({httpMethod: "GET", resourceId: "qlss4p", restApiId: "zrsx0azkpc", statusCode: "200"}).promise().then(console.log).catch(console.error);
undefined
> { BadRequestException: Invalid request input
    at Object.extractError (/Users/gojko/work/claudiajs/claudia/node_modules/aws-sdk/lib/protocol/json.js:51:27)
    at Request.extractError (/Users/gojko/work/claudiajs/claudia/node_modules/aws-sdk/lib/protocol/rest_json.js:55:8)
    at Request.callListeners (/Users/gojko/work/claudiajs/claudia/node_modules/aws-sdk/lib/sequential_executor.js:106:20)
    at Request.emit (/Users/gojko/work/claudiajs/claudia/node_modules/aws-sdk/lib/sequential_executor.js:78:10)
    at Request.emit (/Users/gojko/work/claudiajs/claudia/node_modules/aws-sdk/lib/request.js:683:14)
    at Request.transition (/Users/gojko/work/claudiajs/claudia/node_modules/aws-sdk/lib/request.js:22:10)
    at AcceptorStateMachine.runTo (/Users/gojko/work/claudiajs/claudia/node_modules/aws-sdk/lib/state_machine.js:14:12)
    at /Users/gojko/work/claudiajs/claudia/node_modules/aws-sdk/lib/state_machine.js:26:10
    at Request.<anonymous> (/Users/gojko/work/claudiajs/claudia/node_modules/aws-sdk/lib/request.js:38:9)
    at Request.<anonymous> (/Users/gojko/work/claudiajs/claudia/node_modules/aws-sdk/lib/request.js:685:12)
  message: 'Invalid request input',
  code: 'BadRequestException',
  time: 2019-03-20T16:07:50.031Z,
  requestId: '4f173039-4b2a-11e9-a006-dd77bf748a11',
  statusCode: 400,
  retryable: false,
  retryDelay: 18.532212924725357 }
@gojko
Copy link
Author

gojko commented Mar 20, 2019

done some more investigation on this, looks like responseTemplates became mandatory in this version. Documentation (https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/APIGateway.html#putIntegrationResponse-property) suggests that this should not be mandatory

@srchase
Copy link
Contributor

srchase commented Mar 20, 2019

@gojko

Thanks for the investigation.

It actually looks like this was due to the change here: #2574

Starting in 2.424.0, the body for this operation was empty, whereas in 2.423.0 and earlier, the body was {}. The service is failing validation on the empty body in the request.

@srchase
Copy link
Contributor

srchase commented Mar 21, 2019

@gojko

This has been fixed in 2.426.0.

Thanks again for raising this issue.

@lock
Copy link

lock bot commented Sep 25, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@lock lock bot locked as resolved and limited conversation to collaborators Sep 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants