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

Unable to use Minio on AWS server (hostname check assumes S3) #1390

Closed
stcleezy opened this issue Jan 13, 2024 · 1 comment · Fixed by #1391
Closed

Unable to use Minio on AWS server (hostname check assumes S3) #1390

stcleezy opened this issue Jan 13, 2024 · 1 comment · Fixed by #1391

Comments

@stcleezy
Copy link

We have Minio running on a public AWS EC2 server. The server is named ec2-X-XXXX-XX.compute-1.amazonaws.com

When we try to connect via the SDK, we get an exception because Minio assumes we're connecting to S3 directly.

Jan 12 15:22:34 ccu3 ccu3-minio-manager[998]:   File "/usr/lib/python3.10/site-packages/act_service_common/base_service.py", line 211, in event_loop
Jan 12 15:22:34 ccu3 ccu3-minio-manager[998]:     self.handle_event(redis_conn, event)
Jan 12 15:22:34 ccu3 ccu3-minio-manager[998]:   File "/usr/lib/python3.10/site-packages/ccu3_minio_manager/minio_manager_ccu3.py", line 152, in handle_event
Jan 12 15:22:34 ccu3 ccu3-minio-manager[998]:     self._reset_connection(event.get('payload', {}))
Jan 12 15:22:34 ccu3 ccu3-minio-manager[998]:   File "/usr/lib/python3.10/site-packages/ccu3_minio_manager/minio_manager_ccu3.py", line 120, in _reset_connection
Jan 12 15:22:34 ccu3 ccu3-minio-manager[998]:     self.reset(
Jan 12 15:22:34 ccu3 ccu3-minio-manager[998]:   File "/usr/lib/python3.10/site-packages/shared_minio_manager/minio_manager.py", line 120, in reset
Jan 12 15:22:34 ccu3 ccu3-minio-manager[998]:     self.minio_client = Minio(
Jan 12 15:22:34 ccu3 ccu3-minio-manager[998]:   File "/usr/lib/python3.10/site-packages/minio/api.py", line 135, in __init__
Jan 12 15:22:34 ccu3 ccu3-minio-manager[998]:     self._base_url = BaseURL(
Jan 12 15:22:34 ccu3 ccu3-minio-manager[998]:   File "/usr/lib/python3.10/site-packages/minio/helpers.py", line 473, in __init__
Jan 12 15:22:34 ccu3 ccu3-minio-manager[998]:     self._aws_info, region_in_host = _get_aws_info(
Jan 12 15:22:34 ccu3 ccu3-minio-manager[998]:   File "/usr/lib/python3.10/site-packages/minio/helpers.py", line 391, in _get_aws_info
Jan 12 15:22:34 ccu3 ccu3-minio-manager[998]:     raise ValueError(f"invalid Amazon AWS host {host}")
Jan 12 15:22:34 ccu3 ccu3-minio-manager[998]: ValueError: invalid Amazon AWS host ec2-3-89-87-104.compute-1.amazonaws.com
Jan 12 15:22:34 ccu3 ccu3-minio-manager[998]: Exception ignored in: <function Minio.__del__ at 0xffffb1f8d120>
Jan 12 15:22:34 ccu3 ccu3-minio-manager[998]: Traceback (most recent call last):
Jan 12 15:22:34 ccu3 ccu3-minio-manager[998]:   File "/usr/lib/python3.10/site-packages/minio/api.py", line 160, in __del__
Jan 12 15:22:34 ccu3 ccu3-minio-manager[998]:     self._http.clear()
Jan 12 15:22:34 ccu3 ccu3-minio-manager[998]: AttributeError: 'Minio' object has no attribute '_http'

Here is where this is happening:
https://github.com/minio/minio-py/blob/master/minio/helpers.py#L447

Can we pass a flag to ignore the S3 check? Is there a better way to get around this?

Thank you!

balamurugana added a commit to balamurugana/minio-py that referenced this issue Jan 13, 2024
Fixes minio#1390

Signed-off-by: Bala.FA <bala@minio.io>
@balamurugana
Copy link
Member

You could use public IP address as endpoint or use the fix #1391

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants