Open fyannk opened 2 years ago
Hi @fyannk thanks for reaching out. Could you tell us more about your use case and how this would help? Is it just a slight performance increase or something beyond that? It seems like there is some debate about whether the trailing dot on domain names should be supported (for example in this curl issue: https://github.com/curl/curl/issues/8290).
Edit: I'm going to convert this to a feature request for FQDN support.
Greetings! It looks like this issue hasn’t been active in longer than five days. We encourage you to check if this is still an issue in the latest release. In the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment or upvote with a reaction on the initial post to prevent automatic closure. If the issue is already closed, please feel free to open a new one.
Since endpoint usage affects other SDKs, I'm going to transfer this feature request to our cross-SDK repository. This related issue was opened recently in one of our other repositories: https://github.com/boto/boto3/issues/3492. It describes a different use case but I think addresses the same underlying ask as here.
I can't guarantee if or when this feature request would be implemented, but while it's pending further review we recommend that others interested in this add a 👍 to the original post here and to leave a comment if you have any additional feedback to share. Thanks!
I do not consider this as a feature request, i consider it as a bug. We are providing valid endpoint URLs but boto3 does something wrong when calculating the signature. This issue produces a lot of unneeded DNS Traffic for many of our applications using sqs and s3.
agreed with @senbax
imho this is a bug, as there is a problem between boto3 (that is encoding headers) and sublayers that make the actual call.
boto3 isn't removing trailing dot, sublayers are.
So boto3 must remove the trailing dot before encoding, or modify librairies to call remote with trailing dot (but that will provide many issues, mainly on vhosts, and not really RFC / all browsers / wget / curl / ... compliant)
One workaround (at least for SQS) is to use an VPC Interface Endpoint which allows access to SQS via another DNS Name (for example vpce-FFFFFF.sqs.eu-central-1.vpce.amazonaws.com) which has 4 dots and thus isnt resolved locally with ndots:5.
But it would be better if users could provide endpoint_urls with absolute DNS or create a feature (toggle) which automaticly adds a dot at the end of the domain on every request.
Describe the bug
There is a problem when using absolute FQDN DNS, as specified in RFC 3986 aws/aws-cli#3.2.2:
Seen with aws-cli to contact S3-compatible storage.
This was seen when trying to use endpoint "http://minio.test.local.:9000" instead of "http://minio.test.local:9000"
Expected Behavior
Can contact endpoints with absolute FQDN.
Example of a list-bucket for S3 with endpoint "http://minio.test.local.:9000" :
Current Behavior
Server is rejecting the call (example of a list-bucket for S3 with endpoint "http://minio.test.local.:9000") :
Reproduction Steps
Use any absolute FQDN for endpoint
Example:
Not working:
Working:
Possible Solution
For my use case (dunno if there are others), I believe the problem comes from function _host_from_url in botocore/auth.py
The signature is made with absolute FQDN, bit the underlying http respect RFCs and remove the ending dot, hence signature mismatched sent informations.
If we rewrite like that:
My test call succeeds.
Additional Information/Context
Imho this is important especially in Kubernetes like environments.
To access resources outside of a cluster through DNS, a best practice is to use absolute FQDN to avoid many unnecessary DNS requests. Even if it's a really fast protocol, the best call is the one you don't make from a performance point of view.
Example of a basic resolv.conf file of a Pod inside a test cluster for example:
This means that, to access for example "curl https://testbucket.s3.us-west-1.amazonaws.com/", underlying operating system will try to resolve (in order):
Obviously only the last ones of the 14 calls will succeed.
As said, DNS is fast and (mainly) in UDP, but still, on my test platform where i'm alone, I spent 62ms just for that, and on heavily loaded and mutualized k8s clusters, we see some contention on DNS subsystems.
Using absolute FQDN would mean that we'll do only 2 DNS queries:
CLI version used
2.8.0
Environment details (OS name and version, etc.)
Fedora Core 35