Project

General

Profile

Actions

Bug #23183

open

'Bad Request' after success when uploading InputStream via swift API

Added by Dave French about 6 years ago. Updated almost 6 years ago.

Status:
New
Priority:
Normal
Assignee:
Target version:
-
% Done:

0%

Source:
Community (user)
Tags:
Backport:
Regression:
No
Severity:
2 - major
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

Hi,

I think I have found an issue in Ceph when connecting via the Swift API and uploading an object with an InputStream. The strange thing is that I receive an Http 201 - 'Created' immediately after the PUT, however if I let my program run without any interaction to Ceph, after 40 seconds the gateway sends back a 400 - 'Bad Request'.

Attached is a wireshark capture of this. But, here is a summary:

PUT /swift/v1/dave-test-container/path%2Fto%2FSimpleDoc.txt HTTP/1.1
X-Auth-Token: AUTH_rgwtk0c0000006e696d6275733a7377696674f4bf9e840534e18ffa2f985a0329531c9f008e9f4127927d3fb5f336679cb5465e92bc44
CONNECTION: Keep-Alive
Transfer-Encoding: chunked
Host: <ip address>:7480
User-Agent: Apache-HttpClient/4.5.3 (Java/1.8.0_92)
Expect: 100-continue
Accept-Encoding: gzip,deflate

HTTP/1.1 100 CONTINUE

a
HelloWorld
0

HTTP/1.1 201 Created
etag: 68e109f0f40ca72a15e05cc22786f8e6
Last-Modified: Wed, 28 Feb 2018 16:53:25 GMT
X-Trans-Id: tx00000000000000000067b-005a96de85-371f-default
X-Openstack-Request-Id: tx00000000000000000067b-005a96de85-371f-default
Content-Type: text/plain; charset=utf-8
Content-Length: 0
Date: Wed, 28 Feb 2018 16:53:25 GMT
Connection: Keep-Alive

<40 seconds later>

HTTP/1.1 400 Bad Request
Cache-Control: no-cache, no-store, must-revalidate, private, max-age=0
Pragma: no-cache
Expires: 0
Date: Wed, 28 Feb 2018 16:54:05 GMT
Connection: close

Error 400: Bad Request
Client sent malformed request

In Java, I am using the org.javaswift.joss client v0.10.1 to interact with Ceph and below is the code that I am using.

Container container = account.getContainer(containerId);
StoredObject object = container.getObject(objectId);
object.uploadObject(inputStream);

If I convert the inputStream to a byte array and use the "uploadObject(byte[] var1);" method, after 40 seconds I do not get the bad request.

When interacting with Ceph with other methods of the Joss client, except the uploadObject(InputStream), if I wait 40 seconds after the making a request, I can see the socket connection close with a "fin,Ack/Ack" handshake. Then, any future interaction to the server with the same instance of the Joss client's 'Account' object will initiate a new socket connection and the request will succeed. But, when invoking uploadObject(Inputstream) after 40 seconds, instead of this clean disconnect, the BadRequest message is sent from the server without any other request from the client occurring first. I think the PUT request is correct, especially since the server said it was good and the file is available on the server after this request. I do not think this is a bug with the Joss client since the wireshark communication looks correct.

Has anyone else noticed this? Am I using the client incorrectly? I would like to interact with Ceph via Swift with a chunked uploads so I am not sure how to work around this issue.

Any help would be greatly appreciated,

Dave


Files

Actions #1

Updated by Orit Wasserman almost 6 years ago

  • Assignee set to Matt Benjamin
Actions

Also available in: Atom PDF