[jira] [Commented] (JCLOUDS-1552) AWSError#parseAWSErrorFromContent attempts to parse the response even if there is none

2020-09-21 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/JCLOUDS-1552?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17199399#comment-17199399
 ] 

ASF subversion and git services commented on JCLOUDS-1552:
--

Commit 619466c66ff5752d5c8c12b2bd1397e8fd6be9d7 in jclouds's branch 
refs/heads/2.2.x from Tamas Cservenak
[ https://gitbox.apache.org/repos/asf?p=jclouds.git;h=619466c ]

JCLOUDS-1552: Do not attempt to parse empty payload (#82)



> AWSError#parseAWSErrorFromContent attempts to parse the response even if 
> there is none
> --
>
> Key: JCLOUDS-1552
> URL: https://issues.apache.org/jira/browse/JCLOUDS-1552
> Project: jclouds
>  Issue Type: Bug
>  Components: jclouds-blobstore
>Affects Versions: 2.2.1
>Reporter: Tamás Cservenák
>Priority: Major
>  Time Spent: 2h
>  Remaining Estimate: 0h
>
> 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:
> {noformat}
> {method=HEAD, 
> endpoint=http://127.0.0.1:9000/px01-bkt-0579/pointer/public/64/64099abcf2dd581576d8081778110a245eff311d,
>  headers={}} {noformat}
> response:
> {noformat}
> {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]} {noformat}
> So, payload is there (is not null), but content length is clearly 0. Still, 
> org.jclouds.aws.util.AWSUtils#parseAWSErrorFromContent does something like 
> this:
> {noformat}
> if (response.getPayload() == null) {
>   return null;
> } else if 
> ("text/plain".equals(response.getPayload().getContentMetadata().getContentType()))
>  {
>   return null;
> } else {
>   .. parse
> } {noformat}
> Why not check in first IF branch, is payload == null OR payload length is 
> zero?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (JCLOUDS-1552) AWSError#parseAWSErrorFromContent attempts to parse the response even if there is none

2020-09-21 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/JCLOUDS-1552?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17199398#comment-17199398
 ] 

ASF subversion and git services commented on JCLOUDS-1552:
--

Commit d65047c87b46717605742057b59847673339e8fe in jclouds's branch 
refs/heads/master from Tamas Cservenak
[ https://gitbox.apache.org/repos/asf?p=jclouds.git;h=d65047c ]

JCLOUDS-1552: Do not attempt to parse empty payload (#82)



> AWSError#parseAWSErrorFromContent attempts to parse the response even if 
> there is none
> --
>
> Key: JCLOUDS-1552
> URL: https://issues.apache.org/jira/browse/JCLOUDS-1552
> Project: jclouds
>  Issue Type: Bug
>  Components: jclouds-blobstore
>Affects Versions: 2.2.1
>Reporter: Tamás Cservenák
>Priority: Major
>  Time Spent: 1h 50m
>  Remaining Estimate: 0h
>
> 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:
> {noformat}
> {method=HEAD, 
> endpoint=http://127.0.0.1:9000/px01-bkt-0579/pointer/public/64/64099abcf2dd581576d8081778110a245eff311d,
>  headers={}} {noformat}
> response:
> {noformat}
> {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]} {noformat}
> So, payload is there (is not null), but content length is clearly 0. Still, 
> org.jclouds.aws.util.AWSUtils#parseAWSErrorFromContent does something like 
> this:
> {noformat}
> if (response.getPayload() == null) {
>   return null;
> } else if 
> ("text/plain".equals(response.getPayload().getContentMetadata().getContentType()))
>  {
>   return null;
> } else {
>   .. parse
> } {noformat}
> Why not check in first IF branch, is payload == null OR payload length is 
> zero?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (JCLOUDS-1552) AWSError#parseAWSErrorFromContent attempts to parse the response even if there is none

2020-09-11 Thread Jira


[ 
https://issues.apache.org/jira/browse/JCLOUDS-1552?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17194275#comment-17194275
 ] 

Tamás Cservenák commented on JCLOUDS-1552:
--

Related PR https://github.com/apache/jclouds/pull/82

> AWSError#parseAWSErrorFromContent attempts to parse the response even if 
> there is none
> --
>
> Key: JCLOUDS-1552
> URL: https://issues.apache.org/jira/browse/JCLOUDS-1552
> Project: jclouds
>  Issue Type: Bug
>  Components: jclouds-blobstore
>Affects Versions: 2.2.1
>Reporter: Tamás Cservenák
>Priority: Major
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> 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:
> {noformat}
> {method=HEAD, 
> endpoint=http://127.0.0.1:9000/px01-bkt-0579/pointer/public/64/64099abcf2dd581576d8081778110a245eff311d,
>  headers={}} {noformat}
> response:
> {noformat}
> {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]} {noformat}
> So, payload is there (is not null), but content length is clearly 0. Still, 
> org.jclouds.aws.util.AWSUtils#parseAWSErrorFromContent does something like 
> this:
> {noformat}
> if (response.getPayload() == null) {
>   return null;
> } else if 
> ("text/plain".equals(response.getPayload().getContentMetadata().getContentType()))
>  {
>   return null;
> } else {
>   .. parse
> } {noformat}
> Why not check in first IF branch, is payload == null OR payload length is 
> zero?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)