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

Swift API throws Exception when getting blob from containers

    XMLWordPrintableJSON

    Details

      Description

      Hello, I am getting a weird behavior from swift api client. The scenario is: I have a blobStore object, invoking blobStore.createContainerInLocation(location, container) works well but checking container exists before creating container, then use that blobStore to get a blob throws an exception:

       

      blobStore.createContainerInLocation(location, container); 
      blobStore.getBlob(container, blobId); // works well
      
      blobStore.containerExists(container);
      blobStore.createContainerInLocation(location, container); 
      blobStore.getBlob(container, blobId); // throws here
      

      This is a part of stack trace:

      java.lang.IllegalStateException: Optional.get() cannot be called on an absent value
      
       at com.google.common.base.Absent.get(Absent.java:43)
       at org.jclouds.openstack.swift.v1.blobstore.RegionScopedSwiftBlobStore.toBlobMetadata(RegionScopedSwiftBlobStore.java:607)
       at org.jclouds.openstack.swift.v1.blobstore.RegionScopedSwiftBlobStore.getBlob(RegionScopedSwiftBlobStore.java:384)
       at org.jclouds.openstack.swift.v1.blobstore.RegionScopedSwiftBlobStore.getBlob(RegionScopedSwiftBlobStore.java:374)
      

      Is it a bug or an expected behavior? Or if it is expected, could you explain the reason why exception thrown, Thanks!

      full example is here 

      I'm using an docker to run openstack swift which is using:

      • keystone 12.0.0
      • Swift 2.15.1

      and jcloud api version 2.1.1

      <dependency>
          <groupId>org.apache.jclouds.api</groupId>
          <artifactId>openstack-swift</artifactId>
          <version>2.1.1</version>
      </dependency>
      

       

        Attachments

          Activity

            People

            • Assignee:
              gaul Andrew Gaul
              Reporter:
              trantienduchn Trần Tiến Đức
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: