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

write_get_object_response not setting correct host #622

Closed
mohantaylor opened this issue Mar 21, 2023 · 6 comments
Closed

write_get_object_response not setting correct host #622

mohantaylor opened this issue Mar 21, 2023 · 6 comments

Comments

@mohantaylor
Copy link

I am having a few issues getting write_get_object_response to work, turning on TRACE looks like the hostname is not being set correctly?

The code performing the write_get_object_response:

client.write_get_object_response()
.body(ByteStream::new(SdkBody::from("Test data")))
.set_request_token(Some(token))
.set_request_route(Some(route))
.set_status_code(Some(200))
.send()
.await?;

And in the logs I see the following:

/WriteGetObjectResponse
x-id=WriteGetObjectResponse
content-length:24
content-type:application/octet-stream
host:s3-object-lambda.us-east-2.amazonaws.com
x-amz-content-sha256:UNSIGNED-PAYLOAD
x-amz-date:20230321T083024Z
x-amz-fwd-status:200
x-amz-request-route:io-cell002
...

I thought the host should be io-cell002.s3-object-lambda.us-east-2.amazonaws.com ?

The lambda then fails with:

ERROR Lambda runtime invoke{requestId="..." xrayTraceId="Root=...Sampled=0"}: DispatchFailure(DispatchFailure { source: ConnectorError { kind: Io, source: hyper::Error(Connect, ConnectError("dns error", Custom { kind: Uncategorized, error: "failed to lookup address information: No address associated with hostname" })) } })

Thanks!

@peterborkuti
Copy link
Contributor

peterborkuti commented Apr 3, 2023

Hi @mohantaylor ,

I created an example for s3 object lambda and I probably got the same error as you:
https://github.com/peterborkuti/basic-s3-object-lambda-thumbnail

But I could not get that nice error message as you. I am new to rust and error handling seems to me hard.

I identified that the error is IO Error, but I could not get the details of this IO Error.
Here is the exact line where my code needs improvement:
https://github.com/peterborkuti/basic-s3-object-lambda-thumbnail/blob/cab11cf2ca40156c2a2e28502bb50fbda9673908/src/s3.rs#L66

If you can help me in this code to provide more granular error message, we can provide this example to the developers to help them identify the root cause of the issue.

Thank you in advance
Péter

@calavera
Copy link
Contributor

Unless I'm mistaken, this looks like an error in the AWS SDK for Rust. I'd recommend you to open the issue in that repo instead since the people that work on this project don't have much knowledge about the SDK.

@peterborkuti
Copy link
Contributor

Thanks, I already noticed it and opened an issue:
awslabs/aws-sdk-rust#781
Sorry to not documented here.

@calavera
Copy link
Contributor

closing in favor of that sdk issue

@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for the maintainers of this repository to see.
If you need more assistance, please open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

@peterborkuti
Copy link
Contributor

The issue was fixed in the 01 of May Pre-Release of aws-rust-sdk.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants