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

B2 does not work, fails with IllegalStateException #689

Open
lgyurci opened this issue Sep 17, 2024 · 0 comments
Open

B2 does not work, fails with IllegalStateException #689

lgyurci opened this issue Sep 17, 2024 · 0 comments

Comments

@lgyurci
Copy link

lgyurci commented Sep 17, 2024

Using official docker image with envs:

S3PROXY_AUTHORIZATION=none
CLOUDS_PROVIDER=b2
LOG_LEVEL=trace
JCLOUDS_ENDPOINT=https://s3.eu-central-003.backblazeb2.com
JCLOUDS_CREDENTIAL=****
JCLOUDS_IDENTITY=******

logs:

[s3proxy] D 09-17 09:18:50.236 S3Proxy-Jetty-41 o.gaul.s3proxy.S3ProxyHandler:301 |::] request: Request(GET http://127.0.0.1:8080/bucket/?location)@5240e1f0
[s3proxy] T 09-17 09:18:50.238 S3Proxy-Jetty-41 o.gaul.s3proxy.S3ProxyHandler:326 |::] header: Authorization: AWS4-HMAC-SHA256 Credential=somecredential/20240917/us-east-1/s3/aws4_request,SignedHeaders=host;x-amz-content-sha256;x-amz-date,Si
[s3proxy] T 09-17 09:18:50.238 S3Proxy-Jetty-41 o.gaul.s3proxy.S3ProxyHandler:326 |::] header: x-amz-content-sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
[s3proxy] T 09-17 09:18:50.238 S3Proxy-Jetty-41 o.gaul.s3proxy.S3ProxyHandler:326 |::] header: x-amz-date: 20240917T091850Z
[s3proxy] T 09-17 09:18:50.238 S3Proxy-Jetty-41 o.gaul.s3proxy.S3ProxyHandler:326 |::] header: Host: 127.0.0.1:8080
[s3proxy] T 09-17 09:18:50.238 S3Proxy-Jetty-41 o.gaul.s3proxy.S3ProxyHandler:326 |::] header: Accept-Encoding: identity
[s3proxy] T 09-17 09:18:50.238 S3Proxy-Jetty-41 o.gaul.s3proxy.S3ProxyHandler:326 |::] header: Content-Length: 0
[s3proxy] D 09-17 09:18:50.265 S3Proxy-Jetty-24 o.gaul.s3proxy.S3ProxyHandler:301 |::] request: Request(PUT http://127.0.0.1:8080/bucket/teszt.txt)@5240e1f0
[s3proxy] T 09-17 09:18:50.265 S3Proxy-Jetty-24 o.gaul.s3proxy.S3ProxyHandler:326 |::] header: Authorization: AWS4-HMAC-SHA256 Credential=somecredential/20240917/us-east-1/s3/aws4_request,SignedHeaders=content-length;content-type;host;x-amz-
[s3proxy] T 09-17 09:18:50.265 S3Proxy-Jetty-24 o.gaul.s3proxy.S3ProxyHandler:326 |::] header: x-amz-content-sha256: 8da40246110fa296a8e2fb17b3a27d5ebe29877b03e62bb89d5afab9f87ccb6c
[s3proxy] T 09-17 09:18:50.266 S3Proxy-Jetty-24 o.gaul.s3proxy.S3ProxyHandler:326 |::] header: content-length: 10
[s3proxy] T 09-17 09:18:50.266 S3Proxy-Jetty-24 o.gaul.s3proxy.S3ProxyHandler:326 |::] header: x-amz-meta-s3cmd-attrs: atime:1726564715/ctime:1726564314/gid:1000/gname:gyurci/md5:1396f7bab4f53269315f56ffe8968203/mode:33188/mtime:1726564
[s3proxy] T 09-17 09:18:50.266 S3Proxy-Jetty-24 o.gaul.s3proxy.S3ProxyHandler:326 |::] header: x-amz-date: 20240917T091850Z
[s3proxy] T 09-17 09:18:50.266 S3Proxy-Jetty-24 o.gaul.s3proxy.S3ProxyHandler:326 |::] header: Host: 127.0.0.1:8080
[s3proxy] T 09-17 09:18:50.266 S3Proxy-Jetty-24 o.gaul.s3proxy.S3ProxyHandler:326 |::] header: content-type: text/plain
[s3proxy] T 09-17 09:18:50.266 S3Proxy-Jetty-24 o.gaul.s3proxy.S3ProxyHandler:326 |::] header: Accept-Encoding: identity
[s3proxy] T 09-17 09:18:50.266 S3Proxy-Jetty-24 o.gaul.s3proxy.S3ProxyHandler:326 |::] header: x-amz-storage-class: STANDARD
[s3proxy] T 09-17 09:18:50.281 S3Proxy-Jetty-24 o.j.r.i.InvokeHttpMethod:47 |::] >> converting b2_list_buckets
[s3proxy] T 09-17 09:18:50.287 S3Proxy-Jetty-24 o.j.r.i.RestAnnotationProcessor:47 |::] no annotations on class or invocation.getInvoked(): org.jclouds.b2.features.BucketApi.public abstract org.jclouds.b2.domain.BucketList org.jclouds.b
[s3proxy] T 09-17 09:18:50.287 S3Proxy-Jetty-24 o.j.r.i.RestAnnotationProcessor:47 |::] no annotations on class or invocation.getInvoked(): org.jclouds.b2.B2Api.public abstract org.jclouds.b2.features.BucketApi org.jclouds.b2.B2Api.getB
[s3proxy] T 09-17 09:18:50.287 S3Proxy-Jetty-24 o.j.r.i.RestAnnotationProcessor:47 |::] no annotations on class or invocation.getInvoked(): org.jclouds.b2.features.BucketApi.public abstract org.jclouds.b2.domain.BucketList org.jclouds.b
[s3proxy] T 09-17 09:18:50.287 S3Proxy-Jetty-24 o.j.r.i.RestAnnotationProcessor:47 |::] looking up default endpoint for org.jclouds.b2.features.BucketApi.public abstract org.jclouds.b2.domain.BucketList org.jclouds.b2.features.BucketApi
[s3proxy] T 09-17 09:18:50.288 S3Proxy-Jetty-24 o.j.r.i.RestAnnotationProcessor:47 |::] using default endpoint Optional.of(https://s3.eu-central-003.backblazeb2.com) for org.jclouds.b2.features.BucketApi.public abstract org.jclouds.b2.d
[s3proxy] T 09-17 09:18:50.290 S3Proxy-Jetty-24 o.j.r.i.RestAnnotationProcessor:47 |::] adding filter org.jclouds.b2.filters.RequestAuthorization@7384f907 from annotation on org.jclouds.b2.features.BucketApi
[s3proxy] T 09-17 09:18:50.309 S3Proxy-Jetty-24 o.j.r.i.InvokeHttpMethod:47 |::] << converted b2_list_buckets to POST https://s3.eu-central-003.backblazeb2.com/b2api/v2/b2_list_buckets HTTP/1.1
[s3proxy] T 09-17 09:18:50.312 S3Proxy-Jetty-24 o.j.r.i.InvokeHttpMethod:47 |::] << response from b2_list_buckets is parsed by ParseJson
[s3proxy] T 09-17 09:18:50.313 S3Proxy-Jetty-24 o.j.r.i.InvokeHttpMethod:47 |::] << exceptions from b2_list_buckets are parsed by MapHttp4xxCodesToExceptions
[s3proxy] D 09-17 09:18:50.313 S3Proxy-Jetty-24 o.j.r.i.InvokeHttpMethod:56 |::] >> invoking b2_list_buckets
[s3proxy] T 09-17 09:18:50.315 S3Proxy-Jetty-24 o.j.r.i.InvokeHttpMethod:47 |::] >> converting b2_authorize_account
[s3proxy] T 09-17 09:18:50.316 S3Proxy-Jetty-24 o.j.r.i.RestAnnotationProcessor:47 |::] no annotations on class or invocation.getInvoked(): org.jclouds.b2.features.AuthorizationApi.public abstract org.jclouds.b2.domain.Authorization org
[s3proxy] T 09-17 09:18:50.316 S3Proxy-Jetty-24 o.j.r.i.RestAnnotationProcessor:47 |::] no annotations on class or invocation.getInvoked(): org.jclouds.b2.B2Api.public abstract org.jclouds.b2.features.AuthorizationApi org.jclouds.b2.B2A
[s3proxy] T 09-17 09:18:50.316 S3Proxy-Jetty-24 o.j.r.i.RestAnnotationProcessor:47 |::] no annotations on class or invocation.getInvoked(): org.jclouds.b2.features.AuthorizationApi.public abstract org.jclouds.b2.domain.Authorization org
[s3proxy] T 09-17 09:18:50.317 S3Proxy-Jetty-24 o.j.r.i.RestAnnotationProcessor:47 |::] looking up default endpoint for org.jclouds.b2.features.AuthorizationApi.public abstract org.jclouds.b2.domain.Authorization org.jclouds.b2.features
[s3proxy] T 09-17 09:18:50.317 S3Proxy-Jetty-24 o.j.r.i.RestAnnotationProcessor:47 |::] using default endpoint Optional.of(https://s3.eu-central-003.backblazeb2.com) for org.jclouds.b2.features.AuthorizationApi.public abstract org.jclou
[s3proxy] T 09-17 09:18:50.319 S3Proxy-Jetty-24 o.j.r.i.RestAnnotationProcessor:47 |::] adding filter org.jclouds.http.filters.BasicAuthentication@3b388b49 from annotation on authorizeAccount
[s3proxy] T 09-17 09:18:50.322 S3Proxy-Jetty-24 o.j.r.i.InvokeHttpMethod:47 |::] << converted b2_authorize_account to GET https://s3.eu-central-003.backblazeb2.com/b2api/v2/b2_authorize_account HTTP/1.1
[s3proxy] T 09-17 09:18:50.322 S3Proxy-Jetty-24 o.j.r.i.InvokeHttpMethod:47 |::] << response from b2_authorize_account is parsed by ParseJson
[s3proxy] T 09-17 09:18:50.322 S3Proxy-Jetty-24 o.j.r.i.InvokeHttpMethod:47 |::] << exceptions from b2_authorize_account are parsed by MapHttp4xxCodesToExceptions
[s3proxy] D 09-17 09:18:50.323 S3Proxy-Jetty-24 o.j.r.i.InvokeHttpMethod:56 |::] >> invoking b2_authorize_account
[s3proxy] D 09-17 09:18:50.327 S3Proxy-Jetty-24 o.j.h.i.JavaUrlHttpCommandExecutorService:56 |::] Sending request 1641215817: GET https://s3.eu-central-003.backblazeb2.com/b2api/v2/b2_authorize_account HTTP/1.1
[s3proxy] D 09-17 09:18:50.327 S3Proxy-Jetty-24 jclouds.headers:56 |::] >> GET https://s3.eu-central-003.backblazeb2.com/b2api/v2/b2_authorize_account HTTP/1.1
[s3proxy] D 09-17 09:18:50.327 S3Proxy-Jetty-24 jclouds.headers:56 |::] >> Accept: application/json
[s3proxy] D 09-17 09:18:50.327 S3Proxy-Jetty-24 jclouds.headers:56 |::] >> Authorization: Basic aGFoeW91dG91Z2h0SWRsZWF2ZXRoaXNoZXJlOmxtYW8=
    at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:5010)
    at org.jclouds.rest.suppliers.MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.get(MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.java:150)
    at org.jclouds.b2.filters.RequestAuthorization.filter(RequestAuthorization.java:44)
    at org.jclouds.http.internal.BaseHttpCommandExecutorService.invoke(BaseHttpCommandExecutorService.java:90)
    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.proxy2/jdk.proxy2.$Proxy66.listBuckets(Unknown Source)
    at org.jclouds.b2.blobstore.B2BlobStore$1.load(B2BlobStore.java:110)
    at org.jclouds.b2.blobstore.B2BlobStore$1.load(B2BlobStore.java:107)
    at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3570)
    at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2312)
    at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2189)
    at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2079)
    ... 33 common frames omitted
[s3proxy] W 09-17 09:18:50.725 S3Proxy-Jetty-24 o.g.s.o.e.j.server.HttpChannel:797 |::] /bucket/teszt.txt
com.google.common.util.concurrent.UncheckedExecutionException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $
    at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2085)
    at com.google.common.cache.LocalCache.get(LocalCache.java:4011)
    at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:4034)
    at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:5010)
    at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:5017)
    at org.jclouds.b2.blobstore.B2BlobStore.getBucket(B2BlobStore.java:423)
    at org.jclouds.b2.blobstore.B2BlobStore.getFileId(B2BlobStore.java:434)
    at org.jclouds.b2.blobstore.B2BlobStore.putBlob(B2BlobStore.java:240)
    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:569)
    at com.google.inject.internal.DelegatingInvocationHandler.invoke(DelegatingInvocationHandler.java:50)
    at jdk.proxy2/jdk.proxy2.$Proxy64.putBlob(Unknown Source)
    at org.gaul.s3proxy.S3ProxyHandler.handlePutBlob(S3ProxyHandler.java:2027)
    at org.gaul.s3proxy.S3ProxyHandler.doHandle(S3ProxyHandler.java:762)
    at org.gaul.s3proxy.S3ProxyHandlerJetty.handle(S3ProxyHandlerJetty.java:80)
    at org.gaul.shaded.org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:122)
    at org.gaul.shaded.org.eclipse.jetty.server.Server.handle(Server.java:563)
    at org.gaul.shaded.org.eclipse.jetty.server.HttpChannel$RequestDispatchable.dispatch(HttpChannel.java:1598)
    at org.gaul.shaded.org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:753)
    at org.gaul.shaded.org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:501)
    at org.gaul.shaded.org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:287)
    at org.gaul.shaded.org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:314)
    at org.gaul.shaded.org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:100)
    at org.gaul.shaded.org.eclipse.jetty.io.SelectableChannelEndPoint$1.run(SelectableChannelEndPoint.java:53)
    at org.gaul.shaded.org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.runTask(AdaptiveExecutionStrategy.java:421)
    at org.gaul.shaded.org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.consumeTask(AdaptiveExecutionStrategy.java:390)
    at org.gaul.shaded.org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.tryProduce(AdaptiveExecutionStrategy.java:277)
    at org.gaul.shaded.org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.produce(AdaptiveExecutionStrategy.java:193)
    at org.gaul.shaded.org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:969)
    at org.gaul.shaded.org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.doRunJob(QueuedThreadPool.java:1194)
    at org.gaul.shaded.org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1149)
    at java.base/java.lang.Thread.run(Thread.java:840)
