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

Error running localstack example ("failed to look up address information") #131

Closed
neilyio opened this issue May 10, 2024 · 1 comment · Fixed by #132
Closed

Error running localstack example ("failed to look up address information") #131

neilyio opened this issue May 10, 2024 · 1 comment · Fixed by #132
Labels
documentation Improvements or additions to documentation

Comments

@neilyio
Copy link
Contributor

neilyio commented May 10, 2024

Describe the bug

Running the localstack example throws an error:

Error: Unhandled(
    Unhandled {
        source: DispatchFailure(
            DispatchFailure {
                source: ConnectorError {
                    kind: Io,
                    source: hyper::Error(
                        Connect,
                        ConnectError(
                            "dns error",
                            Custom {
                                kind: Uncategorized,
                                error: "failed to lookup address information: nodename nor servname provided, or not known"
                            }
                        )
                    ),
                    connection: Unknown
                }
            }
        ),
        meta: ErrorMetadata {
            code: None,
            message: None,
            extras: None
        }
    }
)

As well as a warning:

warning: use of deprecated associated function `aws_config::BehaviorVersion::v2023_11_09`: Superceded by v2024_03_28, which enabled stalled stream protection for uploads (request bodies) by default.
  --> examples/localstack.rs:22:56
   |
22 |     let config = aws_config::defaults(BehaviorVersion::v2023_11_09())
   |                                                        ^^^^^^^^^^^
   |
   = note: `#[warn(deprecated)]` on by default

To Reproduce

Run from repo root:

cargo run --example localstack --features="localstack"  

Version information:

❯❯❯ uname -a 
Darwin Neils-Air.lan 23.4.0 Darwin Kernel Version 23.4.0: Fri Mar 15 00:12:41 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T8103 arm64
❯❯❯ rustc --version
rustc 1.77.2 (25ef9e3d8 2024-04-09)
❯❯❯ cargo --version
cargo 1.77.2 (e52e36006 2024-03-26)
❯❯❯ docker --version
Docker version 24.0.6, build ed223bc

Expected behavior

Successful run of example.

@neilyio neilyio added the bug Something isn't working label May 10, 2024
@DDtKey DDtKey added documentation Improvements or additions to documentation and removed bug Something isn't working labels May 10, 2024
@DDtKey
Copy link
Contributor

DDtKey commented May 10, 2024

Hi @neilyio 👋

Thanks for filling the issue!
The issue is that the example uses virtual-hosted–style for bucket (e.g http://example-bucket.localhost:55209/)

Need to fix ofc

DDtKey pushed a commit that referenced this issue May 10, 2024
#132)

Closes #131, where I discovered the `localstack` example is broken when
running:
```
cargo run --example localstack --features="localstack" 
```

Some research brought me to
[awslabs/aws-sdk-rust#1138](awslabs/aws-sdk-rust#1138),
which uncovered that `create_bucket` is broken here because `localstack`
uses the soon-to-be-deprecated
["path-style"](https://aws.amazon.com/blogs/aws/amazon-s3-path-deprecation-plan-the-rest-of-the-story/)
address style rather than the newer "virutal-hosted" style.

I reworked the configuration in the example to set
`force_path_style(true)`, which fixes `create_bucket`. The example now
runs successfully.

I also updated the `BehaviorVersion`, because the currently referenced
one is now deprecated and was causing a warning.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
2 participants