beanstalk-deploy
beanstalk-deploy copied to clipboard
Deployment failed: Error: Status: 400. Code: InvalidParameterValue, Message: No Application Version named '886765199' found.
Everything I try results in an error, it seems impossible to use. This is my config:
steps:
- name: checkout
uses: actions/checkout@v2
- name: Generate deployment package
run: zip -r deploy.zip docker-compose.yml Dockerrun.aws.json
- name: Deploy to Elastic Beanstalk
uses: einaregilsson/beanstalk-deploy@v17
with:
aws_access_key: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
application_name: archimedes
environment_name: dev-archimedes
region: eu-west-1
version_label: ${{github.run_id}}
version_description: none
deployment_package: deploy.zip
ERROR: Deployment failed: Error: Status: 400. Code: InvalidParameterValue, Message: No Application Version named '886765199' found.
Using existing version
steps:
- name: checkout
uses: actions/checkout@v2
- name: Generate deployment package
run: zip -r deploy.zip docker-compose.yml Dockerrun.aws.json
- name: Deploy to Elastic Beanstalk
uses: einaregilsson/beanstalk-deploy@v17
with:
aws_access_key: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
application_name: archimedes
environment_name: dev-archimedes
region: eu-west-1
version_label: Sample Application
version_description: none
deployment_package: deploy.zip
ERROR: Deployment failed: Version Sample Application already exists. Either remove the "deployment_package" parameter to deploy existing version, or set the "use_existing_version_if_available" parameter to "true" to use existing version if it exists and deployment package if it doesn't.
With use_existing_version_if_available: true
steps:
- name: checkout
uses: actions/checkout@v2
- name: Generate deployment package
run: zip -r deploy.zip docker-compose.yml Dockerrun.aws.json
- name: Deploy to Elastic Beanstalk
uses: einaregilsson/beanstalk-deploy@v17
with:
aws_access_key: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
application_name: archimedes
environment_name: dev-archimedes
region: eu-west-1
version_label: "Sample Application"
version_description: none
deployment_package: deploy.zip
use_existing_version_if_available: true
ERROR: Error: Deployment failed: TypeError: Cannot read property 'VersionLabel' of undefined
Hmm, the first one should work, although I would probably use ${{github.run_number}}
rather than .run_id
. Try it with run_number and see if it works. And you can always look at Elastic Beanstalk and see exactly which application versions have already been created.
@stephanoparaskeva double check that your application_name name is correct. I just created a new one and didn't realize the application name changed. I was getting the same error, because it was publishing my application versions to the wrong one.
I was using the wrong AWS region...if anyone else ever has this issue...
I have the same behaviour as the 3rd one with following config:
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Generate deployment package
run: zip -r -j deploy.zip ./dev/* -x '*.git*'
- name: Deploy to EB
uses: einaregilsson/beanstalk-deploy@v18
with:
aws_access_key: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
application_name: dev
environment_name: dev-env
version_label: ${{ github.run_number }}
existing_bucket_name: elasticbeanstalk-eu-west-1-xxxxxxxx
region: eu-west-1
deployment_package: deploy.zip
use_existing_version_if_available: true
I first created a EBS environment, which already created a bucket for me so I used that bucket for the deploys.
It deploys succesfully, health is OK on EBS, but the pipeline fails with ERROR: Error: Deployment failed: TypeError: Cannot read property 'VersionLabel' of undefined
Anyone see what I'm missing here?
@jclaessens97 The only place where there's a .VersionLabel is on the environment. In the line ``` let env = result.data.DescribeEnvironmentsResponse.DescribeEnvironmentsResult.Environments[0]; if (env.VersionLabel === versionLabel && env.Status === 'Ready') {
Sounds like there's some weirdness in the response for DescribeEnvironments after the deployment. Does this happen every time?
Does this happen every time?
@einaregilsson, yeah it seems like it happens everytime. This is the output I get on failure:
Run einaregilsson/beanstalk-deploy@v18
Beanstalk-Deploy: GitHub Action for deploying to Elastic Beanstalk.
https://github.com/einaregilsson/beanstalk-deploy
***** Input parameters were: *****
Application: dev
Environment: dev-env
Version Label: 17
Version description:
AWS Region: eu-west-1
File: deploy.zip
Existing bucket Name: elasticbeanstalk-eu-west-1-xxxxxx
AWS Access Key: 20 characters long, starts with A
AWS Secret Key: 40 characters long, starts with Y
Wait for deployment: true
Recovery wait time: 30
Uploading file to bucket elasticbeanstalk-eu-west-1-xxxxxx
New build successfully uploaded to S3, bucket=elasticbeanstalk-eu-west-1-xxxxxx, key=/dev/17.zip
Created new application version 17 in Beanstalk.
Starting deployment of version 17 to environment dev-env
Deployment started, "wait_for_deployment" was true...
Error: Deployment failed: TypeError: Cannot read property 'VersionLabel' of undefined
At first I thought the Deployment failed (as the error says 😅 ) but when I looked at AWS all the versions were deployed succesfully despite the error.
@einaregilsson if you can give me some pointers on how to debug/test the pipeline from code I'm willing to see if I can find the issue?
I just pushed a small logging change to a new branch called testversion, basically just this:
let env = result.data.DescribeEnvironmentsResponse.DescribeEnvironmentsResult.Environments[0];
console.log('********************+');
console.log('RESULT FROM DESCRIBEENVIRONMENTS CALL: ');
console.log(JSON.stringify(result.data, null, 2));
console.log('********************+');
Try changing your workflow to use:
uses: einaregilsson/beanstalk-deploy@testversion
and see what it logs during the deployment.
An easy way to test is also to just run the action as a command line script, it supports that, you could check if it works that way.
The response looks pretty empty to me:
********************+
RESULT FROM DESCRIBEENVIRONMENTS CALL:
{
"DescribeEnvironmentsResponse": {
"DescribeEnvironmentsResult": {
"Environments": [],
"NextToken": null
},
"ResponseMetadata": {
"RequestId": "256773ac-22b0-4449-83b0-c71197d9d02a"
}
}
}
********************+
Ok, and this is the first call? There are no other calls where there's any data?
This is the only log I get, so I suppose it's indeed the first one.
Ok, any chance the application name is wrong? I really don't understand why it wouldn't show anything if both the application name and environment name are correct. Very weird!
Yes, I carefully copied the application_name & environment_name from AWS & triple checked the region. I think that the proof is that I'm able to deploy new versions from the action, it's just always fails because of that error.
Maybe I'm missing some permissions from my IAM github user?
It's possible I guess, but I'd expect an error in that case. Sorry, I just have no idea why it's not working.
@einaregilsson small update, instead of the following 3 inline policies (see image), I now assiged EBSAdministrator policy to my IAM github user and now it works perfectly :)
So it was indeed a permissions problem as I suspected, although it's weird it just doesn't throw a permission exception.
EDIT:
@jclaessens97 Ok, thanks for reporting back! And yes, very weird that it doesn't just throw an error but gives you an empty response, that's just guaranteed to get users to spend lots of time trying to figure out what's wrong!
@jclaessens97 Ok, thanks for reporting back! And yes, very weird that it doesn't just throw an error but gives you an empty response, that's just guaranteed to get users to spend lots of time trying to figure out what's wrong!
Hi @einaregilsson, I'm using the v21 with admin privileges and still getting the error. Please see https://github.com/oldbonez/docker-react-nevergiveup/actions/runs/4186639519/jobs/7255704349 when time allows and advise.
Flipping application_name
and environment_name
worked for me. These could just be confusing as to what to put where so might be good to try that out @oldbonez
Broken workflow - https://github.com/coral-xyz/backpack/actions/runs/4266915453/jobs/7427975203 PR that fixed it - https://github.com/coral-xyz/backpack/pull/2986 Fixed workflow - https://github.com/coral-xyz/backpack/actions/runs/4271220254/jobs/7435539225
I was using the wrong AWS region...if anyone else ever has this issue...
I was using eu-central-1 instead of us-east-1
Deployment failed: TypeError: Cannot read properties of undefined (reading 'VersionLabel') @einaregilsson
I can't get past this error, What is your suggestion or is there a version that solves this problem?
Deployment failed: TypeError: Cannot read properties of undefined (reading 'VersionLabel') @einaregilsson
I can't get past this error, What is your suggestion or is there a version that solves this problem?
I also experienced the same issue, but I resolved it by adding the AWSElasticBeanstalkReadOnly permission to the account executing the GitHub Actions. I hope this helps. @muzeyr