B2 存储和带有 multipart() 选项的 jclouds 出错
Error with B2 storage and jclouds with multipart() option
如果我使用带有 multipart() 选项的 jclouds 将文件上传到 b2,我会收到如下错误
Exception in thread "main" java.lang.IllegalArgumentException: large files must have at least 2 parts
at org.jclouds.b2.handlers.ParseB2ErrorFromJsonContent.refineException(ParseB2ErrorFromJsonContent.java:45)
at org.jclouds.b2.handlers.ParseB2ErrorFromJsonContent.handleError(ParseB2ErrorFromJsonContent.java:58)
at org.jclouds.http.handlers.DelegatingErrorHandler.handleError(DelegatingErrorHandler.java:65)
at org.jclouds.http.internal.BaseHttpCommandExecutorService.shouldContinue(BaseHttpCommandExecutorService.java:138)
at org.jclouds.http.internal.BaseHttpCommandExecutorService.invoke(BaseHttpCommandExecutorService.java:107)
at org.jclouds.rest.internal.InvokeHttpMethod.invoke(InvokeHttpMethod.java:91)
at org.jclouds.rest.internal.InvokeHttpMethod.apply(InvokeHttpMethod.java:74)
at org.jclouds.rest.internal.InvokeHttpMethod.apply(InvokeHttpMethod.java:45)
at org.jclouds.reflect.FunctionalReflection$FunctionalInvocationHandler.handleInvocation(FunctionalReflection.java:117)
at com.google.common.reflect.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:87)
at com.sun.proxy.$Proxy57.finishLargeFile(Unknown Source)
at org.jclouds.b2.blobstore.B2BlobStore.completeMultipartUpload(B2BlobStore.java:356)
at org.jclouds.blobstore.internal.BaseBlobStore.putMultipartBlob(BaseBlobStore.java:376)
at org.jclouds.blobstore.internal.BaseBlobStore.putMultipartBlob(BaseBlobStore.java:347)
at org.jclouds.b2.blobstore.B2BlobStore.putBlob(B2BlobStore.java:233)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.google.inject.internal.DelegatingInvocationHandler.invoke(DelegatingInvocationHandler.java:37)
at com.sun.proxy.$Proxy41.putBlob(Unknown Source)
at b2.NewMain.runMain(NewMain.java:76)
at b2.NewMain.main(NewMain.java:48)
Caused by: org.jclouds.b2.B2ResponseException: request POST https://api.backblazeb2.com/b2api/v1/b2_finish_large_file HTTP/1.1 failed with code 400, error: B2Error{code=bad_request, message=large files must have at least 2 parts, status=400}
... 22 more
我使用的代码如下
PayloadBlobBuilder blobBuilder = blobStore.blobBuilder(remoteFileName)
.payload(payload)
.contentLength(payload.size());
Blob blob = blobBuilder.build();
String eTag = blobStore.putBlob(containerName, blob, multipart());
同一文件的相同代码适用于 aws-s3、google-cloud-storage、azureblob。我正在使用 jclouds 2.1.1。这是一个已知问题吗?
我打开 JCLOUDS-1477 来跟踪这个错误,jclouds 2.1.2-SNAPSHOT 和 2.2.0-SNAPSHOT 应该包含一个修复程序。请测试并报告该问题的进一步症状。
如果我使用带有 multipart() 选项的 jclouds 将文件上传到 b2,我会收到如下错误
Exception in thread "main" java.lang.IllegalArgumentException: large files must have at least 2 parts
at org.jclouds.b2.handlers.ParseB2ErrorFromJsonContent.refineException(ParseB2ErrorFromJsonContent.java:45)
at org.jclouds.b2.handlers.ParseB2ErrorFromJsonContent.handleError(ParseB2ErrorFromJsonContent.java:58)
at org.jclouds.http.handlers.DelegatingErrorHandler.handleError(DelegatingErrorHandler.java:65)
at org.jclouds.http.internal.BaseHttpCommandExecutorService.shouldContinue(BaseHttpCommandExecutorService.java:138)
at org.jclouds.http.internal.BaseHttpCommandExecutorService.invoke(BaseHttpCommandExecutorService.java:107)
at org.jclouds.rest.internal.InvokeHttpMethod.invoke(InvokeHttpMethod.java:91)
at org.jclouds.rest.internal.InvokeHttpMethod.apply(InvokeHttpMethod.java:74)
at org.jclouds.rest.internal.InvokeHttpMethod.apply(InvokeHttpMethod.java:45)
at org.jclouds.reflect.FunctionalReflection$FunctionalInvocationHandler.handleInvocation(FunctionalReflection.java:117)
at com.google.common.reflect.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:87)
at com.sun.proxy.$Proxy57.finishLargeFile(Unknown Source)
at org.jclouds.b2.blobstore.B2BlobStore.completeMultipartUpload(B2BlobStore.java:356)
at org.jclouds.blobstore.internal.BaseBlobStore.putMultipartBlob(BaseBlobStore.java:376)
at org.jclouds.blobstore.internal.BaseBlobStore.putMultipartBlob(BaseBlobStore.java:347)
at org.jclouds.b2.blobstore.B2BlobStore.putBlob(B2BlobStore.java:233)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.google.inject.internal.DelegatingInvocationHandler.invoke(DelegatingInvocationHandler.java:37)
at com.sun.proxy.$Proxy41.putBlob(Unknown Source)
at b2.NewMain.runMain(NewMain.java:76)
at b2.NewMain.main(NewMain.java:48)
Caused by: org.jclouds.b2.B2ResponseException: request POST https://api.backblazeb2.com/b2api/v1/b2_finish_large_file HTTP/1.1 failed with code 400, error: B2Error{code=bad_request, message=large files must have at least 2 parts, status=400}
... 22 more
我使用的代码如下
PayloadBlobBuilder blobBuilder = blobStore.blobBuilder(remoteFileName)
.payload(payload)
.contentLength(payload.size());
Blob blob = blobBuilder.build();
String eTag = blobStore.putBlob(containerName, blob, multipart());
同一文件的相同代码适用于 aws-s3、google-cloud-storage、azureblob。我正在使用 jclouds 2.1.1。这是一个已知问题吗?
我打开 JCLOUDS-1477 来跟踪这个错误,jclouds 2.1.2-SNAPSHOT 和 2.2.0-SNAPSHOT 应该包含一个修复程序。请测试并报告该问题的进一步症状。