4

We are using AWS Elastic Beanstalk and eb cli for deployment.

One problem we stumbled upon is not being able to rewrite commits.

When trying to deploy with eb deploy after runnig git commit --amend , we get the following error:

ERROR: InvalidParameterValueError - "Error making request to CodeCommit: Could not retrieve 0fb2ddf61003f05e67aeabe... (Service: AWSCodeCommit; Status Code: 400; Error Code: CommitIdDoesNotExistException; Request ID: bee56acc-201b-4a3f-...-...)"

How can we overcome that and deploy after running git commit --amend ?

SOLUTION:

eb codesource local, to disable CodeCommit integration.

Apparently CodeCommit was strangely partially integrated. It was performing some sort of tracking - thus the error, but when running eb use --source codecommit/myrepo/mybranch it was failing:

ERROR: NotFoundError - CodeCommit branch not found:

Anyone who can shed some more light on the subject would be welcome.

Gapi
  • 67
  • 5

2 Answers2

3

Reading "Configuring additional branches and environments ", and considering any amend will rewrite the history (at least change the HEAD commit), you might noeed to:

  • force push
  • re-specify the branch source to use for eb environment

That is:

git push --force
eb use --source my-app/myBranch <eb-environment>

The OP Gapi reports actually having to desactivate codecommit:

eb codesource local
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Thank you, I tried that and got: ERROR: InvalidOptionsError - Source location "repo..." is not supported by the EBCLI – Gapi Oct 15 '20 at 11:29
  • 1
    @Gapi I don't know the syntax well enough, but check the official documentation: https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb3-use.html. I might have missed a `codecommit/` in there. – VonC Oct 15 '20 at 12:05
  • Thanks, it was still failing - not finding the branch. For now I had "sovled" it by disabling CodeCommit integration (see my edited question). – Gapi Oct 15 '20 at 13:23
  • @Gapi OK. I have updated the answer and will check if I find anything explaining why such a step is necessary – VonC Oct 15 '20 at 13:24
0

In your terminal use

eb codesource local
eb create <env name>
Arpit
  • 31
  • 6