** Jenkins:无法将文件上传到aws S3 bucket **

时间:2017-05-18 08:40:44

标签: jenkins amazon-s3 jenkins-plugins

构建代码后,我无法将构建工件上传到aws s3存储桶。

以下是我从jenkins获得的控制台输出片段。

  

创建   /data/tomcat/jenkins/workspace/Test_job@tmp/.npmrc2357185941074023133Deleting   1个临时文件将工件发布到S3 Bucket Build仍然是   运行发布工件到S3 Bucket使用S3配置文件:   newui-jenkins-user将工件发布到S3 Bucket   bucket = ri-newui-development /,file = 0.js region = us-west-2,将是   从slave上传= false managed = true,服务器加密为true   将工件发布到S3 Bucket bucket = ri-newui-development /,   file = 0.js.gz region = us-west-2,将从slave = false上传   managed = true,server encryption true将工件发布到S3 Bucket   bucket = ri-newui-development /,file = 0.js.map region = us-west-2,将是   从slave上传= false managed = true,服务器加密为true   将工件发布到S3 Bucket bucket = ri-newui-development /,file = 1.js   region = us-west-2,将从slave = false managed = true上传,   server encryption true将工件发布到S3 Bucket   bucket = ri-newui-development /,file = 1.js.gz region = us-west-2,将是   从slave上传= false managed = true,服务器加密为true   将工件发布到S3 Bucket bucket = ri-newui-development /,   file = 1.js.map region = us-west-2,将从slave = false上传   managed = true,server encryption true将工件发布到S3 Bucket   bucket = ri-newui-development /,file = 2.js region = us-west-2,将是   从slave上传= false managed = true,服务器加密为true   将工件发布到S3 Bucket bucket = ri-newui-development /,   file = 2.js.gz region = us-west-2,将从slave = false上传   managed = true,server encryption true将工件发布到S3 Bucket   bucket = ri-newui-development /,file = 2.js.map region = us-west-2,将是   从slave上传= false managed = true,服务器加密为true   将工件发布到S3 Bucket bucket = ri-newui-development /,file = 3.js   region = us-west-2,将从slave = false managed = true上传,   server encryption true将工件发布到S3 Bucket   bucket = ri-newui-development /,file = 3.js.gz region = us-west-2,将是   从slave上传= false managed = true,服务器加密为true   将工件发布到S3 Bucket bucket = ri-newui-development /,   file = 3.js.map region = us-west-2,将从slave = false上传   managed = true,server encryption true将工件发布到S3 Bucket   bucket = ri-newui-development /,file = 4.js region = us-west-2,将是   从slave上传= false managed = true,服务器加密为true   将工件发布到S3 Bucket bucket = ri-newui-development /,   file = 4.js.gz region = us-west-2,将从slave = false上传   managed = true,server encryption true将工件发布到S3 Bucket   bucket = ri-newui-development /,file = 4.js.map region = us-west-2,将是   从slave上传= false managed = true,服务器加密为true   将工件发布到S3 Bucket bucket = ri-newui-development /,file = 5.js   region = us-west-2,将从slave = false managed = true上传,   server encryption true将工件发布到S3 Bucket   bucket = ri-newui-development /,file = 5.js.gz region = us-west-2,将是   从slave上传= false managed = true,服务器加密为true   将工件发布到S3 Bucket bucket = ri-newui-development /,   file = 5.js.map region = us-west-2,将从slave = false上传   managed = true,server encryption true将工件发布到S3 Bucket   bucket = ri-newui-development /,file = 6.js region = us-west-2,将是   从slave上传= false managed = true,服务器加密为true   将工件发布到S3 Bucket bucket = ri-newui-development /,   file = 6.js.gz region = us-west-2,将从slave = false上传   managed = true,server encryption true将工件发布到S3 Bucket   bucket = ri-newui-development /,file = 6.js.map region = us-west-2,将是   从slave上传= false managed = true,服务器加密为true   将工件发布到S3 Bucket bucket = ri-newui-development /,file = 7.js   region = us-west-2,将从slave = false managed = true上传,   server encryption true将工件发布到S3 Bucket   bucket = ri-newui-development /,file = 7.js.gz region = us-west-2,将是   从slave上传= false managed = true,服务器加密为true   将工件发布到S3 Bucket bucket = ri-newui-development /,   file = 7.js.map region = us-west-2,将从slave = false上传   managed = true,server encryption true将工件发布到S3 Bucket   bucket = ri-newui-development /,file = 8.js region = us-west-2,将是   从slave上传= false managed = true,服务器加密为true   将工件发布到S3 Bucket bucket = ri-newui-development /,   file = 8.js.map region = us-west-2,将从slave = false上传   managed = true,server encryption true将工件发布到S3 Bucket   bucket = ri-newui-development /,file = grid-search-internal.js   region = us-west-2,将从slave = false managed = true上传,   server encryption true将工件发布到S3 Bucket   bucket = ri-newui-development /,file = grid-search-internal.js.gz   region = us-west-2,将从slave = false managed = true上传,   server encryption true将工件发布到S3 Bucket   bucket = ri-newui-development /,file = grid-search-internal.js.map   region = us-west-2,将从slave = false managed = true上传,   server encryption true将工件发布到S3 Bucket   bucket = ri-newui-development /,file = index.html region = us-west-2,will   从slave = false managed = true上传,服务器加密为true   将工件发布到S3 Bucket bucket = ri-newui-development /,   file = main.js region = us-west-2,将从slave = false上传   managed = true,server encryption true将工件发布到S3 Bucket   bucket = ri-newui-development /,file = main.js.gz region = us-west-2,will   从slave = false managed = true上传,服务器加密为true   将工件发布到S3 Bucket bucket = ri-newui-development /,   file = main.js.map region = us-west-2,将从slave = false上传   managed = true,server encryption true将工件发布到S3 Bucket   bucket = ri-newui-development /,file = maintenance-internal.js   region = us-west-2,将从slave = false managed = true上传,   server encryption true将工件发布到S3 Bucket   bucket = ri-newui-development /,file = maintenance-internal.js.gz   region = us-west-2,将从slave = false managed = true上传,   server encryption true将工件发布到S3 Bucket   bucket = ri-newui-development /,file = maintenance-internal.js.map   region = us-west-2,将从slave = false managed = true上传,   server encryption true将工件发布到S3 Bucket   bucket = ri-newui-development /,file = polyfills.js region = us-west-2,will   从slave = false managed = true上传,服务器加密为true   将工件发布到S3 Bucket bucket = ri-newui-development /,   file = polyfills.js.gz region = us-west-2,将从上传   slave = false managed = true,server encryption true将工件发布到   S3 Bucket bucket = ri-newui-development /,file = polyfills.js.map   region = us-west-2,将从slave = false managed = true上传,   server encryption true将工件发布到S3 Bucket   bucket = ri-newui-development /,file = search-internal.js   region = us-west-2,将从slave = false managed = true上传,   server encryption true将工件发布到S3 Bucket   bucket = ri-newui-development /,file = search-internal.js.gz   region = us-west-2,将从slave = false managed = true上传,   server encryption true将工件发布到S3 Bucket   bucket = ri-newui-development /,file = search-internal.js.map   region = us-west-2,将从slave = false managed = true上传,   server encryption true将工件发布到S3 Bucket   bucket = ri-newui-development /,file = shared.js region = us-west-2,将是   从slave上传= false managed = true,服务器加密为true   将工件发布到S3 Bucket bucket = ri-newui-development /,   file = shared.js.gz region = us-west-2,将从slave = false上传   managed = true,server encryption true将工件发布到S3 Bucket   bucket = ri-newui-development /,file = shared.js.map region = us-west-2,   将从slave = false managed = true,服务器加密上传   true将工件发布到S3 Bucket bucket = ri-newui-development /,   file = vendor.js region = us-west-2,将从slave = false上传   managed = true,server encryption true将工件发布到S3 Bucket   bucket = ri-newui-development /,file = vendor.js.gz region = us-west-2,will   从slave = false managed = true上传,服务器加密为true   将工件发布到S3 Bucket bucket = ri-newui-development /,   file = vendor.js.map region = us-west-2,将从slave = false上传   managed = true,server encryption true

     

