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

Force botocore to connect using ipv6 first when using dualstack #3349

Open
1 task
robd003 opened this issue Jan 23, 2025 · 0 comments
Open
1 task

Force botocore to connect using ipv6 first when using dualstack #3349

robd003 opened this issue Jan 23, 2025 · 0 comments
Assignees
Labels
bug This issue is a confirmed bug. ec2 investigating This issue is being investigated and/or work is in progress to resolve the issue. p2 This is a standard priority issue

Comments

@robd003
Copy link

robd003 commented Jan 23, 2025

Describe the bug

When using an EC2 instance with a private ipv4 network and a public ipv6 network botocore will timeout trying to connect to the ipv4 address if use_dualstack=True

If there was a way to prefer IPv6 when dualstack is enabled that would be great.

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected Behavior

Attempt to connect with IPv6 first with a fallback to IPv4 when use_dualstack=True

Current Behavior

Program hangs until botocore endpoint connection timeout happens because ipv4 isn't routable

Reproduction Steps

Create ec2 instance with private ipv4 and public ipv6
Attempt to connect to any dualstack AWS service

Possible Solution

Terrible workaround

Run this before calling botocore:

import socket

def patched_getaddrinfo(*args, **kwargs):
    return socket.getaddrinfo(*args, family=socket.AF_INET6, **kwargs)

socket.getaddrinfo = patched_getaddrinfo

Additional Information/Context

No response

SDK version used

1.36.4

Environment details (OS name and version, etc.)

Linux in EC2 (any distribution, all will have this same problem), Python 3.13

@robd003 robd003 added bug This issue is a confirmed bug. needs-triage This issue or PR still needs to be triaged. labels Jan 23, 2025
@RyanFitzSimmonsAK RyanFitzSimmonsAK self-assigned this Jan 31, 2025
@RyanFitzSimmonsAK RyanFitzSimmonsAK added investigating This issue is being investigated and/or work is in progress to resolve the issue. p2 This is a standard priority issue ec2 and removed needs-triage This issue or PR still needs to be triaged. labels Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a confirmed bug. ec2 investigating This issue is being investigated and/or work is in progress to resolve the issue. p2 This is a standard priority issue
Projects
None yet
Development

No branches or pull requests

2 participants