New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error deploying to EB in one region with S3 in another #30

Closed
mcgeeco opened this Issue Mar 23, 2016 · 8 comments

Comments

Projects
None yet
2 participants
@mcgeeco

mcgeeco commented Mar 23, 2016

Hi,
We have a job that's deploying to an Elastic Beanstalk app in us-east-1, while our S3 is in eu-west-1. The config for this job uses us-east-1, but it looks like that's causing auth problems when uploading to S3?

Getting this error:

FATAL: Deployment Failure
java.io.IOException: Deployment Failure
    at br.com.ingenieux.jenkins.plugins.awsebdeployment.AWSEBDeploymentBuilder.perform(AWSEBDeploymentBuilder.java:166)
    at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
    at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:782)
    at hudson.model.Build$BuildExecution.build(Build.java:205)
    at hudson.model.Build$BuildExecution.doRun(Build.java:162)
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)
    at hudson.model.Run.execute(Run.java:1738)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:98)
    at hudson.model.Executor.run(Executor.java:410)
Caused by: java.util.concurrent.ExecutionException: com.amazonaws.services.s3.model.AmazonS3Exception: The authorization header is malformed; the region 'us-east-1' is wrong; expecting 'eu-west-1' (Service: Amazon S3; Status Code: 400; Error Code: AuthorizationHeaderMalformed; Request ID: 278A71ACE23FDF61), S3 Extended Request ID: yeHoDLRbvLAb0CFlsR+mLroQRv5dk7zFm2BNR1lHQQ1BQ9/hHgGB/p0A17qJl4A7x8XOb1UMgAM=
    at java.util.concurrent.FutureTask.report(FutureTask.java:122)
    at java.util.concurrent.FutureTask.get(FutureTask.java:188)
    at hudson.remoting.LocalChannel$2.get(LocalChannel.java:77)
    at br.com.ingenieux.jenkins.plugins.awsebdeployment.DeployerRunner.perform(DeployerRunner.java:66)
    at br.com.ingenieux.jenkins.plugins.awsebdeployment.AWSEBDeploymentBuilder.perform(AWSEBDeploymentBuilder.java:162)
    ... 9 more
Caused by: com.amazonaws.services.s3.model.AmazonS3Exception: The authorization header is malformed; the region 'us-east-1' is wrong; expecting 'eu-west-1' (Service: Amazon S3; Status Code: 400; Error Code: AuthorizationHeaderMalformed; Request ID: 278A71ACE23FDF61), S3 Extended Request ID: yeHoDLRbvLAb0CFlsR+mLroQRv5dk7zFm2BNR1lHQQ1BQ9/hHgGB/p0A17qJl4A7x8XOb1UMgAM=
    at com.amazonaws.http.AmazonHttpClient.handleErrorResponse(AmazonHttpClient.java:1275)
    at com.amazonaws.http.AmazonHttpClient.executeOneRequest(AmazonHttpClient.java:873)
    at com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:576)
    at com.amazonaws.http.AmazonHttpClient.doExecute(AmazonHttpClient.java:362)
    at com.amazonaws.http.AmazonHttpClient.executeWithTimer(AmazonHttpClient.java:328)
    at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:307)
    at com.amazonaws.services.s3.AmazonS3Client.invoke(AmazonS3Client.java:3659)
    at com.amazonaws.services.s3.AmazonS3Client.putObject(AmazonS3Client.java:1422)
    at com.amazonaws.services.s3.AmazonS3Client.putObject(AmazonS3Client.java:1282)
    at br.com.ingenieux.jenkins.plugins.awsebdeployment.cmd.BuildAndUploadArchive.perform(BuildAndUploadArchive.java:57)
    at br.com.ingenieux.jenkins.plugins.awsebdeployment.cmd.DeployerChain.perform(DeployerChain.java:54)
    at br.com.ingenieux.jenkins.plugins.awsebdeployment.SlaveDeployerCallable.call(SlaveDeployerCallable.java:42)
    at br.com.ingenieux.jenkins.plugins.awsebdeployment.SlaveDeployerCallable.call(SlaveDeployerCallable.java:27)
    at hudson.remoting.LocalChannel$1.call(LocalChannel.java:52)
    at jenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:46)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)

Version 0.3.5.

Thanks!

