when access s3 service by ipv6 address, "Invalid endpoint" error message is reported
See original GitHub issueDescribe the bug when i access s3 service by ipv6 address, “Invalid endpoint” error message is reported, but i can access it by curl。 by boto3 sdk: Traceback (most recent call last): File “ipv6.py”, line 14, in <module> config=Config(signature_version=‘s3v4’) File “/usr/local/lib/python3.6/site-packages/boto3/session.py”, line 263, in client aws_session_token=aws_session_token, config=config) File “/usr/local/lib/python3.6/site-packages/botocore/session.py”, line 851, in create_client client_config=config, api_version=api_version) File “/usr/local/lib/python3.6/site-packages/botocore/client.py”, line 88, in create_client verify, credentials, scoped_config, client_config, endpoint_bridge) File “/usr/local/lib/python3.6/site-packages/botocore/client.py”, line 357, in _get_client_args verify, credentials, scoped_config, client_config, endpoint_bridge) File “/usr/local/lib/python3.6/site-packages/botocore/args.py”, line 108, in get_client_args proxies_config=new_config.proxies_config) File “/usr/local/lib/python3.6/site-packages/botocore/endpoint.py”, line 287, in create_endpoint raise ValueError(“Invalid endpoint: %s” % endpoint_url) ValueError: Invalid endpoint: http://[100:0:2::61]:7480
by curl [root@bogon test]# curl -6g http://[100:0:2::61]:7480
<?xml version="1.0" encoding="UTF-8"?><ListAllMyBucketsResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><Owner><ID>anonymous</ID><DisplayName></DisplayName></Owner><Buckets></Buckets></ListAllMyBucketsResult>python code from boto3.session import Session from botocore.client import Config
host_ipv6 = ‘http://[100:0:2::61]’ port = 7480 session = Session( aws_access_key_id=‘admin’, aws_secret_access_key=‘admin’ ) s3_client = session.client( ‘s3’, endpoint_url=host_ipv6+‘:’+str(port), config=Config(signature_version=‘s3v4’) ) s3_client.create_bucket(Bucket=‘aaaa-1’)
~/.aws/config [root@bogon test]# cat ~/.aws/config [default] s3 = use_dualstack_endpoint = true
Steps to reproduce If you have a runnable example, please include it as a snippet or link to a repository/gist for larger code examples.
Expected behavior A clear and concise description of what you expected to happen.
Debug logs
Full stack trace by adding boto3.set_stream_logger('')
to your code.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top GitHub Comments
Hi @liangpeng0536, we’ve added boto/botocore#2574 to help address this. It should be available in the next botocore release. If you’d like to test the change before then it’s available on the
develop
branch.Going to resolve since this should be addressed. Please let us know if you’re still seeing issues.
@nateprewitt ,thanks for resolve this issue, i try the develop branch and verify this issue is resolved, thanks again.