Start a Conversation

This post is more than 5 years old

Solved!

Go to Solution

2455

November 30th, 2016 23:00

Issue with python-swiftclient 3.2

Hello together,

i have some issue connecting ECS (Version 3.0) with the python swift tools.

I'm using python in Windows and the packages:

  • python-swiftclient 3.2
  • python-keystoneclient 3.7

The Authentication at the ECS will be fine:

swift -V 2 -A https://ecs.emea.svc.corpintra.net:9025/v2.0 -U test_namespace:test_user_swift -K xyz  --insecure stat test_bucket_swift              

Account: test_namespace           

Container: test_bucket_swift             

Objects: 0               

Bytes: 0            

Read ACL:           

Write ACL:             

Sync To:            

Sync Key: X-Emc-Is-Stale-Allowed: true       

Accept-Ranges: bytes              

Server: ViPR/1.0 X-Emc-Retention-Period: 0    

X-Emc-Request-Id: 351298b4:1589b8375da:53a2:0         

X-Timestamp: 1479988281316        

Content-Type: text/html          

X-Trans-Id: tx351298b41589b8375da53-a2000000000

I use -- insecure because an internal certificate and not an CA certified certificate.

Now i want to upload some data:

swift -V 2 -A https://ecs.emea.svc.corpintra.net:9025/v2.0 -U test_namespace:test_user_swift -K xyz  --insecure upload test_bucket_swift Werksplan.pdf

And i get this error:

Object PUT failed: https://ecs.emea.svc.corpintra.net:9025/v1/test_namespace/test_bucket_swift/Werksplan.pdf 400 Bad Request   b"Bad Content-Type header value:''"

I heard this is a bug at the ECS because the Jersey software.

See some links below:

[1] http://developer.openstack.org/api-ref/object-storage/

[2] https://bugs.launchpad.net/python-swiftclient/+bug/1433767

[3] https://jersey.java.net/

Could someone give me an info if this is an ECS bug and when it will be fixed?

Thanks a lot for support.

Warm regards Peter

December 16th, 2016 05:00

No problem, glad to help.  If you don't mind, can you mark this thread as "answered"?  I will keep an eye on the bug fix and let you know when it's released.

Merry Christmas to you too Peter!

Regards,

Ben

December 5th, 2016 13:00

Hello Peter!

Thank you for reaching out about this issue.  I'm working on duplicating it, but so far I haven't been able to get a "400 Bad Request".

Can you share with me the output of the following commands?

# openstack endpoint list --service swift

# openstack endpoint list --service keystone

I'd like to see what your endpoint URLs look like.

Thanks!

5 Posts

December 5th, 2016 23:00

Hello Travis,

thanks for your response.

We are using the ECS appliance and i didn’t find a way to list the endpoint you asked for.

I looked for a command using ecscli and I had a look at the API documentation.

I installed the python-openstackclient at my system (windowsclient) to, but no command works.

I have not a lot knowledge in programming and using the APIs because I’m a Systemadmin with some scripting knowledge.

Hoping you can provide me a command that I can use to get the needed results.

Warm regards

Peter

Von: travis.wichert

Gesendet: Montag, 5. Dezember 2016 22:54

An: Ott, Peter (060)

Betreff: Re: - Issue with python-swiftclient 3.2

DECN

Issue with python-swiftclient 3.2

reply from travis.wichert in ECS - Elastic Cloud Storage - View the full discussion

5 Posts

December 6th, 2016 00:00

Hello Travis,

after installation the python-openstackclient and set the parameter:

set OS_AUTH_URL=https://ecs.emea.svc.corpintra.net:9025/v2.0

set OS_PROJECT_NAME=

set OS_USERNAME=test_user_swift

set OS_PASSWORD=xyz

I got the result:

\Scripts>openstack endpoint list --insecure --long

Discovering versions from the identity service failed when creating the password plugin. Attempting to determine version from URL.

The service catalog is empty.

--service swift didn’t work: openstack endpoint list: error: unrecognized arguments: --service swift

Hoping this will help you.

Best

Peter

Von: Ott, Peter (060)

Gesendet: Dienstag, 6. Dezember 2016 08:23

An: 'jive-15770037-csd2-2-kla4@emc-ecn.hosted.jivesoftware.com'

Betreff: AW: - Issue with python-swiftclient 3.2

Hello Travis,

thanks for your response.

We are using the ECS appliance and i didn’t find a way to list the endpoint you asked for.

I looked for a command using ecscli and I had a look at the API documentation.

I installed the python-openstackclient at my system (windowsclient) to, but no command works.

I have not a lot knowledge in programming and using the APIs because I’m a Systemadmin with some scripting knowledge.

Hoping you can provide me a command that I can use to get the needed results.

Warm regards

Peter

Von: travis.wichert

Gesendet: Montag, 5. Dezember 2016 22:54

An: Ott, Peter (060) >

Betreff: Re: - Issue with python-swiftclient 3.2

DECN

Issue with python-swiftclient 3.2

reply from travis.wichert in ECS - Elastic Cloud Storage - View the full discussion

December 6th, 2016 11:00

Hi Peter,

Okay, so this is not a full OpenStack environment.  Is it safe to assume you're wanting to use the Swift API without full OpenStack integration?  This is important because it will determine how you'll need to have the ECS set up to authenticate clients.

-t-

5 Posts

December 6th, 2016 23:00

Hi Travis,

there are 2 scenarios, i started with the, hopeful easier of them.

In the first scenario I want to use the swift interface with the ECS Keystoneserver V2.0. This worked for Cloudberry and Cyberduck fine.

Then we wanted to use the same scenario for an docker repository from Quay.io using also swift and ECS Keystone V2, then we got the issue you I described.

Quay.io is using the python-swiftclient 3.1 so I installed a test environment at my system, because I have no access to the Quay.io environment and got the same issue as user got in the quay.io environment. That was the state I posted.

Scenario 2 could be a bigger openstack environment with it one keystone Server so we can use Keystone v3, but here I have no idea how I have to configure the ecs to use external keystone servers at this time because I hoped I could start with the ECS keystone and keep it simple.

If I have to look for other things outside the ecs please tell me because this is completely new for me.

Thanks a lot.

Warm regards

Peter

Von: travis.wichert

Gesendet: Dienstag, 6. Dezember 2016 20:24

An: Ott, Peter (060)

Betreff: Re: - Issue with python-swiftclient 3.2

DECN

Issue with python-swiftclient 3.2

reply from Travis in ECS - Elastic Cloud Storage - View the full discussion

December 14th, 2016 08:00

Hi Peter,

I'm able to reproduce the issue you're having in our lab.  It appears that ECS doesn't like the empty Content-Type header being passed in the request.  I captured the request/response which you can see below.  We do have a ticket open to correct this behavior in ECS, but I'm not sure yet on exact timeline for fix.  For now, can you workaround the issue by passing a content-type header in your swift commands?

I tested this and it does in fact work:

[root@localhost tmp]# swift -V 2 -A http://10.1.83.51:9024/v2.0 -U ben_namespace:ben -K Password12345 upload joss sample.txt -H 'Content-Type: text/plain'

Here is the request/response causing issues when we don't specify the content type.

PUT /v1/ben_namespace/joss/sample.txt HTTP/1.1

Host: 10.1.83.51:9024

Accept-Encoding: identity

x-object-meta-mtime: 1481728920.399236

Content-Length: 71

user-agent: python-swiftclient-3.2.0

content-type:

x-auth-token: ECS_066ad062bc3c487fba956d2efd8bc4e7

HTTP/1.1 400 Bad Request

Date: Wed, 14 Dec 2016 15:44:17 GMT

Content-Type: text/plain

Transfer-Encoding: chunked

Server: ViPR/1.0

Please let me know if this answers your question

Regards,

Ben

5 Posts

December 16th, 2016 00:00

Hello Ben,

thanks a lot for supporting. That’s great news. I will use the content type as workaround and waiting for the fix for further projects.

Is there a way, that I get an info when the bug is fixed?

I wish you merry Christmas and a happy new year.

Warm Regards

Peter

Von: benschumacher

Gesendet: Mittwoch, 14. Dezember 2016 17:28

An: Ott, Peter (060)

Betreff: Re: - Issue with python-swiftclient 3.2

DECN

Issue with python-swiftclient 3.2

reply from Ben Schumacher in ECS - Elastic Cloud Storage - View the full discussion

No Events found!

Top