Details
-
Bug
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
2.1.1
-
None
-
CentOS Linux release 7.4.1708 (Core)
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Description
Step to reproduce:
Use org.jclouds.googlecloudstorage.domain.ResumableUpload API to upload a file into multiple chunks onto Google Compute Engine.
e.g.:
ResumableUpload resumableUpload = googleCloudStorageApi.getResumableUploadApi().chunkUpload(bucket, uploadId, MediaType.OCTET_STREAM.toString(), range, "bytes " + rangeFrom + "-" + rangeTo + "/" + diskFile.length(), new ByteSourcePayload(ByteSource.wrap(buf)));
Each request returns a 308/HTTP_PERMANENT_REDIRECT which is expected behavior.
Cf. https://cloud.google.com/storage/docs/json_api/v1/how-tos/resumable-upload:
If the request succeeds, the server responds with 308 Resume Incomplete, along with a Range header that identifies the total number of bytes that have been stored so far.
At the end, the last chunk answer is a 200 which confirm the upload went well.
Issue:
For every chunk upload 308 answer it receives, JClouds logs an error which seems inappropriate:
ERROR (SLF4JLogger.java:RedirectionRetryHandler:88) - Cannot retry after redirect, no host header: [method=org.jclouds.googlecloudstorage.features.ResumableUploadApi.public abstract org.jclouds.googlecloudstorage.domain.ResumableUpload org.jclouds.googlecloudstorage.features.ResumableUploadApi.chunkUpload(java.lang.String,java.lang.String,java.lang.String,java.lang.Long,java.lang.String,org.jclouds.io.Payload)[myuser, AEnB2UqFW60Vyk9CRr2yB3gHG2h3dszv1tkif51NLcrhsADPqZF3sW6gs7fIf9HwNx8SIARKqglbxaVAph6TxdEVo7aO3LNQJJS-Iw3-qr_uDd-f8qxh90o, application/octet-stream, 4194304, bytes 343932928-348127231/351108355, [content=true, contentMetadata=[cacheControl=null, contentDisposition=null, contentEncoding=null, contentLanguage=null, contentLength=4194304, contentMD5=null, contentType=application/octet-stream, expires=null], written=false, isSensitive=false]], request=PUT https://www.googleapis.com/upload/storage/v1/b/myuser/o?uploadType=resumable&upload_id=AEnB2UqFW60Vyk9CRr2yB3gHG2h3dszv1tkif51NLcrhsADPqZF3sW6gs7fIf9HwNx8SIARKqglbxaVAph6TxdEVo7aO3LNQJJS-Iw3-qr_uDd-f8qxh90o HTTP/1.1]
Workaround:
Can configure log levels to hide this error.
More info:
- Log of two last HTTP requests
2018-10-16 10:45:51,164 gce-publish-connector DEBUG (SLF4JLogger.java:InvokeHttpMethod:56) - >> invoking Object:Upload 2018-10-16 10:45:51,164 gce-publish-connector DEBUG (SLF4JLogger.java:JavaUrlHttpCommandExecutorService:56) - Sending request -1294939191: PUT https://www.googleapis.com/upload/storage/v1/b/myuser/o?uploadType=resumable&upload_id=AEnB2UqFW60Vyk9CRr2yB3gHG2h3dszv1tkif51NLcrhsADPqZF3sW6gs7fIf9HwNx8SIARKqglbxaVAph6TxdEVo7aO3LNQJJS-Iw3-qr_uDd-f8qxh90o HTTP/1.1 2018-10-16 10:45:52,234 gce-publish-connector DEBUG (SLF4JLogger.java:JavaUrlHttpCommandExecutorService:56) - Receiving response -1294939191: HTTP/1.1 308 Resume Incomplete 2018-10-16 10:45:52,240 gce-publish-connector ERROR (SLF4JLogger.java:RedirectionRetryHandler:88) - Cannot retry after redirect, no host header: [method=org.jclouds.googlecloudstorage.features.ResumableUploadApi.public abstract org.jclouds.googlecloudstorage.domain.ResumableUpload org.jclouds.googlecloudstorage.features.ResumableUploadApi.chunkUpload(java.lang.String,java.lang.String,java.lang.String,java.lang.Long,java.lang.String,org.jclouds.io.Payload)[myuser, AEnB2UqFW60Vyk9CRr2yB3gHG2h3dszv1tkif51NLcrhsADPqZF3sW6gs7fIf9HwNx8SIARKqglbxaVAph6TxdEVo7aO3LNQJJS-Iw3-qr_uDd-f8qxh90o, application/octet-stream, 4194304, bytes 343932928-348127231/351108355, [content=true, contentMetadata=[cacheControl=null, contentDisposition=null, contentEncoding=null, contentLanguage=null, contentLength=4194304, contentMD5=null, contentType=application/octet-stream, expires=null], written=false, isSensitive=false]], request=PUT https://www.googleapis.com/upload/storage/v1/b/myuser/o?uploadType=resumable&upload_id=AEnB2UqFW60Vyk9CRr2yB3gHG2h3dszv1tkif51NLcrhsADPqZF3sW6gs7fIf9HwNx8SIARKqglbxaVAph6TxdEVo7aO3LNQJJS-Iw3-qr_uDd-f8qxh90o HTTP/1.1] 2018-10-16 10:45:52,259 gce-publish-connector DEBUG (SLF4JLogger.java:InvokeHttpMethod:56) - >> invoking Object:Upload 2018-10-16 10:45:52,259 gce-publish-connector DEBUG (SLF4JLogger.java:JavaUrlHttpCommandExecutorService:56) - Sending request -822896246: PUT https://www.googleapis.com/upload/storage/v1/b/myuser/o?uploadType=resumable&upload_id=AEnB2UqFW60Vyk9CRr2yB3gHG2h3dszv1tkif51NLcrhsADPqZF3sW6gs7fIf9HwNx8SIARKqglbxaVAph6TxdEVo7aO3LNQJJS-Iw3-qr_uDd-f8qxh90o HTTP/1.1 2018-10-16 10:45:53,303 gce-publish-connector DEBUG (SLF4JLogger.java:JavaUrlHttpCommandExecutorService:56) - Receiving response -822896246: HTTP/1.1 200 OK