[ 
https://issues.apache.org/jira/browse/JCLOUDS-635?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14127841#comment-14127841
 ] 

Andrew Gaul edited comment on JCLOUDS-635 at 9/10/14 12:18 AM:
---------------------------------------------------------------

[~shrinand] I restested with jclouds 1.8.0 against several providers and see 
the following results:

{noformat}
$ . ~/private/credentials/aws_s3 
$ bin/jclouds-cli/bin/jclouds blobstore write gaulfake test test
Container not found: gaulfake.s3.amazonaws.com not found: The specified bucket 
does not exist
$ echo $?
2

$ . ~/private/credentials/azureblob 
$ bin/jclouds-cli/bin/jclouds blobstore write gaulfake test test
Blob not found: test not found in container gaulfake: PUT 
https://gaultest2.blob.core.windows.net/gaulfake/test HTTP/1.1 -> HTTP/1.1 404 
null
$ echo $?
2

$ . ~/private/credentials/cloudfiles_us 
$ bin/jclouds-cli/bin/jclouds blobstore write gaulfake test test
Blob not found: test not found in container gaulfake: PUT 
https://storage101.dfw1.clouddrive.com/v1/MossoCloudFS_e2d63902-0d79-417c-90d8-5603fac57bbb/gaulfake/test
 HTTP/1.1 -> HTTP/1.1 404 null
$ echo $?
2
{noformat}

While {{KeyNotFoundException}} should be {{ResourceNotFoundException}}, this 
appears to work correctly.


was (Author: gaul):
[~shrinand] I restested with jclouds 1.8.0 against several providers and see 
the following results:

{noformat}
$ . ~/private/credentials/aws_s3 
$ bin/jclouds-cli/bin/jclouds blobstore write gaulfake test test
Container not found: gaulfake.s3.amazonaws.com not found: The specified bucket 
does not exist
$ echo $?
2

$ . ~/private/credentials/azureblob 
$ bin/jclouds-cli/bin/jclouds blobstore write gaulfake test test
Blob not found: test not found in container gaulfake: PUT 
https://gaultest2.blob.core.windows.net/gaulfake/test HTTP/1.1 -> HTTP/1.1 404 
null
$ echo $?
2

$ . ~/private/credentials/cloudfiles_us 
$ bin/jclouds-cli/bin/jclouds blobstore write gaulfake test test
Blob not found: test not found in container gaulfake: PUT 
https://storage101.dfw1.clouddrive.com/v1/MossoCloudFS_e2d63902-0d79-417c-90d8-5603fac57bbb/gaulfake/test
 HTTP/1.1 -> HTTP/1.1 404 null
$ echo $?
2
{noformat}

While {{KeyNotFoundException}} shold be {{ResourceNotFoundException}}, this 
appears to work correctly.

> Incorrect error codes when writing a blob to a non existent container for 
> swift based object stores.
> ----------------------------------------------------------------------------------------------------
>
>                 Key: JCLOUDS-635
>                 URL: https://issues.apache.org/jira/browse/JCLOUDS-635
>             Project: jclouds
>          Issue Type: Bug
>          Components: jclouds-blobstore
>    Affects Versions: 1.7.2
>         Environment: Ubuntu 12.04
>            Reporter: Deepak Bobbarjung
>            Assignee: Shri Javadekar
>             Fix For: 2.0.0
>
>
> Writing a blob to non existent container in an AWS objectstore fails with a 
> "Container not found" error and a status code of 2. However writing  a blob 
> to a non existent container in a swift based objectstore (we tried both 
> generic swift and rackspace) results in a  "IO error: Server rejected 
> operation" and a status code of 5. 
> {noformat}
> user@ubuntu-host:/opt/some/directory$ 
> /opt/some/directory/jclouds-cli/bin/jclouds blobstore write 
> --provider=swift-keystone --identity=<redacted> --credential=<redacted> 
> --endpoint=http://swift-endpoint <non-existent-container> <some-key> 
> /tmp/some-file
> shell: JAVA_HOME not set; results may vary
> log4j:ERROR setFile(null,true) call failed.
> java.io.FileNotFoundException: /var/log/jclouds.log (Permission denied)
> ...
> ..
> IO error: Server rejected operation
> user@ubuntu-host:/opt/some/directory$ echo $?
> 5
> user@ubuntu-host:/opt/some/direcoty$ 
> /opt/some/directory/jclouds-cli/bin/jclouds blobstore write --provider=aws-s3 
> --identity=<redacted> --credential=<redacted> <non-existent-container> 
> <somekey> /tmp/somefile
> shell: JAVA_HOME not set; results may vary
> log4j:ERROR setFile(null,true) call failed.
> java.io.FileNotFoundException: /var/log/jclouds.log (Permission denied)
>         at java.io.FileOutputStream.open(Native Method)
> ....
>         at org.jclouds.cli.runner.Main.main(Main.java:111)
> Container not found: non-existent-container.s3.amazonaws.com not found: The 
> specified bucket does not exist
> user@ubuntu-host:/opt/some/directory$ echo $?
> 2
> {noformat}
> This makes it hard to programmatically catch the container not found error 
> and create containers only if the container does not exist without hacky 
> workarounds.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to