question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

when access s3 service by ipv6 address, "Invalid endpoint" error message is reported

See original GitHub issue

Describe 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:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
nateprewittcommented, Dec 11, 2021

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.

0reactions
liangpeng0536commented, Dec 13, 2021

@nateprewitt ,thanks for resolve this issue, i try the develop branch and verify this issue is resolved, thanks again.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Making requests to Amazon S3 over IPv6 - AWS Documentation
Explains how to access Amazon S3 using the IPv6 protocols.
Read more >
ValueError: Invalid endpoint: s3-api.xxxx.objectstorage.service ...
I used the code generation functionality from my DSX notebook: Insert to code > Insert StreamingBody object . The generated code was: import...
Read more >
Bucket policy examples - Amazon Simple Storage Service
With Amazon S3 bucket policies, you can secure access to objects in your buckets, so that only users with the appropriate permissions can...
Read more >
How to Fix the “503 Service Unavailable” Error in vCenter
“503 Service Unavailable” Error on the vSphere Web Client: What Should You Do? VMware vCenter Server is a centralized vSphere management ...
Read more >
Networking | Elasticsearch Guide [8.5] | Elastic
This choice uses heuristics based on IPv4/IPv6 stack preference and reachability and may change when the node restarts. Ensure each node is accessible...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found