错误:无法上传文件   com.amazonaws.services.s3.model.AmazonS3Exception:存储桶在   这个地区:null。请使用此区域重试请求   (服务:Amazon S3;状态代码:301;错误代码:PermanentRedirect;   申请ID:EDD73B3CC84C0AF6),S3扩展请求ID:   ONgTnwkLfl7piKKMBtueCrbpXYNVfbx8nTMve + / +提起笔= sSuFX4BAQY3ZuIR3rFrTPI0EJZnyBFquQ     在   com.amazonaws.http.AmazonHttpClient $ RequestExecutor.handleErrorResponse(AmazonHttpClient.java:1545)     在   com.amazonaws.http.AmazonHttpClient $ RequestExecutor.executeOneRequest(AmazonHttpClient.java:1183)     在   com.amazonaws.http.AmazonHttpClient $ RequestExecutor.executeHelper(AmazonHttpClient.java:964)     在   com.amazonaws.http.AmazonHttpClient $ RequestExecutor.doExecute(AmazonHttpClient.java:676)     在   com.amazonaws.http.AmazonHttpClient $ RequestExecutor.executeWithTimer(AmazonHttpClient.java:650)     在   com.amazonaws.http.AmazonHttpClient $ RequestExecutor.execute(AmazonHttpClient.java:633)     在   com.amazonaws.http.AmazonHttpClient $ RequestExecutor.access 300 $(AmazonHttpClient.java:601)     在   com.amazonaws.http.AmazonHttpClient $ RequestExecutionBuilderImpl.execute(AmazonHttpClient.java:583)     在   com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:447)     在   com.amazonaws.services.s3.AmazonS3Client.invoke(AmazonS3Client.java:4137)     在   com.amazonaws.services.s3.AmazonS3Client.putObject(AmazonS3Client.java:1685)     在   com.amazonaws.services.s3.transfer.internal.UploadCallable.uploadInOneChunk(UploadCallable.java:133)     在   com.amazonaws.services.s3.transfer.internal.UploadCallable.call(UploadCallable.java:125)     在   com.amazonaws.services.s3.transfer.internal.UploadMonitor.call(UploadMonitor.java:139)     在   com.amazonaws.services.s3.transfer.internal.UploadMonitor.call(UploadMonitor.java:47)     在java.util.concurrent.FutureTask.run(FutureTask.java:262)at   java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)     在   java.util.concurrent.ThreadPoolExecutor中的$ Worker.run(ThreadPoolExecutor.java:615)     在java.lang.Thread.run(Thread.java:745)

     

构建步骤'将工件发布到S3 Bucket'将构建结果更改为   完成不稳定:不稳定

1 个答案:

答案 0 :(得分:1)

当我的默认区域与存储区所在的区域不同时,我遇到了这个问题。将默认区域更改为存储区所在的区域将解决此问题。

您可以验证您的AWS_DEFAULT_REGION设置为什么或者〜/ .aws / config中的默认区域是什么以及该存储区位于哪个区域?