Closed bassmanitram closed 2 months ago
Capturing the request response flow...
REQUEST: Request { method: POST, uri: /.rt/2020-01-01/extension/register, version: HTTP/1.1, headers: {"user-agent": "aws-lambda-rust/0.11.1", "lambda-extension-name": "test-extension", "lambda-extension-accept-feature": "accountId", "content-type": "application/json", "host": "127.0.0.1:2807", "content-length": "23"}, body: Body(Streaming) }
RESPONSE: Response { status: 200, version: HTTP/1.1, headers: {"lambda-extension-identifier": "7cc1236c-b570-4cb8-bab1-924e7dbf0cd6", "content-length": "0", "date": "Thu, 05 Sep 2024 13:46:32 GMT"}, body: Body(Empty) }
Looks like the client is trying to parse JSON from an empty body, though I can't make it work even if I hack the response to 204 or replace the response body with valid JSON.
This is a bug in Cargo Lambda. https://github.com/cargo-lambda/cargo-lambda/pull/690 fixes the problem.
This issue is now closed. Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one.
Perfect - Thx
I have the simplest possible generic extension designed to be run from a script so the script doesn't need to mess with the whole registration protocol via curl etc.
My original script (which does mess with curl) works well with the
cargo lambda watch --only-lambda-apis -a 127.0.0.1 -p 2807
test runtime server.Running this program, however, appears to get just about all the way through registration but then terminates with
Error("EOF while parsing a value", line: 1, column: 0)
- looks very JSON issue-y to me :).The source is:
Note that I am building this with
cargo build
notcargo lambda build --extension
because I'm building the Extension.The intended use is something like this as the actual extensions script (that's simplistic, of course, but you get the idea I hope);
This works in the real Lambda service.
Trace logs: