Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-18839

S3 plugin fails to upload to EU region (wrong endpoint)

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Uploading to a EU bucket fails using the new version of S3 plugin (v0.4) with the error:

      ERROR: Failed to upload files
      java.io.IOException: put Destination [bucketName=xxxxxxxxxxxx, objectName=xxxxxxxxxxxx]: Status Code: 301, AWS Service: Amazon S3, AWS Request ID: B731FD3EB3E36D68, AWS Error Code: PermanentRedirect, AWS Error Message: The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint., S3 Extended Request ID: 1ayMHpR5YBq9DtqzPnBq5NdFR0Jn6kRbeaqrUPD4Ur+oUcL2vQlCiGbJSxjr9KXi
      at hudson.plugins.s3.S3Profile.upload(S3Profile.java:85)
      at hudson.plugins.s3.S3BucketPublisher.perform(S3BucketPublisher.java:143)
      at hudson.tasks.BuildStepMonitor$2.perform(BuildStepMonitor.java:27)
      at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804)
      at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:776)
      at hudson.model.Build$BuildExecution.post2(Build.java:183)
      at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:726)
      at hudson.model.Run.execute(Run.java:1618)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
      at hudson.model.ResourceController.execute(ResourceController.java:88)
      at hudson.model.Executor.run(Executor.java:247)
      Build step 'Publish artifacts to S3 Bucket' changed build result to UNSTABLE

      It seems that this happen when you access the wrong amazon endpoint.
      I've solved it temporarily for our setup by doing a: client.setEndpoint("s3-eu-west-1.amazonaws.com"); both places where AmazonS3Client is initialized in the S3 plugin (we only have EU buckets). There probably exist some easy way of querying for the correct endpoint for a more general solution.

        Attachments

          Activity

          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: David Beer
          Path:
          src/main/java/hudson/plugins/s3/Entry.java
          src/main/java/hudson/plugins/s3/S3BucketPublisher.java
          src/main/java/hudson/plugins/s3/S3Profile.java
          src/main/resources/hudson/plugins/s3/S3BucketPublisher/config.jelly
          http://jenkins-ci.org/commit/s3-plugin/4dfe5764629cfaaf38a542ddac41f7130de382a8
          Log:
          Added Region Support which fixes JENKINS-18839

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: David Beer Path: src/main/java/hudson/plugins/s3/Entry.java src/main/java/hudson/plugins/s3/S3BucketPublisher.java src/main/java/hudson/plugins/s3/S3Profile.java src/main/resources/hudson/plugins/s3/S3BucketPublisher/config.jelly http://jenkins-ci.org/commit/s3-plugin/4dfe5764629cfaaf38a542ddac41f7130de382a8 Log: Added Region Support which fixes JENKINS-18839
          Hide
          mikemcquaid Mike McQuaid added a comment -

          If you're upgrading this defaults to GOVCLOUD rather than US Standard/US-EAST-1 (which would be more sensible).

          Show
          mikemcquaid Mike McQuaid added a comment - If you're upgrading this defaults to GOVCLOUD rather than US Standard/US-EAST-1 (which would be more sensible).
          Hide
          jtopper Jon Topper added a comment -

          This problem is still apparent in 0.5:

          ERROR: Failed to upload files
          java.io.IOException: put Destination [bucketName=sftwilio, objectName=442033228776.xml]: AmazonS3Exception: Status Code: 301, AWS Service: Amazon S3, AWS Request ID: 8932F602DC2FD12B, AWS Error Code: PermanentRedirect, AWS Error Message: The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint., S3 Extended Request ID: xBHtsMFLnH+1oeBaOWcu75nwpEL5ANiZffS+mQYPjDWgxCuFFY1zMPL77YhOhIx7
          at hudson.plugins.s3.S3Profile.upload(S3Profile.java:90)
          at hudson.plugins.s3.S3BucketPublisher.perform(S3BucketPublisher.java:144)
          at hudson.tasks.BuildStepMonitor$2.perform(BuildStepMonitor.java:32)
          at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:781)
          at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:753)
          at hudson.model.Build$BuildExecution.post2(Build.java:183)
          at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:706)
          at hudson.model.Run.execute(Run.java:1704)
          at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
          at hudson.model.ResourceController.execute(ResourceController.java:88)
          at hudson.model.Executor.run(Executor.java:230)
          Build step 'Publish artifacts to S3 Bucket' changed build result to UNSTABLE

          This result on an attempt to push to an EU_WEST1 bucket.

          Show
          jtopper Jon Topper added a comment - This problem is still apparent in 0.5: ERROR: Failed to upload files java.io.IOException: put Destination [bucketName=sftwilio, objectName=442033228776.xml] : AmazonS3Exception: Status Code: 301, AWS Service: Amazon S3, AWS Request ID: 8932F602DC2FD12B, AWS Error Code: PermanentRedirect, AWS Error Message: The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint., S3 Extended Request ID: xBHtsMFLnH+1oeBaOWcu75nwpEL5ANiZffS+mQYPjDWgxCuFFY1zMPL77YhOhIx7 at hudson.plugins.s3.S3Profile.upload(S3Profile.java:90) at hudson.plugins.s3.S3BucketPublisher.perform(S3BucketPublisher.java:144) at hudson.tasks.BuildStepMonitor$2.perform(BuildStepMonitor.java:32) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:781) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:753) at hudson.model.Build$BuildExecution.post2(Build.java:183) at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:706) at hudson.model.Run.execute(Run.java:1704) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:230) Build step 'Publish artifacts to S3 Bucket' changed build result to UNSTABLE This result on an attempt to push to an EU_WEST1 bucket.
          Hide
          dmbeer David Beer added a comment -

          Thanks for reporting this. I have just uploaded successfully to a bucket in the EU_WEST_1 Location. Please check your bucket values as the AWS Console Default creating a bucket in the US Region. If you are still having problems please open a new JIRA with as much info as you can.

          Show
          dmbeer David Beer added a comment - Thanks for reporting this. I have just uploaded successfully to a bucket in the EU_WEST_1 Location. Please check your bucket values as the AWS Console Default creating a bucket in the US Region. If you are still having problems please open a new JIRA with as much info as you can.
          Hide
          ringerc Craig Ringer added a comment -

          This is a smidge broken - it defaults to GOVCLOUD for upgrades, and it doesn't offer any way to select the legacy no-region-selected s3 URI .

          Show
          ringerc Craig Ringer added a comment - This is a smidge broken - it defaults to GOVCLOUD for upgrades, and it doesn't offer any way to select the legacy no-region-selected s3 URI .
          Hide
          jamshid Jamshid Afshar added a comment -

          Sorry I'm confused, I don't see any "Region" configuration in the ui for this plugin.

          I see I can add S3 Profiles under Jenkins => Configure System, but no fields even under Advanced to specify a Region or Endpoint. I don't see anything about either in the code:
          https://github.com/jenkinsci/s3-plugin/blob/master/src/main/java/hudson/plugins/s3/S3Profile.java#L295

          What am I missing? I'm hoping to store Jenkins artifacts in a S3 compatible storage service.

          Show
          jamshid Jamshid Afshar added a comment - Sorry I'm confused, I don't see any "Region" configuration in the ui for this plugin. I see I can add S3 Profiles under Jenkins => Configure System, but no fields even under Advanced to specify a Region or Endpoint. I don't see anything about either in the code: https://github.com/jenkinsci/s3-plugin/blob/master/src/main/java/hudson/plugins/s3/S3Profile.java#L295 What am I missing? I'm hoping to store Jenkins artifacts in a S3 compatible storage service.

            People

            • Assignee:
              Unassigned
              Reporter:
              stiane Stian Eikeland
            • Votes:
              1 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: