We have a single on-demand instance of a staging version of a Node app hosted on AWS Beanstalk.
Around 430am EST on a Friday (where there would be very little load,traffic)
the environment had the following event "Environment health has transitioned from Ok to No Data. None of the instances are sending data.
"
This was then succeeded by "Added instance [i-SOME_ID] to your environment.
"
and then "Removed instance [i-ANOTHER_ID] from your environment.
"
and then "Environment health has transitioned from No Data to Severe. Command is executing on all instances.
"
and finally, "Environment health has transitioned from Severe to Ok.
"
There were no recent updates to the app's code itself and I have managed updates disabled. I don't see anything else in the logs that would indicate a random crash.
How can I deduce what happened here? Also, is there a way to have EB not replace instances automatically like this? Every time an instance is replaced, we need to change settings on our end because the EIP is updates (CNAME, etc..)
Edit: I pulled the 'full logs', but the issue is that the logs only show everything after the instance got rebuilt (and not before whatever caused the 'Environment health has transitioned from Ok to No Data. None of the instances are sending data.')
Below is my YAML conf
ApplicationName: 'MY_APP_NAME'
DateUpdated: 2021-10-15 15:23:16+00:00
EnvironmentName: MY_ENV_NAME-env
PlatformArn: arn:aws:elasticbeanstalk:us-east-2::platform/Node.js running on 64bit
Amazon Linux/4.17.6
settings:
aws:autoscaling:asg:
Availability Zones: Any
Cooldown: '360'
Custom Availability Zones: ''
EnableCapacityRebalancing: 'false'
MaxSize: '1'
MinSize: '1'
aws:autoscaling:launchconfiguration:
BlockDeviceMappings: null
EC2KeyName: MY_KEY_NAME
IamInstanceProfile: aws-elasticbeanstalk-ec2-role
ImageId: ami-MY_AMI_ID
InstanceType: t2.micro
MonitoringInterval: 5 minute
RootVolumeIOPS: null
RootVolumeSize: null
RootVolumeThroughput: null
RootVolumeType: null
SSHSourceRestriction: tcp,22,22,0.0.0.0/0
SecurityGroups: MY_SGs
aws:autoscaling:updatepolicy:rollingupdate:
MaxBatchSize: null
MinInstancesInService: null
PauseTime: null
RollingUpdateEnabled: 'false'
RollingUpdateType: Time
Timeout: PT30M
aws:ec2:instances:
EnableSpot: 'false'
InstanceTypes: t2.micro, t2.small
SpotFleetOnDemandAboveBasePercentage: '0'
SpotFleetOnDemandBase: '0'
SpotMaxPrice: null
aws:ec2:vpc:
AssociatePublicIpAddress: 'false'
ELBScheme: public
ELBSubnets: subnet-MY_SUBNET_ID
Subnets: subnet-MY_SUBNET_ID
VPCId: vpc-MY_VPC_ID
aws:elasticbeanstalk:application:
Application Healthcheck URL: ''
aws:elasticbeanstalk:cloudwatch:logs:
DeleteOnTerminate: 'true'
RetentionInDays: '7'
StreamLogs: 'true'
aws:elasticbeanstalk:cloudwatch:logs:health:
DeleteOnTerminate: 'false'
HealthStreamingEnabled: 'false'
RetentionInDays: '7'
aws:elasticbeanstalk:command:
BatchSize: '100'
BatchSizeType: Percentage
DeploymentPolicy: AllAtOnce
IgnoreHealthCheck: 'false'
Timeout: '600'
aws:elasticbeanstalk:container:nodejs:
GzipCompression: 'true'
NodeCommand: null
NodeVersion: 12.22.1
ProxyServer: none
aws:elasticbeanstalk:control:
DefaultSSHPort: '22'
LaunchTimeout: '0'
LaunchType: Migration
RollbackLaunchOnFailure: 'false'
aws:elasticbeanstalk:environment:
EnvironmentType: SingleInstance
ExternalExtensionsS3Bucket: null
ExternalExtensionsS3Key: null
ServiceRole: arn:aws:iam::MY_IAM_ID:role/aws-elasticbeanstalk-service-role
aws:elasticbeanstalk:healthreporting:system:
ConfigDocument: '{"Version":1,"CloudWatchMetrics":{"Instance":{"RootFilesystemUtil":null,"CPUIrq":null,"LoadAverage5min":null,"ApplicationRequests5xx":null,"ApplicationRequests4xx":null,"CPUUser":null,"LoadAverage1min":null,"ApplicationLatencyP50":null,"CPUIdle":null,"InstanceHealth":null,"ApplicationLatencyP95":null,"ApplicationLatencyP85":null,"ApplicationLatencyP90":null,"CPUSystem":null,"ApplicationLatencyP75":null,"CPUSoftirq":null,"ApplicationLatencyP10":null,"ApplicationLatencyP99":null,"ApplicationRequestsTotal":null,"ApplicationLatencyP99.9":null,"ApplicationRequests3xx":null,"ApplicationRequests2xx":null,"CPUIowait":null,"CPUNice":null},"Environment":{"InstancesSevere":null,"InstancesDegraded":null,"ApplicationRequests5xx":null,"ApplicationRequests4xx":null,"ApplicationLatencyP50":null,"ApplicationLatencyP95":null,"ApplicationLatencyP85":null,"InstancesUnknown":null,"ApplicationLatencyP90":null,"InstancesInfo":null,"InstancesPending":null,"ApplicationLatencyP75":null,"ApplicationLatencyP10":null,"ApplicationLatencyP99":null,"ApplicationRequestsTotal":null,"InstancesNoData":null,"ApplicationLatencyP99.9":null,"ApplicationRequests3xx":null,"ApplicationRequests2xx":null,"InstancesOk":null,"InstancesWarning":null}},"Rules":{"Environment":{"ELB":{"ELBRequests4xx":{"Enabled":true}},"Application":{"ApplicationRequests4xx":{"Enabled":true}}}}}'
EnhancedHealthAuthEnabled: 'false'
HealthCheckSuccessThreshold: Ok
SystemType: enhanced
aws:elasticbeanstalk:hostmanager:
LogPublicationControl: 'false'
aws:elasticbeanstalk:managedactions:
ManagedActionsEnabled: 'false'
PreferredStartTime: Mon:04:00
aws:elasticbeanstalk:managedactions:platformupdate:
InstanceRefreshEnabled: 'false'
UpdateLevel: minor
aws:elasticbeanstalk:monitoring:
Automatically Terminate Unhealthy Instances: 'true'
aws:elasticbeanstalk:sns:topics:
Notification Endpoint: MY_EMAIL
Notification Protocol: email
Notification Topic ARN: arn:aws:sns:us-east-2:MY_ARN_ID:ElasticBeanstalkNotifications-Environment-22-env
Notification Topic Name: null
aws:elasticbeanstalk:xray:
XRayEnabled: 'false'
aws:rds:dbinstance:
HasCoupledDatabase: 'false'