Closed sbailliez closed 7 years ago
taking a look
I think I see the bug. What content type are you setting? Seems we may be blowing it away with the latest refactoring.
Was just looking at the request log in details, apparently content-type is not set
16:23:03.210 DEBUG [2017-02-24 21:23:00,408] org.apache.http.wire: http-outgoing-7 >> "POST /2013-01-01/documents/batch?format=sdk HTTP/1.1[\r][\n]"
16:23:03.210 DEBUG [2017-02-24 21:23:00,408] org.apache.http.wire: http-outgoing-7 >> "Host: xxxxxxxxxxx-k4twi2hvwnwandapy4dho4435q.us-east-1.cloudsearch.amazonaws.com[\r][\n]"
16:23:03.210 DEBUG [2017-02-24 21:23:00,408] org.apache.http.wire: http-outgoing-7 >> "Authorization: AWS4-HMAC-SHA256 Credential=XXXXXXX/20170224/us-east-1/cloudsearch/aws4_request, SignedHeaders=amz-sdk-invocation-id;amz-sdk-retry;content-length;content-type;host;user-agent;x-amz-date, Signature=63423d51d91964992083a329c41c6695cbe1abd293aa0a562942b715c55b4f47[\r][\n]"
16:23:03.210 DEBUG [2017-02-24 21:23:00,408] org.apache.http.wire: http-outgoing-7 >> "X-Amz-Date: 20170224T212300Z[\r][\n]"
16:23:03.210 DEBUG [2017-02-24 21:23:00,408] org.apache.http.wire: http-outgoing-7 >> "User-Agent: aws-sdk-java/1.11.95 Linux/4.4.44-39.55.amzn1.x86_64 Java_HotSpot(TM)_64-Bit_Server_VM/25.111-b14/1.8.0_111 scala/2.11.8[\r][\n]"
16:23:03.210 DEBUG [2017-02-24 21:23:00,408] org.apache.http.wire: http-outgoing-7 >> "amz-sdk-invocation-id: c8fb41ca-d010-2989-4133-31fed4a74f35[\r][\n]"
16:23:03.210 DEBUG [2017-02-24 21:23:00,408] org.apache.http.wire: http-outgoing-7 >> "amz-sdk-retry: 2/35/460[\r][\n]"
16:23:03.210 DEBUG [2017-02-24 21:23:00,408] org.apache.http.wire: http-outgoing-7 >> "Content-Type: [\r][\n]"
16:23:03.210 DEBUG [2017-02-24 21:23:00,408] org.apache.http.wire: http-outgoing-7 >> "Content-Length: 149792[\r][\n]"
16:23:03.210 DEBUG [2017-02-24 21:23:00,408] org.apache.http.wire: http-outgoing-7 >> "Connection: Keep-Alive[\r][\n]"
16:23:03.210 DEBUG [2017-02-24 21:23:00,408] org.apache.http.wire: http-outgoing-7 >> "[\r][\n]"
My code is setting it explicitly to application/json
request.setContentType(ContentType.Applicationjson);
Yeah for REST-JSON services we send empty content to handle some weird behavior in our service stacks. We should be respecting an explicit content type set via a custom header or a modeled field in this case but the recent refactoring broke that. I'll work on a fix and get it out today.
Thanks @shorea !
Fix is in code review.
@sbailliez thanks for reporting this! A fix will be released shortly as part of version 1.11.97.
Just for future reference. This bug affects version 1.11.94, 1.11.95, and 1.11.96. The fix was released in 1.11.97.
Cannot provide a full testcase yet as I had to quickly revert the code but something makes the cloudsearch server crash with 1.11.95 and the server replies with a 500 hard and a text/plain message, given it works with 1.11.93, it could be related to some json refactoring present in 1.11.94 ?
Cannot paste the content of the json being sent but the answer I get is.