minio / minio-py

MinIO Client SDK for Python
https://docs.min.io/docs/python-client-quickstart-guide.html
Apache License 2.0
822 stars 318 forks source link

no connection to my self hosted minio server? #1419

Closed hugokoopmans closed 4 months ago

hugokoopmans commented 4 months ago

Hi there,

Trying to start with this client to talk to my minio server. My minio server is on a synology nas in a docker setup. Also i use the reverse proxy service on the synology . Running RELEASE 2023-03-24

mc is working fine mc ls alias gives back results so i know the minio server is working fine

your play server also works fine.

from minio import Minio
# Initialize MinIO client
client = Minio("s3.xxxxx.yyy",
               access_key=ACCESS_KEY,
               secret_key=SECRET_KEY)

setup works

but

client.list_buckets()

gives nothing not even a timeout.

please advise, thank you

balamurugana commented 4 months ago

Check your endpoint of the server like hostname, port, TLS configuration ets while creating Minio client. You could enable Minio.trace_on() to see what's going on the wire.

hugokoopmans commented 4 months ago

ok I have researched some more. I see no example of this trace_on() function in the python client. Only somethings in the go docs...

I do see that I probably need an SSL certificate setup. Did that but still no luck.

Could you provide a piece of code that shows me how to use this trace_on() function?

hugokoopmans commented 4 months ago

got it sorry really simple

import sys
#Minio.trace_on()
client.trace_on(sys.stdout)
hugokoopmans commented 4 months ago

output not yet that informative

---------START-HTTP---------
GET [/](https://file+.vscode-resource.vscode-cdn.net/) HTTP/1.1
Host: s3.vezel14.org
User-Agent: MinIO (Linux; x86_64) minio-py/7.2.7
X-Amz-Content-Sha256: UNSIGNED-PAYLOAD
X-Amz-Date: 20240503T185848Z
Authorization: AWS4-HMAC-SHA256 Credential=*REDACTED*/20240503/us-east-1/s3/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date, Signature=*REDACTED*
balamurugana commented 4 months ago

The trace is wrong. Either it is manually changed or not from minio-py. The very first call should be GetBucketLocation which is not in the trace. Check your host s3.vezel14.org runs in port 80 or 443 according to your TLS configuration.

hugokoopmans commented 4 months ago

Thanks 4 tour reply, the minio instance is behind a reverse proxy, would that be of concern?

balamurugana commented 4 months ago

Please refer MinIO server documentation for respective configuration.