Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Unhandled case where call to AWS RunInstances returns empty list of reservations and no error results in panic #4746

@elliotrushton

Description

@elliotrushton

In some rare cases calls to RunInstances returns an empty struct and no error https://github.com/docker/machine/blob/a555e4f7a8f518a8b1b174824c377e46cbfc4fe2/drivers/amazonec2/amazonec2.go#L723. In this case the later call that indexes into the result https://github.com/docker/machine/blob/a555e4f7a8f518a8b1b174824c377e46cbfc4fe2/drivers/amazonec2/amazonec2.go#L745 causes docker-machine to panic with
Error creating machine: Error in driver during machine creation: Panic in the driver: runtime error: index out of range

Deploy Kit handles this case by raising an error about an unexpected result from the AWS SDK https://github.com/docker/deploykit/blob/master/pkg/provider/aws/plugin/instance/ec2_instance.go#L272

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions