You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@jclouds.apache.org by "Andrew Gaul (JIRA)" <ji...@apache.org> on 2014/07/19 02:14:39 UTC
[jira] [Commented] (JCLOUDS-334) createContainerInLocation returns
true even if container exists
[ https://issues.apache.org/jira/browse/JCLOUDS-334?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14067251#comment-14067251 ]
Andrew Gaul commented on JCLOUDS-334:
-------------------------------------
This yields a confusing error when creating a container owned by another user, as discovered when @rcoedo followed the createContainerInLocation example with "mycontainer" at http://jclouds.apache.org/start/blobstore/:
{noformat}
org.jclouds.rest.AuthorizationException: Access Denied
at org.jclouds.aws.handlers.ParseAWSErrorFromXmlContent.refineException(ParseAWSErrorFromXmlContent.java:124)
at org.jclouds.s3.handlers.ParseS3ErrorFromXmlContent.refineException(ParseS3ErrorFromXmlContent.java:98)
at org.jclouds.aws.handlers.ParseAWSErrorFromXmlContent.handleError(ParseAWSErrorFromXmlContent.java:91)
at org.jclouds.http.handlers.DelegatingErrorHandler.handleError(DelegatingErrorHandler.java:67)
at org.jclouds.http.internal.BaseHttpCommandExecutorService.shouldContinue(BaseHttpCommandExecutorService.java:180)
at org.jclouds.http.internal.BaseHttpCommandExecutorService.invoke(BaseHttpCommandExecutorService.java:150)
at org.jclouds.rest.internal.InvokeSyncToAsyncHttpMethod.invoke(InvokeSyncToAsyncHttpMethod.java:129)
at org.jclouds.rest.internal.InvokeSyncToAsyncHttpMethod.apply(InvokeSyncToAsyncHttpMethod.java:95)
at org.jclouds.rest.internal.InvokeSyncToAsyncHttpMethod.apply(InvokeSyncToAsyncHttpMethod.java:56)
at org.jclouds.rest.internal.DelegatesToInvocationFunction.handle(DelegatesToInvocationFunction.java:156)
at org.jclouds.rest.internal.DelegatesToInvocationFunction.invoke(DelegatesToInvocationFunction.java:123)
at com.sun.proxy.$Proxy49.bucketExists(Unknown Source)
at org.jclouds.s3.blobstore.S3BlobStore.containerExists(S3BlobStore.java:121)
at org.jclouds.aws.s3.blobstore.AWSS3BlobStore.createContainerInLocation(AWSS3BlobStore.java:122)
at org.jclouds.s3.blobstore.S3BlobStore.createContainerInLocation(S3BlobStore.java:134)
at org.apache.jclouds.rest.RestServiceTest.testClouds(RestServiceTest.java:25)
{noformat}
> createContainerInLocation returns true even if container exists
> ---------------------------------------------------------------
>
> Key: JCLOUDS-334
> URL: https://issues.apache.org/jira/browse/JCLOUDS-334
> Project: jclouds
> Issue Type: Bug
> Components: jclouds-blobstore
> Affects Versions: 1.6.2
> Reporter: Diwaker Gupta
> Assignee: Andrew Gaul
> Fix For: 1.7.0, 1.6.3
>
>
> Javadocs for `createContainerInLocation` state (from http://javadocs.jclouds.cloudbees.net/org/jclouds/blobstore/BlobStore.html):
> "Returns: true if the container was created, false if it already existed."
> The following simple test snippet verifies this:
> ```
> assertThat(blobStore.createContainerInLocation(
> /*location=*/ null, name)).isTrue();
> assertTrue(blobStore.containerExists(name));
> assertThat(blobStore.createContainerInLocation(
> /*location=*/ null, name)).isFalse();
> ```
> I ran the test above for a variety of blobstores, and the test fails for pretty much everyblobstore including aws-s3, cloudfiles, hpcloud, azureblob, atmos etc. In my tests, it does pass when using generic S3 endpoints like with Google cloud storage.
--
This message was sent by Atlassian JIRA
(v6.2#6252)