I am trying to implement Bitbucket CI/CD pipeline to deploy .net core application on AWS elastic beanstalk. The .net core application getting successfully published, but when I am trying to deploy on AWS elastic beanstalk it is giving following error.
✖ Deployment failed. Environment "{my-application-environment}" is running a different version "{version-number}".
Also on AWS elastic beanstalk I am getting the following error,
During an aborted deployment, some instances may have deployed the new application version. To ensure all instances are running the same version, re-deploy the appropriate application version.
Below is my bitbucket-pipelines.yml file
image: microsoft/dotnet:3.0-sdk
pipelines:
default:
- step:
script:
- echo "Hello Bitbucket !"
- step:
name: build publish prepare and zip
caches:
- dotnetcore
script:
- apt-get update && apt-get install --yes zip
- export PROJECT_NAME=$PROJECT_NAME
- dotnet restore $PROJECT_NAME
- dotnet build $PROJECT_NAME
- dotnet publish $PROJECT_NAME --self-contained --runtime win-x64 --configuration Debug
- zip -j site.zip /opt/atlassian/pipelines/agent/build/{my-project-name}/bin/Debug/netcoreapp3.0/win-x64/publish/* -x aws-windows-deployment-manifest.json
- zip -r -j application.zip site.zip /opt/atlassian/pipelines/agent/build/{my-project-name}/bin/Debug/netcoreapp3.0/win-x64/publish/aws-windows-deployment-manifest.json
artifacts:
- application.zip
- step:
name: upload to elasticbeanstalk
script:
- pipe: atlassian/aws-elasticbeanstalk-deploy:0.5.0
variables:
APPLICATION_NAME: $APPLICATION_NAME
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION
#COMMAND: 'upload-only'
ZIP_FILE: 'application.zip'
ENVIRONMENT_NAME: $ENVIRONMENT_NAME
WAIT: 'true'
VERSION_LABEL: 'deploy-WebApi-$BITBUCKET_BUILD_NUMBER'
The variables I have already configured in pipeline settings and pipeline is also enabled.
Is there something wrong with my .yml file?
Any help on this appreciated !
Maybe it will be useful for somebody. In my case it was problem with Node version. Node version in my build was unsupported for version in EB Node platform. I've found it in eb-engine.log
An error occurred during execution of command [app-deploy] - [Install customer specified node.js version]. Stop running the command. Error: unsupported node version 12.18.4, please specify any of node versions in [v12.0.0 v12.1.0 v12.10.0 v12.11.0 v12.11.1 v12.12.0 v12.13.0 v12.13.1 v12.14.0 v12.14.1 v12.15.0 v12.16.0 v12.16.1 v12.16.2 v12.16.3 v12.17.0 v12.18.0 v12.18.1 v12.18.2 v12.18.3 v12.2.0 v12.3.0 v12.3.1 v12.4.0 v12.5.0 v12.6.0 v12.7.0 v12.8.0 v12.8.1 v12.9.0 v12.9.1]
So be careful with such things as well.
Hi @Rohit Pundlik could you run the pipe with DEBUG enabled by setting this variable to true and share the output? It seems like some or all instances fail to update the environment for some reason.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am sorry to ask this question, but can you help me how and where can I set that variable to true ?
Thanks for the help !
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hello,
just add
DEBUG: "true"
as a variable to the atlassian pipeline. Something like this:
- step:
name: upload to elasticbeanstalk
script:
- pipe: atlassian/aws-elasticbeanstalk-deploy:0.5.0
variables:
APPLICATION_NAME: $APPLICATION_NAME
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION
#COMMAND: 'upload-only'
ZIP_FILE: 'application.zip'
ENVIRONMENT_NAME: $ENVIRONMENT_NAME
WAIT: 'true'
VERSION_LABEL: 'deploy-WebApi-$BITBUCKET_BUILD_NUMBER'
DEBUG: "true"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Below is output I have share, I have changed original application name and s3, eb links
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Moises Alejandro Alvarado Claro @Alexander Zhukov
Any help on this.
There is literally no help or documentation available to achieve this.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Rohit Pundlik
normally when you get a "deployment failed" error could be because several things. Please check that the account that you're using has enough permissions(S3 access/upload/Read, etc) for all the actions that are required to perform a EB deployment. Also, in the AWS console go to your EB instance/environment and find the "events" section. There you should see everything that's going on with your EB instance/environment. That could help you to understand was going on.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.