beanstalk-deploy: Deployment failed due to 400 / empty message

See: https://github.com/jadekler/php-aws/runs/707781910

Uploading file to bucket elasticbeanstalk-af-south-1-597857118726
##[error]Deployment failed: Error: Status: 400. Message:

Any idea what gives?

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 1
  • Comments: 24

Most upvoted comments

Just merged this old pull request in so now region-specific buckets are used. Try using v17 and see if it works for you 😃

@Niko-Kk Guess I’ll have to make an app in south africa region and see 🙂

I was having the same issue. Without looking the open pull requests, I came to the same code edits as this PR (https://github.com/einaregilsson/beanstalk-deploy/pull/47), and it now works. I’ll be running of my forked version for now, but this solved the issue for me.

My region is also af-south-1 so it might be a regional problem if no others are experiencing it.

@einaregilsson Awesome thank you very much! Can confirm v17 it is working!

@Niko-Kk you are correct I also came to the same code edits as PR (#47).

I guess the reason no error message is printed is that checking if the file already exists in the bucket is a HEAD request. If I skip this check and try upload it gives the following message:

IllegalLocationConstraintException The af-south-1 location constraint is incompatible for the region specific endpoint this request was sent to.

I got a similar error while setting up Amazon CloudFront to point to a bucket in af-south-1. The solution there was also to add the region in the host i.e. BUCKET_NAME.s3.REGION.amazonaws.com.

@einaregilsson to solve this issue you can merge PR (#47) or I could make another PR that allows you to optionally specify a region for the bucket domain?

For now, I will be using @Niko-Kk’s fork which is working for me…

Hey @craig95 ! I used @hmanzur/actions-aws-eb workflow.

- name: Deploy to Beanstalk
  uses: hmanzur/actions-aws-eb@v1.0.0
  with:
     command: 'deploy ${{ secrets.EB_ENV_NAME }} --label v${{ steps.version_extractor.outputs.ARTIFACT_VERSION }}'
   env:
      AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
      AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
      AWS_DEFAULT_REGION: "af-south-1"

I got the same Error: Deployment failed: Error: Status: 400. Message: when trying to do a deployment to af-south-1. The error disappears entirely when deploying to another region e.g us-east-2.

What? I am encountering a lot of weirdness with the South African region.