问题
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:
What causes this
This can occur if you try to terminate or rebuild your Elastic Beanstalk environment and the operation fails to delete your AWSEBSecurityGroup
.
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:
- Open the AWS CloudFormation console.
- From the Stack Name column, choose the stack that failed to delete. > Note: The Status column of your stack shows DELETE_FAILED.
- From the Actions menu, choose Delete Stack.
- In the Delete Stack pop-up window, choose AWSEBSecurityGroup, and then choose Yes, Delete.
- 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.
来源:https://stackoverflow.com/questions/62184145/aws-elastic-beanstalk-wont-deploy-my-rails-app-even-once