-
Notifications
You must be signed in to change notification settings - Fork 193
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
UnknownOperationException from API Gateway + Lambda using lambda_http 0.8.0 and lambda_runtime 0.8 #2676
Comments
Can reproduce. Adding two
which seems to indicate This change in Best course of action to continue investigating this would be to instrument |
Instrumenting
These are, to the eyes of the compiler, fundamentally different types with no relation whatsoever. So what happened here, with a smithy-rs service depending on the
fn raw_http_path(&self) -> String {
self.extensions()
.get::<RawHttpPath>()
.map(|ext| ext.0.clone())
.unwrap_or_default()
} This of course fails, since that type was not inserted by |
This patch also removes the unneeded dependency on `lambda_runtime` by `aws-smithy-http-server-python`. This patch also refactors `LambdaHandler`'s `convert_event` to avoid cloning the URI path when not needed. This is a breaking change. See #2676 why.
Ultimately, we've decided to palliate this shortcoming with documentation in #2683. See the linked PRs/issues for relevant tracked work. |
…2685) This patch also removes the unneeded dependency on `lambda_runtime` by `aws-smithy-http-server-python`. This patch also refactors `LambdaHandler`'s `convert_event` to avoid cloning the URI path when not needed. This is a breaking change. See #2676 why. This patch also bumps `aws-smithy-http-server` dependency on `mime` to 0.3.4. `cargo +nightly-2022-11-16 minimal-versions check --all-features` otherwise fails when using 0.3.0, because we require `impl fmt::Display for mime::FromStrError`, which was first introduced in 0.3.4. As to why `minimal-versions` is now picking `mime` 0.3.0 with this patch, it's because in `lambda_http` 0.7.3, they had [`mime = "0.3.16"`](https://github.com/awslabs/aws-lambda-rust-runtime/blob/99dba6447253ac87cf3cefeb2ba130b50514f9df/lambda-http/Cargo.toml#L35-L35), and in `lambda_http` 0.8.0, they've now relaxed that to [`mime = "0.3"`](https://github.com/awslabs/aws-lambda-rust-runtime/blob/393d6447bea0502e1f939d197f4facc228e6e007/lambda-http/Cargo.toml#L36). ## Checklist <!--- If a checkbox below is not applicable, then please DELETE it rather than leaving it unchecked --> - [x] I have updated `CHANGELOG.next.toml` if I made changes to the smithy-rs codegen or runtime crates ---- _By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice._
…2685) This patch also removes the unneeded dependency on `lambda_runtime` by `aws-smithy-http-server-python`. This patch also refactors `LambdaHandler`'s `convert_event` to avoid cloning the URI path when not needed. This is a breaking change. See #2676 why. This patch also bumps `aws-smithy-http-server` dependency on `mime` to 0.3.4. `cargo +nightly-2022-11-16 minimal-versions check --all-features` otherwise fails when using 0.3.0, because we require `impl fmt::Display for mime::FromStrError`, which was first introduced in 0.3.4. As to why `minimal-versions` is now picking `mime` 0.3.0 with this patch, it's because in `lambda_http` 0.7.3, they had [`mime = "0.3.16"`](https://github.com/awslabs/aws-lambda-rust-runtime/blob/99dba6447253ac87cf3cefeb2ba130b50514f9df/lambda-http/Cargo.toml#L35-L35), and in `lambda_http` 0.8.0, they've now relaxed that to [`mime = "0.3"`](https://github.com/awslabs/aws-lambda-rust-runtime/blob/393d6447bea0502e1f939d197f4facc228e6e007/lambda-http/Cargo.toml#L36). ## Checklist <!--- If a checkbox below is not applicable, then please DELETE it rather than leaving it unchecked --> - [x] I have updated `CHANGELOG.next.toml` if I made changes to the smithy-rs codegen or runtime crates ---- _By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice._
…2685) This patch also removes the unneeded dependency on `lambda_runtime` by `aws-smithy-http-server-python`. This patch also refactors `LambdaHandler`'s `convert_event` to avoid cloning the URI path when not needed. This is a breaking change. See #2676 why. This patch also bumps `aws-smithy-http-server` dependency on `mime` to 0.3.4. `cargo +nightly-2022-11-16 minimal-versions check --all-features` otherwise fails when using 0.3.0, because we require `impl fmt::Display for mime::FromStrError`, which was first introduced in 0.3.4. As to why `minimal-versions` is now picking `mime` 0.3.0 with this patch, it's because in `lambda_http` 0.7.3, they had [`mime = "0.3.16"`](https://github.com/awslabs/aws-lambda-rust-runtime/blob/99dba6447253ac87cf3cefeb2ba130b50514f9df/lambda-http/Cargo.toml#L35-L35), and in `lambda_http` 0.8.0, they've now relaxed that to [`mime = "0.3"`](https://github.com/awslabs/aws-lambda-rust-runtime/blob/393d6447bea0502e1f939d197f4facc228e6e007/lambda-http/Cargo.toml#L36). ## Checklist <!--- If a checkbox below is not applicable, then please DELETE it rather than leaving it unchecked --> - [x] I have updated `CHANGELOG.next.toml` if I made changes to the smithy-rs codegen or runtime crates ---- _By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice._
…2685) This patch also removes the unneeded dependency on `lambda_runtime` by `aws-smithy-http-server-python`. This patch also refactors `LambdaHandler`'s `convert_event` to avoid cloning the URI path when not needed. This is a breaking change. See #2676 why. This patch also bumps `aws-smithy-http-server` dependency on `mime` to 0.3.4. `cargo +nightly-2022-11-16 minimal-versions check --all-features` otherwise fails when using 0.3.0, because we require `impl fmt::Display for mime::FromStrError`, which was first introduced in 0.3.4. As to why `minimal-versions` is now picking `mime` 0.3.0 with this patch, it's because in `lambda_http` 0.7.3, they had [`mime = "0.3.16"`](https://github.com/awslabs/aws-lambda-rust-runtime/blob/99dba6447253ac87cf3cefeb2ba130b50514f9df/lambda-http/Cargo.toml#L35-L35), and in `lambda_http` 0.8.0, they've now relaxed that to [`mime = "0.3"`](https://github.com/awslabs/aws-lambda-rust-runtime/blob/393d6447bea0502e1f939d197f4facc228e6e007/lambda-http/Cargo.toml#L36). ## Checklist <!--- If a checkbox below is not applicable, then please DELETE it rather than leaving it unchecked --> - [x] I have updated `CHANGELOG.next.toml` if I made changes to the smithy-rs codegen or runtime crates ---- _By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice._
…2685) This patch also removes the unneeded dependency on `lambda_runtime` by `aws-smithy-http-server-python`. This patch also refactors `LambdaHandler`'s `convert_event` to avoid cloning the URI path when not needed. This is a breaking change. See #2676 why. This patch also bumps `aws-smithy-http-server` dependency on `mime` to 0.3.4. `cargo +nightly-2022-11-16 minimal-versions check --all-features` otherwise fails when using 0.3.0, because we require `impl fmt::Display for mime::FromStrError`, which was first introduced in 0.3.4. As to why `minimal-versions` is now picking `mime` 0.3.0 with this patch, it's because in `lambda_http` 0.7.3, they had [`mime = "0.3.16"`](https://github.com/awslabs/aws-lambda-rust-runtime/blob/99dba6447253ac87cf3cefeb2ba130b50514f9df/lambda-http/Cargo.toml#L35-L35), and in `lambda_http` 0.8.0, they've now relaxed that to [`mime = "0.3"`](https://github.com/awslabs/aws-lambda-rust-runtime/blob/393d6447bea0502e1f939d197f4facc228e6e007/lambda-http/Cargo.toml#L36). ## Checklist <!--- If a checkbox below is not applicable, then please DELETE it rather than leaving it unchecked --> - [x] I have updated `CHANGELOG.next.toml` if I made changes to the smithy-rs codegen or runtime crates ---- _By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice._
I'm going to go ahead and close this since the documentation has gone out in smithy-rs 0.56.0. smithy-rs 0.56.0 now works with |
I've created an API Gateway connected to a Rust Lambda following the Pokemon service guide. I've wrapped my Smithy service using the crates
lambda_http = 0.8.0
andlambda_runtime = 0.8
like so:However, when I downgrade those lambda crates to
0.7.0
and0.7
respectively, I receive a200
response from both my routes.The text was updated successfully, but these errors were encountered: