opentelekomcloud / python-otcextensions

Extension of the OpenStackSDK && OpenStackClient with OpenTelekomCloud services
https://docs.otc-service.com/python-otcextensions
Apache License 2.0
24 stars 24 forks source link

Openstack CLI ist creating wrong URL if you want to get details of a bucket #312

Open hadoopch opened 1 year ago

hadoopch commented 1 year ago

Hi all,

today i wanted to get details about a certain Bucket on our OTC in switzerland But the openstack cli is not working correctly because a wrong endpoint is used.

1) First I listed the containers

openstack --os-cloud otc  obs container list
Namespace in the response does not match expectation
+-----------------+--------------------------+
| name            | creation_date            |
+-----------------+--------------------------+
| hallo | 2022-07-22T12:40:39.560Z           |
+-----------------+--------------------------+

2) Then i tried to query details about the container haufe migration

openstack --os-cloud otc  obs container show haufe-migration
Unable to establish connection to https://hallo.obs.eu-ch2.otc.t-systems.com/: HTTPSConnectionPool(host='hallo.obs.eu-ch2.otc.t-systems.com', port=443): Max retries exceeded with url: / (Caused by ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 500 Unable to connect')))

You can see that the bucket

But this is not correct. This is the wrong URL

3) If i query the OBS endpoint

openstack --os-cloud otc endpoint show 7561a0f23f92493e938701573b4b0a30
+--------------+-----------------------------------------+
| Field        | Value                                   |
+--------------+-----------------------------------------+
| enabled      | True                                    |
| id           | 7561a0f23f92493e938701573b4b0a30        |
| interface    | public                                  |
| region       | eu-ch2                                  |
| region_id    | eu-ch2                                  |
| service_id   | 77a8bd99509146aab478bc2fbd14cb63        |
| service_name | objectstorage                           |
| service_type | object                                  |
| url          | https://obs.eu-ch2.sc.otc.t-systems.com |
+--------------+-----------------------------------------+

So the correct URL must be

And not the URL generated by the CLI. Here sc is missing

Could you please check and correct?

Best regards. Thanks in advance.

Uli

gtema commented 1 year ago

Please do not use otcextensions for OBS management, especially on eu-ch2. Best alternatives are s3cmd and s4cmd.

hadoopch commented 1 year ago

Hello Artem,

thanks a lot for your answer. It would be great if you could fix it. I found for example the following code line which generates the wrong URL:

./sdk/obs/v1/_proxy.py: 'https://%(container)s.obs.%(region_name)s.sc.otc.t-systems.com'

Maybe there are further files to adjust.

Thanks in advance Uli

gtema commented 1 year ago

Problem is that it was never really in scope to try to compete with sXcmd commands. S3 is not fitting into the OpenStack concept natively and additionally this service works only with AK/SK, while others work preferably with user/password. This is surely possible to have some fixes to otce to fix your issue, but it will never get all of the features of tools designed explicitly for OBS/S3