Johnny
Johnny

Reputation: 105

Exception in thread "main" com.oracle.bmc.model.BmcException: (404, NamespaceNotFound, false)

I executed the OCI sample program ObjectStorageGetBucketExample.java and was able to create the bucket and add the file. But, when I ran the ObjectStorageAsyncExample.java and ObjectStorageSyncExample.java to list the bucket. I got the following errors:

Exception in thread "main" com.oracle.bmc.model.BmcException: (404, NamespaceNotFound, false) You do not have the authorization to perform this request, or the requested resource could not be found.

I can write but can't read. I just want to know what type of authorization do I need?

Here is the full errors:

Exception in thread "main" com.oracle.bmc.model.BmcException: (404, NamespaceNotFound, false) You do not have authorization to perform this request, or the requested resource could not be found at com.oracle.bmc.http.internal.ResponseHelper.throwIfNotSuccessful(ResponseHelper.java:138) at com.oracle.bmc.http.internal.ResponseConversionFunctionFactory$ValidatingParseResponseFunction.apply(ResponseConversionFunctionFactory.java:88) at com.oracle.bmc.http.internal.ResponseConversionFunctionFactory$ValidatingParseResponseFunction.apply(ResponseConversionFunctionFactory.java:84) at com.oracle.bmc.objectstorage.internal.http.ListBucketsConverter$1.apply(ListBucketsConverter.java:112) at com.oracle.bmc.objectstorage.internal.http.ListBucketsConverter$1.apply(ListBucketsConverter.java:94) at com.oracle.bmc.objectstorage.ObjectStorageClient.lambda$null$52(ObjectStorageClient.java:1222) at com.oracle.bmc.retrier.BmcGenericRetrier.doFunctionCall(BmcGenericRetrier.java:88) at com.oracle.bmc.retrier.BmcGenericRetrier.lambda$execute$0(BmcGenericRetrier.java:59) at com.oracle.bmc.waiter.GenericWaiter.execute(GenericWaiter.java:55) at com.oracle.bmc.retrier.BmcGenericRetrier.execute(BmcGenericRetrier.java:50) at com.oracle.bmc.objectstorage.ObjectStorageClient.lambda$listBuckets$53(ObjectStorageClient.java:1218) at com.oracle.bmc.retrier.BmcGenericRetrier.doFunctionCall(BmcGenericRetrier.java:88) at com.oracle.bmc.retrier.BmcGenericRetrier.lambda$execute$0(BmcGenericRetrier.java:59) at com.oracle.bmc.waiter.GenericWaiter.execute(GenericWaiter.java:55) at com.oracle.bmc.retrier.BmcGenericRetrier.execute(BmcGenericRetrier.java:50) at com.oracle.bmc.objectstorage.ObjectStorageClient.listBuckets(ObjectStorageClient.java:1212) at ObjectStorageSyncExample.main(ObjectStorageSyncExample.java:47)

Upvotes: 1

Views: 1984

Answers (1)

Tim
Tim

Reputation: 151

It looks as though it is attempting to list buckets. The ListBuckets operation requires BUCKET_INSPECT permission.

https://docs.cloud.oracle.com/en-us/iaas/Content/Identity/Reference/objectstoragepolicyreference.htm

Permissions are granted via IAM policies. And BUCKET_INSPECT can be granted explicitly, but is also included in inspect buckets and inspect object-family.

hope this helps!

Upvotes: 1

Related Questions