title: **Jenkins: Unable to upload files to aws S3 bucket**
body: <p>I am unable to upload the build artifacts to aws s3 bucket after building the code.</p>
  
  <p>The below is the snippet of console output i got from jenkins.</p>
  
  <blockquote>
    <p>Created
    /data/tomcat/jenkins/workspace/Test_job@tmp/.npmrc2357185941074023133Deleting
    1 temporary files Publish artifacts to S3 Bucket Build is still
    running Publish artifacts to S3 Bucket Using S3 profile:
    newui-jenkins-user Publish artifacts to S3 Bucket
    bucket=ri-newui-development/, file=0.js region=us-west-2, will be
    uploaded from slave=false managed=true , server encryption true
    Publish artifacts to S3 Bucket bucket=ri-newui-development/,
    file=0.js.gz region=us-west-2, will be uploaded from slave=false
    managed=true , server encryption true Publish artifacts to S3 Bucket
    bucket=ri-newui-development/, file=0.js.map region=us-west-2, will be
    uploaded from slave=false managed=true , server encryption true
    Publish artifacts to S3 Bucket bucket=ri-newui-development/, file=1.js
    region=us-west-2, will be uploaded from slave=false managed=true ,
    server encryption true Publish artifacts to S3 Bucket
    bucket=ri-newui-development/, file=1.js.gz region=us-west-2, will be
    uploaded from slave=false managed=true , server encryption true
    Publish artifacts to S3 Bucket bucket=ri-newui-development/,
    file=1.js.map region=us-west-2, will be uploaded from slave=false
    managed=true , server encryption true Publish artifacts to S3 Bucket
    bucket=ri-newui-development/, file=2.js region=us-west-2, will be
    uploaded from slave=false managed=true , server encryption true
    Publish artifacts to S3 Bucket bucket=ri-newui-development/,
    file=2.js.gz region=us-west-2, will be uploaded from slave=false
    managed=true , server encryption true Publish artifacts to S3 Bucket
    bucket=ri-newui-development/, file=2.js.map region=us-west-2, will be
    uploaded from slave=false managed=true , server encryption true
    Publish artifacts to S3 Bucket bucket=ri-newui-development/, file=3.js
    region=us-west-2, will be uploaded from slave=false managed=true ,
    server encryption true Publish artifacts to S3 Bucket
    bucket=ri-newui-development/, file=3.js.gz region=us-west-2, will be
    uploaded from slave=false managed=true , server encryption true
    Publish artifacts to S3 Bucket bucket=ri-newui-development/,
    file=3.js.map region=us-west-2, will be uploaded from slave=false
    managed=true , server encryption true Publish artifacts to S3 Bucket
    bucket=ri-newui-development/, file=4.js region=us-west-2, will be
    uploaded from slave=false managed=true , server encryption true
    Publish artifacts to S3 Bucket bucket=ri-newui-development/,
    file=4.js.gz region=us-west-2, will be uploaded from slave=false
    managed=true , server encryption true Publish artifacts to S3 Bucket
    bucket=ri-newui-development/, file=4.js.map region=us-west-2, will be
    uploaded from slave=false managed=true , server encryption true
    Publish artifacts to S3 Bucket bucket=ri-newui-development/, file=5.js
    region=us-west-2, will be uploaded from slave=false managed=true ,
    server encryption true Publish artifacts to S3 Bucket
    bucket=ri-newui-development/, file=5.js.gz region=us-west-2, will be
    uploaded from slave=false managed=true , server encryption true
    Publish artifacts to S3 Bucket bucket=ri-newui-development/,
    file=5.js.map region=us-west-2, will be uploaded from slave=false
    managed=true , server encryption true Publish artifacts to S3 Bucket
    bucket=ri-newui-development/, file=6.js region=us-west-2, will be
    uploaded from slave=false managed=true , server encryption true
    Publish artifacts to S3 Bucket bucket=ri-newui-development/,
    file=6.js.gz region=us-west-2, will be uploaded from slave=false
    managed=true , server encryption true Publish artifacts to S3 Bucket
    bucket=ri-newui-development/, file=6.js.map region=us-west-2, will be
    uploaded from slave=false managed=true , server encryption true
    Publish artifacts to S3 Bucket bucket=ri-newui-development/, file=7.js
    region=us-west-2, will be uploaded from slave=false managed=true ,
    server encryption true Publish artifacts to S3 Bucket
    bucket=ri-newui-development/, file=7.js.gz region=us-west-2, will be
    uploaded from slave=false managed=true , server encryption true
    Publish artifacts to S3 Bucket bucket=ri-newui-development/,
    file=7.js.map region=us-west-2, will be uploaded from slave=false
    managed=true , server encryption true Publish artifacts to S3 Bucket
    bucket=ri-newui-development/, file=8.js region=us-west-2, will be
    uploaded from slave=false managed=true , server encryption true
    Publish artifacts to S3 Bucket bucket=ri-newui-development/,
    file=8.js.map region=us-west-2, will be uploaded from slave=false
    managed=true , server encryption true Publish artifacts to S3 Bucket
    bucket=ri-newui-development/, file=grid-search-internal.js
    region=us-west-2, will be uploaded from slave=false managed=true ,
    server encryption true Publish artifacts to S3 Bucket
    bucket=ri-newui-development/, file=grid-search-internal.js.gz
    region=us-west-2, will be uploaded from slave=false managed=true ,
    server encryption true Publish artifacts to S3 Bucket
    bucket=ri-newui-development/, file=grid-search-internal.js.map
    region=us-west-2, will be uploaded from slave=false managed=true ,
    server encryption true Publish artifacts to S3 Bucket
    bucket=ri-newui-development/, file=index.html region=us-west-2, will
    be uploaded from slave=false managed=true , server encryption true
    Publish artifacts to S3 Bucket bucket=ri-newui-development/,
    file=main.js region=us-west-2, will be uploaded from slave=false
    managed=true , server encryption true Publish artifacts to S3 Bucket
    bucket=ri-newui-development/, file=main.js.gz region=us-west-2, will
    be uploaded from slave=false managed=true , server encryption true
    Publish artifacts to S3 Bucket bucket=ri-newui-development/,
    file=main.js.map region=us-west-2, will be uploaded from slave=false
    managed=true , server encryption true Publish artifacts to S3 Bucket
    bucket=ri-newui-development/, file=maintenance-internal.js
    region=us-west-2, will be uploaded from slave=false managed=true ,
    server encryption true Publish artifacts to S3 Bucket
    bucket=ri-newui-development/, file=maintenance-internal.js.gz
    region=us-west-2, will be uploaded from slave=false managed=true ,
    server encryption true Publish artifacts to S3 Bucket
    bucket=ri-newui-development/, file=maintenance-internal.js.map
    region=us-west-2, will be uploaded from slave=false managed=true ,
    server encryption true Publish artifacts to S3 Bucket
    bucket=ri-newui-development/, file=polyfills.js region=us-west-2, will
    be uploaded from slave=false managed=true , server encryption true
    Publish artifacts to S3 Bucket bucket=ri-newui-development/,
    file=polyfills.js.gz region=us-west-2, will be uploaded from
    slave=false managed=true , server encryption true Publish artifacts to
    S3 Bucket bucket=ri-newui-development/, file=polyfills.js.map
    region=us-west-2, will be uploaded from slave=false managed=true ,
    server encryption true Publish artifacts to S3 Bucket
    bucket=ri-newui-development/, file=search-internal.js
    region=us-west-2, will be uploaded from slave=false managed=true ,
    server encryption true Publish artifacts to S3 Bucket
    bucket=ri-newui-development/, file=search-internal.js.gz
    region=us-west-2, will be uploaded from slave=false managed=true ,
    server encryption true Publish artifacts to S3 Bucket
    bucket=ri-newui-development/, file=search-internal.js.map
    region=us-west-2, will be uploaded from slave=false managed=true ,
    server encryption true Publish artifacts to S3 Bucket
    bucket=ri-newui-development/, file=shared.js region=us-west-2, will be
    uploaded from slave=false managed=true , server encryption true
    Publish artifacts to S3 Bucket bucket=ri-newui-development/,
    file=shared.js.gz region=us-west-2, will be uploaded from slave=false
    managed=true , server encryption true Publish artifacts to S3 Bucket
    bucket=ri-newui-development/, file=shared.js.map region=us-west-2,
    will be uploaded from slave=false managed=true , server encryption
    true Publish artifacts to S3 Bucket bucket=ri-newui-development/,
    file=vendor.js region=us-west-2, will be uploaded from slave=false
    managed=true , server encryption true Publish artifacts to S3 Bucket
    bucket=ri-newui-development/, file=vendor.js.gz region=us-west-2, will
    be uploaded from slave=false managed=true , server encryption true
    Publish artifacts to S3 Bucket bucket=ri-newui-development/,
    file=vendor.js.map region=us-west-2, will be uploaded from slave=false
    managed=true , server encryption true</p>
    
    <p>ERROR: Failed to upload files
    com.amazonaws.services.s3.model.AmazonS3Exception: The bucket is in
    this region: null. Please use this region to retry the request
    (Service: Amazon S3; Status Code: 301; Error Code: PermanentRedirect;
    Request ID: EDD73B3CC84C0AF6), S3 Extended Request ID:
    ONgTnwkLfl7piKKMBtueCrbpXYNVfbx8nTMve+/Gv+sSuFX4BAQY3ZuIR3rFrTPI0EJZnyBFquQ=
      at
    com.amazonaws.http.AmazonHttpClient$RequestExecutor.handleErrorResponse(AmazonHttpClient.java:1545)
      at
    com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeOneRequest(AmazonHttpClient.java:1183)
      at
    com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeHelper(AmazonHttpClient.java:964)
      at
    com.amazonaws.http.AmazonHttpClient$RequestExecutor.doExecute(AmazonHttpClient.java:676)
      at
    com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeWithTimer(AmazonHttpClient.java:650)
      at
    com.amazonaws.http.AmazonHttpClient$RequestExecutor.execute(AmazonHttpClient.java:633)
      at
    com.amazonaws.http.AmazonHttpClient$RequestExecutor.access$300(AmazonHttpClient.java:601)
      at
    com.amazonaws.http.AmazonHttpClient$RequestExecutionBuilderImpl.execute(AmazonHttpClient.java:583)
      at
    com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:447)
      at
    com.amazonaws.services.s3.AmazonS3Client.invoke(AmazonS3Client.java:4137)
      at
    com.amazonaws.services.s3.AmazonS3Client.putObject(AmazonS3Client.java:1685)
      at
    com.amazonaws.services.s3.transfer.internal.UploadCallable.uploadInOneChunk(UploadCallable.java:133)
      at
    com.amazonaws.services.s3.transfer.internal.UploadCallable.call(UploadCallable.java:125)
      at
    com.amazonaws.services.s3.transfer.internal.UploadMonitor.call(UploadMonitor.java:139)
      at
    com.amazonaws.services.s3.transfer.internal.UploadMonitor.call(UploadMonitor.java:47)
      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)</p>
    
    <p>Build step 'Publish artifacts to S3 Bucket' changed build result to
    UNSTABLE Finished: UNSTABLE</p>
  </blockquote>