Skip to content
This repository has been archived by the owner on Feb 23, 2023. It is now read-only.

Fail to launch cloud-function-aws sample behind Amazon API Gateway #440

Closed
masatotoro opened this issue Jan 10, 2021 · 3 comments
Closed
Assignees
Labels
type: bug A general bug
Milestone

Comments

@masatotoro
Copy link

I would like to launch cloud-function-aws sample behind Amazon API Gateway. But when I make an API call, I get the following error:

Started
HI: {"body": "test", "headers": {"Accept": "*/*", "Content-Length": "4", "Content-Type": "application/x-www-form-urlencoded", "Host": "127.0.0.1:3000", "User-Agent": "curl/7.68.0", "X-Forwarded-Port": "3000", "X-Forwarded-Proto": "http"}, "httpMethod": "POST", "isBase64Encoded": false, "multiValueHeaders": {"Accept": ["*/*"], "Content-Length": ["4"], "Content-Type": ["application/x-www-form-urlencoded"], "Host": ["127.0.0.1:3000"], "User-Agent": ["curl/7.68.0"], "X-Forwarded-Port": ["3000"], "X-Forwarded-Proto": ["http"]}, "multiValueQueryStringParameters": null, "path": "/foobar", "pathParameters": null, "queryStringParameters": null, "requestContext": {"accountId": "123456789012", "apiId": "1234567890", "domainName": "127.0.0.1:3000", "extendedRequestId": null, "httpMethod": "POST", "identity": {"accountId": null, "apiKey": null, "caller": null, "cognitoAuthenticationProvider": null, "cognitoAuthenticationType": null, "cognitoIdentityPoolId": null, "sourceIp": "127.0.0.1", "user": null, "userAgent": "Custom User Agent String", "userArn": null}, "path": "/foobar", "protocol": "HTTP/1.1", "requestId": "eabceada-a428-4332-bd83-75a11b58db9a", "requestTime": "10/Jan/2021:14:35:28 +0000", "requestTimeEpoch": 1610289328, "resourceId": "123456", "resourcePath": "/foobar", "stage": "dev"}, "resource": "/foobar", "stageVariables": null, "version": "1.0"}
END RequestId: f41a2c75-d3a0-483d-8742-92a6e57768f7
REPORT RequestId: f41a2c75-d3a0-483d-8742-92a6e57768f7	Init Duration: 0.12 ms	Duration: 27.18 ms	Billed Duration: 100 ms	Memory Size: 512 MB	Max Memory Used: 512 MB	
Invalid lambda response received: Lambda returned <class 'str'> instead of dict

Please give me some advice on how to solve this problem. Should I use Jackson's ObjectMapper to set the Json of the String as the return value of the Function?

@sdeleuze sdeleuze self-assigned this Jan 12, 2021
@sdeleuze sdeleuze added the type: bug A general bug label Jan 12, 2021
@sdeleuze sdeleuze added this to the 0.9.0 milestone Jan 12, 2021
@sdeleuze
Copy link
Contributor

@masatotoro I did the name changes, could you please try again? (you may have to use Spring Boot 2.4.1 due to #446).

@sdeleuze
Copy link
Contributor

Since no feedback I assume it is fixed, please comment if that's not the case.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug A general bug
Development

No branches or pull requests

2 participants