jclouds-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ghassen (Jira)" <j...@apache.org>
Subject [jira] [Updated] (JCLOUDS-1534) Not able to create aws S3 bucket in region
Date Thu, 19 Dec 2019 17:39:00 GMT

     [ https://issues.apache.org/jira/browse/JCLOUDS-1534?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Ghassen updated JCLOUDS-1534:
-----------------------------
    Docs Text: 
package test.mypackage.aws;


import com.google.common.collect.ImmutableSet;
import org.jclouds.ContextBuilder;
import org.jclouds.aws.domain.Region;
import org.jclouds.blobstore.BlobStore;
import org.jclouds.blobstore.BlobStoreContext;
import org.jclouds.domain.Location;
import org.jclouds.domain.LocationBuilder;
import org.jclouds.domain.LocationScope;
import org.jclouds.logging.slf4j.config.SLF4JLoggingModule;

import java.util.Properties;

import static org.jclouds.location.reference.LocationConstants.PROPERTY_REGIONS;


public class AwsTestMain {


    public static void main(String[] args) {

        String containername = "mybcukettest-574t8w73tqqaasd";

        Properties overrides = new Properties();
        overrides.setProperty(PROPERTY_REGIONS, Region.CA_CENTRAL_1);
        Iterable<? extends SLF4JLoggingModule> modules = ImmutableSet.<SLF4JLoggingModule>of(new
SLF4JLoggingModule());
        BlobStoreContext contextBuilder = ContextBuilder.newBuilder("aws-s3")
                .credentials("xxxxxxxxxxxxxxxxxxxxxxx", "xxxxxxxxxxxxxxxxxxxxxxxx")
                .overrides(overrides)
                .modules(modules)
                .buildView(BlobStoreContext.class);

        BlobStore blobStore = contextBuilder.getBlobStore();
        // Create Container
        Location location = new LocationBuilder().scope(LocationScope.REGION)
                .id(Region.CA_CENTRAL_1)
                .description("region")
                .build();
        blobStore.createContainerInLocation(location, containername);

        contextBuilder.close();
    }
}



-------------------------------------------------------------------
12:28:53 PM: Executing task 'AwsTestMain.main()'...

> Task :compileJava UP-TO-DATE
> Task :compileGroovy NO-SOURCE
> Task :processResources UP-TO-DATE
> Task :classes UP-TO-DATE
> Task :compileTestJava
> Task :compileTestGroovy NO-SOURCE
> Task :processTestResources UP-TO-DATE
> Task :testClasses

> Task :AwsTestMain.main()

Exception in thread "main" java.lang.IllegalArgumentException: requested location us-standard,
which is not in the configured locations: {ca-central-1=Suppliers.ofInstance(https://s3-ca-central-1.amazonaws.com)}
	at com.google.common.base.Preconditions.checkArgument(Preconditions.java:145)
	at org.jclouds.location.functions.RegionToEndpointOrProviderIfNull.apply(RegionToEndpointOrProviderIfNull.java:60)
	at org.jclouds.location.functions.RegionToEndpointOrProviderIfNull.apply(RegionToEndpointOrProviderIfNull.java:37)
	at com.google.common.base.Suppliers$SupplierComposition.get(Suppliers.java:67)
	at org.jclouds.rest.internal.RestAnnotationProcessor.getEndpointFor(RestAnnotationProcessor.java:562)
	at org.jclouds.rest.internal.RestAnnotationProcessor.apply(RestAnnotationProcessor.java:204)
	at org.jclouds.rest.internal.RestAnnotationProcessor.apply(RestAnnotationProcessor.java:137)
	at org.jclouds.rest.internal.InvokeHttpMethod.toCommand(InvokeHttpMethod.java:189)
	at org.jclouds.rest.internal.InvokeHttpMethod.invoke(InvokeHttpMethod.java:85)
	at org.jclouds.rest.internal.InvokeHttpMethod.apply(InvokeHttpMethod.java:74)
	at org.jclouds.rest.internal.InvokeHttpMethod.apply(InvokeHttpMethod.java:45)
	at org.jclouds.rest.internal.DelegatesToInvocationFunction.handle(DelegatesToInvocationFunction.java:156)
	at org.jclouds.rest.internal.DelegatesToInvocationFunction.invoke(DelegatesToInvocationFunction.java:123)
	at com.sun.proxy.$Proxy46.putBucketInRegion(Unknown Source)
	at org.jclouds.s3.blobstore.S3BlobStore.createContainerInLocation(S3BlobStore.java:454)
	at org.jclouds.aws.s3.blobstore.AWSS3BlobStore.createContainerInLocation(AWSS3BlobStore.java:105)
	at org.jclouds.s3.blobstore.S3BlobStore.createContainerInLocation(S3BlobStore.java:146)
	at ca.nbc.fm.bpo.camunda.AwsTestMain.main(AwsTestMain.java:41)

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':AwsTestMain.main()'.
> Process 'command 'C:/Program Files/Java/jdk-11.0.5/bin/java.exe'' finished with non-zero
exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to
get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 6s

> Task :AwsTestMain.main() FAILED
5 actionable tasks: 2 executed, 3 up-to-date
12:29:00 PM: Task execution finished 'AwsTestMain.main()'.


  was:
package test.ghassen.camunda;


import com.google.common.collect.ImmutableSet;
import org.jclouds.ContextBuilder;
import org.jclouds.aws.domain.Region;
import org.jclouds.blobstore.BlobStore;
import org.jclouds.blobstore.BlobStoreContext;
import org.jclouds.domain.Location;
import org.jclouds.domain.LocationBuilder;
import org.jclouds.domain.LocationScope;
import org.jclouds.logging.slf4j.config.SLF4JLoggingModule;

import java.util.Properties;

import static org.jclouds.location.reference.LocationConstants.PROPERTY_REGIONS;


public class AwsTestMain {


    public static void main(String[] args) {

        String containername = "mybcukettest-574t8w73tqqaasd";

        Properties overrides = new Properties();
        overrides.setProperty(PROPERTY_REGIONS, Region.CA_CENTRAL_1);
        Iterable<? extends SLF4JLoggingModule> modules = ImmutableSet.<SLF4JLoggingModule>of(new
SLF4JLoggingModule());
        BlobStoreContext contextBuilder = ContextBuilder.newBuilder("aws-s3")
                .credentials("xxxxxxxxxxxxxxxxxxxxxxx", "xxxxxxxxxxxxxxxxxxxxxxxx")
                .overrides(overrides)
                .modules(modules)
                .buildView(BlobStoreContext.class);

        BlobStore blobStore = contextBuilder.getBlobStore();
        // Create Container
        Location location = new LocationBuilder().scope(LocationScope.REGION)
                .id(Region.CA_CENTRAL_1)
                .description("region")
                .build();
        blobStore.createContainerInLocation(location, containername);

        contextBuilder.close();
    }
}



-------------------------------------------------------------------
12:28:53 PM: Executing task 'AwsTestMain.main()'...

> Task :compileJava UP-TO-DATE
> Task :compileGroovy NO-SOURCE
> Task :processResources UP-TO-DATE
> Task :classes UP-TO-DATE
> Task :compileTestJava
> Task :compileTestGroovy NO-SOURCE
> Task :processTestResources UP-TO-DATE
> Task :testClasses

> Task :AwsTestMain.main()

Exception in thread "main" java.lang.IllegalArgumentException: requested location us-standard,
which is not in the configured locations: {ca-central-1=Suppliers.ofInstance(https://s3-ca-central-1.amazonaws.com)}
	at com.google.common.base.Preconditions.checkArgument(Preconditions.java:145)
	at org.jclouds.location.functions.RegionToEndpointOrProviderIfNull.apply(RegionToEndpointOrProviderIfNull.java:60)
	at org.jclouds.location.functions.RegionToEndpointOrProviderIfNull.apply(RegionToEndpointOrProviderIfNull.java:37)
	at com.google.common.base.Suppliers$SupplierComposition.get(Suppliers.java:67)
	at org.jclouds.rest.internal.RestAnnotationProcessor.getEndpointFor(RestAnnotationProcessor.java:562)
	at org.jclouds.rest.internal.RestAnnotationProcessor.apply(RestAnnotationProcessor.java:204)
	at org.jclouds.rest.internal.RestAnnotationProcessor.apply(RestAnnotationProcessor.java:137)
	at org.jclouds.rest.internal.InvokeHttpMethod.toCommand(InvokeHttpMethod.java:189)
	at org.jclouds.rest.internal.InvokeHttpMethod.invoke(InvokeHttpMethod.java:85)
	at org.jclouds.rest.internal.InvokeHttpMethod.apply(InvokeHttpMethod.java:74)
	at org.jclouds.rest.internal.InvokeHttpMethod.apply(InvokeHttpMethod.java:45)
	at org.jclouds.rest.internal.DelegatesToInvocationFunction.handle(DelegatesToInvocationFunction.java:156)
	at org.jclouds.rest.internal.DelegatesToInvocationFunction.invoke(DelegatesToInvocationFunction.java:123)
	at com.sun.proxy.$Proxy46.putBucketInRegion(Unknown Source)
	at org.jclouds.s3.blobstore.S3BlobStore.createContainerInLocation(S3BlobStore.java:454)
	at org.jclouds.aws.s3.blobstore.AWSS3BlobStore.createContainerInLocation(AWSS3BlobStore.java:105)
	at org.jclouds.s3.blobstore.S3BlobStore.createContainerInLocation(S3BlobStore.java:146)
	at ca.nbc.fm.bpo.camunda.AwsTestMain.main(AwsTestMain.java:41)

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':AwsTestMain.main()'.
> Process 'command 'C:/Program Files/Java/jdk-11.0.5/bin/java.exe'' finished with non-zero
exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to
get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 6s

> Task :AwsTestMain.main() FAILED
5 actionable tasks: 2 executed, 3 up-to-date
12:29:00 PM: Task execution finished 'AwsTestMain.main()'.



> Not able to create aws S3 bucket in region
> ------------------------------------------
>
>                 Key: JCLOUDS-1534
>                 URL: https://issues.apache.org/jira/browse/JCLOUDS-1534
>             Project: jclouds
>          Issue Type: Bug
>          Components: jclouds-blobstore
>    Affects Versions: 2.2.0
>            Reporter: Ghassen
>            Priority: Major
>
> When trying to create s3 bucket using jcloud and specifying the location, the put action
try to push the bucket on us-default region and the specified region does,t take in consideration



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Mime
View raw message