AWS Elastic Beanstalk won't deploy my Rails app even once

Viewed 861

I'm currently using the "Ruby 2.6 running on 64bit Amazon Linux 2/3.0.2" image, and by looking, inside the EC2 instance at the /var/logs/eb-engine.log ("eb logs" command won't show me this), there is a recurring error:

[ERROR] failed to parse JSON file /opt/elasticbeanstalk/deployment/app_version_manifest.json with error: json: cannot unmarshal string into Go struct field AppVersionManifest.Serial of type uint64

When I check that file, I do not know what is wrong with it, or what is preventing that file from being parsed, if that is actually the problem:

{ "RuntimeSources":{"my_api":{"my_api-source_alfa0.2":"s3url":""}}},"DeploymentId":9,"Serial":"23","VersionLabel":"my_api-source_alfa0.2"}

The serial "23" seems pretty parsable to me. Please help!

1 Answers

What causes this

I believe this is a bug.

In some cases, this can occur if you try to terminate or rebuild your Elastic Beanstalk environment and the operation fails to delete your AWSEBSecurityGroup.

There are reports (see comments) of other causes besides this.

How to fix it

The AWS document How do I terminate or rebuild my AWS Elastic Beanstalk environment when the AWSEBSecurityGroup fails to delete? describes how to resolve this, but I excerpted the main steps below, in case that link ever breaks:

  1. Open the AWS CloudFormation console.
  2. From the Stack Name column, choose the stack that failed to delete.

    Note: The Status column of your stack shows DELETE_FAILED.

  3. From the Actions menu, choose Delete Stack.
  4. In the Delete Stack pop-up window, choose AWSEBSecurityGroup, and then choose Yes, Delete.
  5. Terminate or rebuild the Elastic Beanstalk environment.

The linked docs have other steps if you prefer the CLI or have a more complex setup.

Then what?

After you've deleted the group and rebuilt your environment, you won't get the app_version_manifest.json error any more. Deploy your app.

Once it's done, if you SSH in and run…

cat /opt/elasticbeanstalk/deployment/app_version_manifest.json

…you'll notice that Serial is now correctly represented as a JSON number.

Related