@mcgeeco

This comment has been minimized.

Show comment
Hide comment
@mcgeeco

mcgeeco Mar 23, 2016

Should add that our old Jenkins instance has version 0.0.3 and that seems fine with the same credentials.

...downgrading back to 0.0.3 fixes problem, but it was still broken with 0.1.0.

mcgeeco commented Mar 23, 2016

Should add that our old Jenkins instance has version 0.0.3 and that seems fine with the same credentials.

...downgrading back to 0.0.3 fixes problem, but it was still broken with 0.1.0.

@aldrinleal

This comment has been minimized.

Show comment
Hide comment
@aldrinleal

aldrinleal Mar 23, 2016

Member

See the previous problems w/r/t JVM in the history here.

Plus, I'm not sure it will work across regions either.

Member

aldrinleal commented Mar 23, 2016

See the previous problems w/r/t JVM in the history here.

Plus, I'm not sure it will work across regions either.

@mcgeeco

This comment has been minimized.

Show comment
Hide comment
@mcgeeco

mcgeeco Mar 23, 2016

I'm not sure what you mean - I can't find any mentions of the JVM here.

Also like I said, it does work in version 0.0.3.

mcgeeco commented Mar 23, 2016

I'm not sure what you mean - I can't find any mentions of the JVM here.

Also like I said, it does work in version 0.0.3.

@aldrinleal

This comment has been minimized.

Show comment
Hide comment
@aldrinleal
Member

aldrinleal commented Mar 23, 2016

#26

@mcgeeco

This comment has been minimized.

Show comment
Hide comment
@mcgeeco

mcgeeco Mar 23, 2016

Sorry if I'm missing something but I don't see any similarities. My credentials validate just fine, and another Jenkins build, where the Elastic Beanstalk Project is in the same region as our S3, works fine. The problem only arises in the Jenkins build where the Elastic Beanstalk project is in us-east-1 instead of eu-west-1:

The authorization header is malformed; the region 'us-east-1' is wrong; expecting 'eu-west-1' (Service: Amazon S3; Status Code: 400; Error Code: AuthorizationHeaderMalformed

My guess is that the plugin is using the region from the field in the job config for both the Elastic Beanstalk operations and the S3 ones.

mcgeeco commented Mar 23, 2016

Sorry if I'm missing something but I don't see any similarities. My credentials validate just fine, and another Jenkins build, where the Elastic Beanstalk Project is in the same region as our S3, works fine. The problem only arises in the Jenkins build where the Elastic Beanstalk project is in us-east-1 instead of eu-west-1:

The authorization header is malformed; the region 'us-east-1' is wrong; expecting 'eu-west-1' (Service: Amazon S3; Status Code: 400; Error Code: AuthorizationHeaderMalformed

My guess is that the plugin is using the region from the field in the job config for both the Elastic Beanstalk operations and the S3 ones.

@aldrinleal

This comment has been minimized.

Show comment
Hide comment
@aldrinleal

aldrinleal Mar 23, 2016

Member

Oh, try to recreate the configuration. 0.0.3 is completely incompatible with later releases.

Member

aldrinleal commented Mar 23, 2016

Oh, try to recreate the configuration. 0.0.3 is completely incompatible with later releases.

@aldrinleal

This comment has been minimized.

Show comment
Hide comment
@aldrinleal

aldrinleal Mar 23, 2016

Member

Also: #8

Member

aldrinleal commented Mar 23, 2016

Also: #8

@mcgeeco

This comment has been minimized.

Show comment
Hide comment
@mcgeeco

mcgeeco Mar 30, 2016

So, the problem was that I didn't understand S3 and regions properly.

I thought S3 was region-less, which technically it is. However the buckets each have a region. And here, you have to make sure that the bucket you specify in the S3 Bucket Name field was created in the same region as the region you enter in the AWS Region field.

Thanks and sorry for the bother.

mcgeeco commented Mar 30, 2016

So, the problem was that I didn't understand S3 and regions properly.

I thought S3 was region-less, which technically it is. However the buckets each have a region. And here, you have to make sure that the bucket you specify in the S3 Bucket Name field was created in the same region as the region you enter in the AWS Region field.

Thanks and sorry for the bother.

@mcgeeco mcgeeco closed this Mar 30, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment