Uploaded image for project: 'jclouds'
  1. jclouds
  2. JCLOUDS-1352

apachehc driver doesn't work with B2.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.1.0
    • None
    • jclouds-drivers

    Description

      I'm trying put some blobs to B2 storage. Using such code to init context.

       ContextBuilder builder = ContextBuilder.newBuilder(new B2ProviderMetadata())
                      .modules(ImmutableSet.of(new EnterpriseConfigurationModule(),
                              new SLF4JLoggingModule(), new ApacheHCHttpCommandExecutorServiceModule()))
                      .credentials(getIdentity(), getCredential());
      

      and get such exception:

      java.lang.IllegalArgumentException: required field bucketId is missing
      	at org.jclouds.b2.handlers.ParseB2ErrorFromJsonContent.refineException(ParseB2ErrorFromJsonContent.java:43)
      	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:84)
      	at com.sun.proxy.$Proxy189.listFileNames(Unknown Source)
      	at org.jclouds.b2.blobstore.B2BlobStore.getFileId(B2BlobStore.java:433)
      	at org.jclouds.b2.blobstore.B2BlobStore.putBlob(B2BlobStore.java:238)
      	at org.jclouds.b2.blobstore.B2BlobStore.putBlob(B2BlobStore.java:223)
      	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:50)
      	at com.sun.proxy.$Proxy150.putBlob(Unknown Source)

      but due to logs, all headers is submitted correct.

      2017-11-03 11:02:37.296 DEBUG - Sending request 1794756120: GET https://api001.backblazeb2.com/b2api/v1/b2_list_file_names HTTP/1.1
      2017-11-03 11:02:37.296 DEBUG - >> "{"bucketId":"62848b31459e70cc5af30e1a","startFileName":"60fe99d446c8963ac39b6050e0f96003","maxFileCount":1}"
      2017-11-03 11:02:37.296 DEBUG - >> GET https://api001.backblazeb2.com/b2api/v1/b2_list_file_names HTTP/1.1
      2017-11-03 11:02:37.296 DEBUG - >> Accept: application/json
      2017-11-03 11:02:37.296 DEBUG - >> Authorization: 3_20171103075741_2c6d3dbb57c89507828b6199_d3c17d94995558dbd2a8dfd8dae677f3e3f05451_001_acct
      2017-11-03 11:02:37.296 DEBUG - >> Content-Type: application/json
      2017-11-03 11:02:37.296 DEBUG - >> Content-Length: 107
      2017-11-03 11:02:37.506 DEBUG - Receiving response 1794756120: HTTP/1.1 400 Bad Request
      2017-11-03 11:02:37.506 DEBUG - << HTTP/1.1 400 Bad Request
      2017-11-03 11:02:37.506 DEBUG - << Server: Apache-Coyote/1.1
      2017-11-03 11:02:37.506 DEBUG - << Date: Fri, 03 Nov 2017 08:02:36 GMT
      2017-11-03 11:02:37.506 DEBUG - << Connection: close
      2017-11-03 11:02:37.506 DEBUG - << Cache-Control: max-age=0, no-cache, no-store
      2017-11-03 11:02:37.506 DEBUG - << Content-Type: application/json;charset=UTF-8
      2017-11-03 11:02:37.506 DEBUG - << Content-Length: 92
      2017-11-03 11:02:37.507 DEBUG - << "{[\n]"
      2017-11-03 11:02:37.507 DEBUG - << "  "code": "bad_json",[\n]"
      2017-11-03 11:02:37.507 DEBUG - << "  "message": "required field bucketId is missing",[\n]"
      2017-11-03 11:02:37.507 DEBUG - << "  "status": 400[\n]"
      2017-11-03 11:02:37.507 DEBUG - << "}"
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            valenpo Valentin Popov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: