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

aws-smithy-client 0.54.2 breaks athena client #736

Closed
erwanncloarec opened this issue Feb 9, 2023 · 6 comments
Closed

aws-smithy-client 0.54.2 breaks athena client #736

erwanncloarec opened this issue Feb 9, 2023 · 6 comments

Comments

@erwanncloarec
Copy link

Description of the bug

After running cargo update on one of my project, I had errors coming from aws-smithy-client at runtime.
It has been updated to 0.54.2, and by forcing it back to =0.54.1 everything went well.

How to reproduce

Cargo.toml

[dependencies]
tokio = { version = "*", features = ["full"]}
aws-smithy-client = { version = "=0.54.2" }
aws-sdk-athena = { version = "=0.24.0" }
aws-config = { version =  "0.54.1", default-features = false }

main.rs

use aws_config::retry::RetryConfig;

#[tokio::main]
async fn main() {
    let shared_config = aws_config::load_from_env().await;
    let config = aws_sdk_athena::config::Builder::from(&shared_config)
        .retry_config(RetryConfig::standard())
        .build();
    let client = aws_sdk_athena::Client::from_conf(config);
    let query_execution_id = match client
        .start_query_execution()
        .work_group("primary")
        .query_string("select count(*) from mytable")
        .send()
        .await
    {
        Ok(res) => String::from(res.query_execution_id().unwrap()),
        Err(e) => panic!("{e}"),
    };
    println!("Query running {query_execution_id}");
}

This codes panics with :

thread 'main' panicked at 'failed to construct request', src/main.rs:18:19

But with:

aws-smithy-client = { version = "=0.54.1" }

It works:

Query running ce628d28-b971-4823-87f8-1016ec1d5ed2

Note: I'm not sure if it's relevant but in my local environment, I use AWS_PROFILE environment variable.

@jdisanti
Copy link
Contributor

jdisanti commented Feb 9, 2023

I was able to reproduce, but only after setting default-features = true on aws-config. You can add more context to that panic by doing the following:

use aws_sdk_athena::types::DisplayErrorContext;

// --snip --

        Err(e) => panic!("{}", DisplayErrorContext(e)),

That reveals the full error to be:

thread 'main' panicked at 'failed to construct request: could not construct endpoint parameters: a required field was missing: `region` (ConstructionFailure(ConstructionFailure { source: ResolveEndpointError { message: "could not construct endpoint parameters", source: Some(InvalidParams { field: "region" }) } }))', src/main.rs:19:19

Setting the AWS_REGION env var after that led to a different error that indicates an output location is required on the Athena request.

@jdisanti jdisanti transferred this issue from smithy-lang/smithy-rs Feb 9, 2023
@erwanncloarec
Copy link
Author

With the DisplayErrorContext, I ended up with "invalid URL, scheme is not http: invalid URL, scheme is not http".
When trying with rustls feature of aws-config it works fine, but with the native-tls it breaks. I saw that rustls is in the default features, so that's why it's working when using default-features = true.

@Velfi
Copy link
Contributor

Velfi commented Feb 13, 2023

It turns out this issue was caused by a tiny mistake in recent PR. I have a fix in PR right now.

@Velfi Velfi added the pending-release This issue will be fixed by an approved PR that hasn't been released yet. label Feb 14, 2023
@Velfi
Copy link
Contributor

Velfi commented Feb 14, 2023

The PR is merged and the fix is pending release.

@LukeMathWalker
Copy link
Contributor

The fix has been released to crates.io - https://github.com/awslabs/smithy-rs/releases/tag/release-2023-02-14

@Velfi Velfi removed the pending-release This issue will be fixed by an approved PR that hasn't been released yet. label Feb 14, 2023
@Velfi Velfi closed this as completed Feb 14, 2023
@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

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.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

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

4 participants