Caused by: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $
    at com.google.gson.stream.JsonReader.beginObject(JsonReader.java:393)
    at org.jclouds.json.internal.DeserializationConstructorAndReflectiveTypeAdapterFactory$DeserializeIntoParameterizedConstructor.read(DeserializationConstructorAndReflectiveTypeAdapterFactory.java:181)
    at com.google.gson.Gson.fromJson(Gson.java:1227)
    at com.google.gson.Gson.fromJson(Gson.java:1137)
    at com.google.gson.Gson.fromJson(Gson.java:1107)
    at org.jclouds.json.internal.GsonWrapper.fromJson(GsonWrapper.java:56)
    at org.jclouds.http.functions.ParseJson.apply(ParseJson.java:83)
    at org.jclouds.http.functions.ParseJson.apply(ParseJson.java:77)
    at org.jclouds.http.functions.ParseJson.apply(ParseJson.java:62)
    at org.jclouds.b2.handlers.ParseB2ErrorFromJsonContent.handleError(ParseB2ErrorFromJsonContent.java:57)
    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 jdk.proxy2/jdk.proxy2.$Proxy76.authorizeAccount(Unknown Source)
    at org.jclouds.b2.config.B2HttpApiModule$1.get(B2HttpApiModule.java:73)
    at org.jclouds.b2.config.B2HttpApiModule$1.get(B2HttpApiModule.java:70)
    at org.jclouds.rest.suppliers.MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier$SetAndThrowAuthorizationExceptionSupplierBackedLoader.load(MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.java:75)
    at org.jclouds.rest.suppliers.MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier$SetAndThrowAuthorizationExceptionSupplierBackedLoader.load(MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.java:57)
    at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3570)
    at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2312)
    at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2189)
    at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2079)
    at com.google.common.cache.LocalCache.get(LocalCache.java:4011)
    at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:4034)
    at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:5010)
    at org.jclouds.rest.suppliers.MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.get(MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.java:150)
    at org.jclouds.b2.filters.RequestAuthorization.filter(RequestAuthorization.java:44)
    at org.jclouds.http.internal.BaseHttpCommandExecutorService.invoke(BaseHttpCommandExecutorService.java:90)
    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.proxy2/jdk.proxy2.$Proxy66.listBuckets(Unknown Source)
    at org.jclouds.b2.blobstore.B2BlobStore$1.load(B2BlobStore.java:110)
    at org.jclouds.b2.blobstore.B2BlobStore$1.load(B2BlobStore.java:107)
    at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3570)
    at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2312)
    at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2189)
    at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2079)
    ... 33 common frames omitted

Using sha-812a4d3 docker image, but also tried building the project from the main branch, the same issue is present.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant