IBM / ibm-cos-sdk-python

ibm-cos-sdk-python
Apache License 2.0
45 stars 26 forks source link

ConnectTimeoutError with "https://s3.private.eu-de.cloud-object-storage.appdomain.cloud/" on my local device #35

Closed tbrodbeck closed 4 years ago

tbrodbeck commented 4 years ago

Hi! I am able to access my COS with this command in Watson Studio.

import ibm_boto3
from ibm_botocore.client import Config
[...]
auth_endpoint = 'https://iam.bluemix.net/oidc/token'
service_endpoint = "https://s3.private.eu-de.cloud-object-storage.appdomain.cloud"

cos = ibm_boto3.resource('s3',
                         ibm_api_key_id=api_key,
                         ibm_service_instance_id=service_instance_id,
                         ibm_auth_endpoint=auth_endpoint,
                         config=Config(signature_version='oauth'),
                         endpoint_url=service_endpoint)

However when I try to connect to it from my local device I get ConnectTimeoutError: Connect timeout on endpoint URL: "https://s3.private.eu-de.cloud-object-storage.appdomain.cloud/" Can you tell me why this happens (locally only)? What could I look into?

nglange commented 4 years ago

@tbrodbeck Thanks for your patience here - if you haven't figured it out, the reason you can't connect from your local machine is that the private endpoint is restricted to access from within the IBM Cloud. So that value for service_endpoint will work from Watson Studio, or an application running in a container, VM, or other IBM Cloud computing resource. Your sample above will work fine if you replace the service_endpoint value with "https://s3.eu-de.cloud-object-storage.appdomain.cloud".

You can learn a bit more about the various types of endpoints in the documentation here.

tbrodbeck commented 4 years ago

Thank you so much!