Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

min_size = 1 results in errors when autoscaler attempts to remove the last instance #85

Open
lorengordon opened this issue Mar 14, 2024 · 0 comments

Comments

@lorengordon
Copy link
Contributor

lorengordon commented Mar 14, 2024

Using the autoscaler feature with min_size = 1, and seeing these errors in the lambda log when the autoscaler attempts to replace the last instance in the ASG.

{
    "time": "2024-03-14T14:24:05.448962118Z",
    "level": "WARN",
    "msg": "instance has no corresponding worker in Spacelift, removing from the ASG",
    "aws_request_id": "redacted",
    "asg_arn": "arn:aws:autoscaling:us-east-1:redacted:autoScalingGroup:redacted:autoScalingGroupName/redacted",
    "worker_pool_id": "redacted",
    "instance_id": "i-redacted",
    "launch_timestamp": 1710424905,
    "instance_age": 1340448951615
}

followed by:

{
    "errorMessage": "could not kill instance: could not detach instance from autoscaling group: operation error Auto Scaling: DetachInstances, https response error StatusCode: 400, RequestID: redacted, api error ValidationError: AutoScalingGroup redacted has min-size=1, max-size=50, and desired-size=1. To detach 1 instance, please update the AutoScalingGroup sizes appropriately.",
    "errorType": "wrapError"
}

The solution for this is for the min_size on the ASG to be set to 0, and for the desired_capacity to be set to 1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant