Giter Site home page Giter Site logo

Instrumenting failed AWS SDK requests throws due to AWS's use of UriCreationOptions.DangerousDisablePathAndQueryCanonicalization about sentry-dotnet HOT 3 CLOSED

tloten avatar tloten commented on June 26, 2024
Instrumenting failed AWS SDK requests throws due to AWS's use of UriCreationOptions.DangerousDisablePathAndQueryCanonicalization

from sentry-dotnet.

Comments (3)

jamescrosswell avatar jamescrosswell commented on June 26, 2024

Hi @tloten, thanks for the report. I wasn't able to reproduce the error you mentioned using your gist however. I'm just getting a System.Net.Http.HttpRequestException: nodename nor servname provided, or not known (foo.localhost:5236).

Are there some prerequisites perhaps? I have to have some AWS CLI tools or something installed on my machine first, for example?

from sentry-dotnet.

tloten avatar tloten commented on June 26, 2024

Hi @jamescrosswell
Sorry about that - on my machine *.localhost resolves the same as localhost, I had no idea it was doing that!

Anyway, can work around that by adding ForcePathStyle = true to the AmazonS3Config. Ala

...
    // Point S3 at ourselves so we can simulate a 500 error happening in S3
    var s3Config = new AmazonS3Config()
    {
        ServiceURL = app.Urls.First(),
        ForcePathStyle = true,
        UseHttp = true,
    };
...

(I've updated the gist too if that's easier)

That just makes the S3Client use path based URLs (e.g. http://baseurl/bucket/key rather than http://bucket.baseurl/key) - again just a workaround to get the S3 client pointed at our dummy endpoint so we can simulate 500's.

Really unsure of the solution here - its quite odd that AWS SDK is using this DangerousDisablePathAndQueryCanonicalization option. And there doesn't seem to be a way to inspect a URI to find out if it's safe to call GetComponents either 🤔

from sentry-dotnet.

jamescrosswell avatar jamescrosswell commented on June 26, 2024

Anyway, can work around that by adding ForcePathStyle = true to the AmazonS3Config. Ala

Cool, I can reproduce now! That's always the first step 😜

from sentry-dotnet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.