Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
2.2.1
-
None
Description
With S3 BlobStore request, asking HEAD of non existent object (below request dumped from debug) gets a response with 404 and no XML body, but AWSUtil still tries (and fails) to parse the error from response, filling up log with noise.
S3 Server is Minio:
request:
{method=HEAD, endpoint=http://127.0.0.1:9000/px01-bkt-0579/pointer/public/64/64099abcf2dd581576d8081778110a245eff311d, headers={}}
response:
{statusCode=404, message=Not Found, headers={Accept-Ranges=[bytes], Content-Security-Policy=[block-all-mixed-content], Server=[MinIO/RELEASE.2020-09-08T23-05-18Z], Vary=[Origin], X-Amz-Request-Id=[1633B89A38D5D1CC], X-Xss-Protection=[1; mode=block], Date=[Fri, 11 Sep 2020 11:54:25 GMT]}, payload=[content=true, contentMetadata=[cacheControl=null, contentDisposition=null, contentEncoding=null, contentLanguage=null, contentLength=0, contentMD5=null, contentType=application/unknown, expires=null], written=false, isSensitive=false]}
So, payload is there (is not null), but content length is clearly 0. Still, org.jclouds.aws.util.AWSUtils#parseAWSErrorFromContent does something like this:
if (response.getPayload() == null) { return null; } else if ("text/plain".equals(response.getPayload().getContentMetadata().getContentType())) { return null; } else { .. parse }
Why not check in first IF branch, is payload == null OR payload length is zero?
Attachments
Issue Links
- is duplicated by
-
JCLOUDS-1556 Trying to parse S3 HEAD error response causes IllegalArgumentException: not an xml document
- Closed