Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GCP. File API fails to upload a file if an absolute path to the file is not encoded #250

Open
astsiapanay opened this issue Feb 29, 2024 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@astsiapanay
Copy link
Collaborator

The test com.epam.aidial.core.FileApiTest#testFileUpload fails with the error:

SEVERE: error after writing 389/409 bytes to https://www.googleapis.com/upload/storage/v1/b/gcp-dev-dial/o?uploadType=multipart
java.io.IOException: too many bytes written
	at java.base/sun.net.www.protocol.http.HttpURLConnection$StreamingOutputStream.write(HttpURLConnection.java:3812)
	at com.google.common.io.CountingOutputStream.write(CountingOutputStream.java:54)
	at org.jclouds.io.ByteStreams2.copy(ByteStreams2.java:73)
	at org.jclouds.http.internal.JavaUrlHttpCommandExecutorService.writePayloadToConnection(JavaUrlHttpCommandExecutorService.java:302)
	at org.jclouds.http.internal.JavaUrlHttpCommandExecutorService.convert(JavaUrlHttpCommandExecutorService.java:175)
	at org.jclouds.http.internal.JavaUrlHttpCommandExecutorService.convert(JavaUrlHttpCommandExecutorService.java:66)
	at org.jclouds.http.internal.BaseHttpCommandExecutorService.invoke(BaseHttpCommandExecutorService.java:97)
	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 jdk.proxy3/jdk.proxy3.$Proxy86.multipartUpload(Unknown Source)
	at org.jclouds.googlecloudstorage.blobstore.GoogleCloudStorageBlobStore.putBlob(GoogleCloudStorageBlobStore.java:235)
	at org.jclouds.googlecloudstorage.blobstore.GoogleCloudStorageBlobStore.putBlob(GoogleCloudStorageBlobStore.java:207)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at com.google.inject.internal.DelegatingInvocationHandler.invoke(DelegatingInvocationHandler.java:50)
	at jdk.proxy3/jdk.proxy3.$Proxy78.putBlob(Unknown Source)
	at com.epam.aidial.core.storage.BlobStorage.store(BlobStorage.java:140)
	at com.epam.aidial.core.storage.BlobWriteStream.lambda$end$0(BlobWriteStream.java:106)
	at io.vertx.core.impl.ContextBase.lambda$executeBlocking$0(ContextBase.java:167)
	at io.vertx.core.impl.ContextInternal.dispatch(ContextInternal.java:277)
	at io.vertx.core.impl.ContextBase.lambda$internalExecuteBlocking$2(ContextBase.java:199)
	at io.vertx.core.impl.TaskQueue.run(TaskQueue.java:76)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.base/java.lang.Thread.run(Thread.java:833)
@astsiapanay astsiapanay added the bug Something isn't working label Feb 29, 2024
@astsiapanay astsiapanay self-assigned this Mar 19, 2024
@astsiapanay
Copy link
Collaborator Author

There is a bug in JCloud library which Core uses to work with cloud providers. Specifically this bug relates to GCP component of JClouds.
The bug is reported https://issues.apache.org/jira/browse/JCLOUDS-1632
and the PR is created apache/jclouds#201

@sdryapko ^^

@astsiapanay
Copy link
Collaborator Author

The PR is already merged apache/jclouds#201
Waiting for the next release of JClouds

@adubovik
Copy link
Contributor

adubovik commented Oct 8, 2024

@astsiapanay Could you please bump to jclouds>=2.6.1. It appears to contain the fix we need.

implementation 'org.apache.jclouds:jclouds-allblobstore:2.5.0'
implementation 'org.apache.jclouds.api:filesystem:2.5.0'

@astsiapanay
Copy link
Collaborator Author

@adubovik the latest version is 2.6.0. See https://github.com/apache/jclouds/tags
There is no the required fix in the latest version. We've to apply a patch from 0.10.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: No status
Development

No branches or pull requests

2 participants