Skip to content

Packer 1.2.5 fails for AWS with 'ResourceNotReady: exceeded wait attempts' #6569

@kmacoskey

Description

@kmacoskey

I am shameless copying this issue but updating slightly: #5792

It may be related to #6526

I have a CentOS Packer build on AWS which works with version 1.1.2 but fails with version 1.2.5

The template used to build the image:

{
  "variables": {
    "packer_script_path": "",
    "force_deregister": "",
    "image_name": "",
    "aws_secret_key_id": "{{env `AWS_SECRET_KEY_ID`}}",
    "aws_secret_key": "{{env `AWS_SECRET_ACCESS_KEY`}}",
    "source_ami": "ami-476e4c22",
    "ami_regions": "us-west-2",
    "ssh_username": "{{env `DEFAULT_PLATFORM_USER`}}"
  },
  "builders": [
    {
      "name": "aws",
      "type": "amazon-ebs",
      "region": "us-east-2",
      "source_ami": "{{user `source_ami`}}",
      "instance_type": "t2.medium",
      "ssh_username": "{{user `ssh_username`}}",
      "ssh_pty": "true",
      "run_tags": {
        "Source": "Packer",
      },
      "tags": {
        "Source": "Packer",
      },
      "ami_name": "{{user `image_name`}}",
      "ami_description": "{{user `image_name`}}",
      "force_deregister": "{{user `force_deregister`}}",
      "ami_regions": "{{user `ami_regions`}}",
      "shutdown_behavior": "terminate"
    }
  ],
  "provisioners": [
    {
      "type": "shell",
      "execute_command": "{{ .Vars }} sudo -E -S sh '{{ .Path }}'",
      "scripts": [
        "{{user `packer_script_path`}}/install-packages.sh"
      ]
    },
    {
      "type": "shell",
      "execute_command": "{{ .Vars }} sudo -E -S sh '{{ .Path }}'",
      "scripts": [
        "{{user `packer_script_path`}}/configure-os.sh"
      ]
    },
    {
      "type": "shell",
      "execute_command": "{{ .Vars }} sudo -E -S sh '{{ .Path }}'",
      "scripts": [
        "{{user `packer_script_path`}}/set-kernel.sh"
      ]
    }
  ],
  "post-processors": [
    {
      "type": "manifest",
      "output": "image-metadata/aws-{{user `file_name`}}.json",
      "strip_path": true
    }
  ]
}

As you can see, I am not doing anything complicated.

When the build fails using version 1.2.5, it times out with the following error. This happens 75% of the time:

==> aws: 1 error(s) occurred:
==> aws: 
==> aws: * Error waiting for AMI (ami-192c0861) in region (us-west-2): ResourceNotReady: exceeded wait attempts
  • Packer version from packer version
    1.2.5

  • Host platform
    Alpine Linux 3.8.0

I am using this image from dockerhub, https://hub.docker.com/r/hashicorp/packer/, with a tag of light.

If I run the above template using v 1.1.2, it works fine.

Regard,
Kris

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions