hashicorp / packer

Packer is a tool for creating identical machine images for multiple platforms from a single source configuration.
http://www.packer.io
Other
15.12k stars 3.33k forks source link

packer exits with zero when builder not found #8472

Closed hoshsadiq closed 4 years ago

hoshsadiq commented 4 years ago

Overview of the Issue

I'm just writing some github actions, and running a packer build command where I had forgot to install the plugin (in this case the arm-image) before running it. Packer complains that the builder wasn't found but still returns with a zero exit-code. This is misleading and can potentially lead to an individual spending unnecessary time to investigate.

Reproduction Steps

Run any packer build using the arm-image builder (linked above).

Packer version

1.4.5

Simplified Packer Buildfile

{
  "builders": [
    {
      "type": "arm-image",
      "iso_url": "https://downloads.raspberrypi.org/raspbian_lite/images/raspbian_lite-2017-12-01/2017-11-29-raspbian-stretch-lite.zip",
      "iso_checksum_type": "sha256",
      "iso_checksum": "e942b70072f2e83c446b9de6f202eb8f9692c06e7d92c343361340cc016e0c9f"
    }
  ],
  "provisioners": [
    {
      "type": "shell",
      "inline": [
        "cat /etc/os-release"
      ]
    }
  ]
}

Operating system and Environment details

N/A

Log Fragments and crash.log files

# PACKER_LOG=1 packer build raspbian_golang.json
2019/12/09 14:19:48 [INFO] Packer version: 1.3.5
2019/12/09 14:19:48 Packer Target OS/Arch: linux amd64
2019/12/09 14:19:48 Built with Go Version: go1.12
2019/12/09 14:19:48 Detected home directory from env var: /home/vagrant
2019/12/09 14:19:48 Using internal plugin for lxc
2019/12/09 14:19:48 Using internal plugin for ncloud
2019/12/09 14:19:48 Using internal plugin for triton
2019/12/09 14:19:48 Using internal plugin for alicloud-ecs
2019/12/09 14:19:48 Using internal plugin for amazon-ebssurrogate
2019/12/09 14:19:48 Using internal plugin for docker
2019/12/09 14:19:48 Using internal plugin for hyperone
2019/12/09 14:19:48 Using internal plugin for hyperv-vmcx
2019/12/09 14:19:48 Using internal plugin for parallels-iso
2019/12/09 14:19:48 Using internal plugin for qemu
2019/12/09 14:19:48 Using internal plugin for virtualbox-ovf
2019/12/09 14:19:48 Using internal plugin for vmware-vmx
2019/12/09 14:19:48 Using internal plugin for amazon-instance
2019/12/09 14:19:48 Using internal plugin for googlecompute
2019/12/09 14:19:48 Using internal plugin for lxd
2019/12/09 14:19:48 Using internal plugin for openstack
2019/12/09 14:19:48 Using internal plugin for virtualbox-iso
2019/12/09 14:19:48 Using internal plugin for oracle-classic
2019/12/09 14:19:48 Using internal plugin for profitbricks
2019/12/09 14:19:48 Using internal plugin for amazon-chroot
2019/12/09 14:19:48 Using internal plugin for digitalocean
2019/12/09 14:19:48 Using internal plugin for file
2019/12/09 14:19:48 Using internal plugin for hcloud
2019/12/09 14:19:48 Using internal plugin for null
2019/12/09 14:19:48 Using internal plugin for hyperv-iso
2019/12/09 14:19:48 Using internal plugin for oracle-oci
2019/12/09 14:19:48 Using internal plugin for amazon-ebsvolume
2019/12/09 14:19:48 Using internal plugin for oneandone
2019/12/09 14:19:48 Using internal plugin for tencentcloud-cvm
2019/12/09 14:19:48 Using internal plugin for cloudstack
2019/12/09 14:19:48 Using internal plugin for vagrant
2019/12/09 14:19:48 Using internal plugin for amazon-ebs
2019/12/09 14:19:48 Using internal plugin for azure-arm
2019/12/09 14:19:48 Using internal plugin for parallels-pvm
2019/12/09 14:19:48 Using internal plugin for scaleway
2019/12/09 14:19:48 Using internal plugin for vmware-iso
2019/12/09 14:19:48 Using internal plugin for chef-client
2019/12/09 14:19:48 Using internal plugin for converge
2019/12/09 14:19:48 Using internal plugin for file
2019/12/09 14:19:48 Using internal plugin for puppet-server
2019/12/09 14:19:48 Using internal plugin for shell-local
2019/12/09 14:19:48 Using internal plugin for chef-solo
2019/12/09 14:19:48 Using internal plugin for windows-shell
2019/12/09 14:19:48 Using internal plugin for puppet-masterless
2019/12/09 14:19:48 Using internal plugin for ansible-local
2019/12/09 14:19:48 Using internal plugin for breakpoint
2019/12/09 14:19:48 Using internal plugin for inspec
2019/12/09 14:19:48 Using internal plugin for powershell
2019/12/09 14:19:48 Using internal plugin for salt-masterless
2019/12/09 14:19:48 Using internal plugin for shell
2019/12/09 14:19:48 Using internal plugin for windows-restart
2019/12/09 14:19:48 Using internal plugin for ansible
2019/12/09 14:19:48 Using internal plugin for vagrant
2019/12/09 14:19:48 Using internal plugin for alicloud-import
2019/12/09 14:19:48 Using internal plugin for docker-import
2019/12/09 14:19:48 Using internal plugin for docker-push
2019/12/09 14:19:48 Using internal plugin for docker-save
2019/12/09 14:19:48 Using internal plugin for googlecompute-import
2019/12/09 14:19:48 Using internal plugin for vsphere-template
2019/12/09 14:19:48 Using internal plugin for amazon-import
2019/12/09 14:19:48 Using internal plugin for checksum
2019/12/09 14:19:48 Using internal plugin for digitalocean-import
2019/12/09 14:19:48 Using internal plugin for docker-tag
2019/12/09 14:19:48 Using internal plugin for vsphere
2019/12/09 14:19:48 Using internal plugin for artifice
2019/12/09 14:19:48 Using internal plugin for googlecompute-export
2019/12/09 14:19:48 Using internal plugin for shell-local
2019/12/09 14:19:48 Using internal plugin for vagrant-cloud
2019/12/09 14:19:48 Using internal plugin for compress
2019/12/09 14:19:48 Using internal plugin for manifest
2019/12/09 14:19:48 Detected home directory from env var: /home/vagrant
2019/12/09 14:19:48 Attempting to open config file: /home/vagrant/.packerconfig
2019/12/09 14:19:48 [WARN] Config file doesn't exist: /home/vagrant/.packerconfig
2019/12/09 14:19:48 Packer config: &{DisableCheckpoint:false DisableCheckpointSignature:false PluginMinPort:10000 PluginMaxPort:25000 Builders:map[alicloud-ecs:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-alicloud-ecs amazon-chroot:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-amazon-chroot amazon-ebs:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-amazon-ebs amazon-ebssurrogate:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-amazon-ebssurrogate amazon-ebsvolume:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-amazon-ebsvolume amazon-instance:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-amazon-instance azure-arm:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-azure-arm cloudstack:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-cloudstack digitalocean:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-digitalocean docker:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-docker file:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-file googlecompute:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-googlecompute hcloud:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-hcloud hyperone:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-hyperone hyperv-iso:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-hyperv-iso hyperv-vmcx:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-hyperv-vmcx lxc:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-lxc lxd:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-lxd ncloud:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-ncloud null:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-null oneandone:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-oneandone openstack:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-openstack oracle-classic:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-oracle-classic oracle-oci:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-oracle-oci parallels-iso:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-parallels-iso parallels-pvm:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-parallels-pvm profitbricks:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-profitbricks qemu:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-qemu scaleway:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-scaleway tencentcloud-cvm:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-tencentcloud-cvm triton:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-triton vagrant:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-vagrant virtualbox-iso:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-virtualbox-iso virtualbox-ovf:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-virtualbox-ovf vmware-iso:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-vmware-iso vmware-vmx:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-vmware-vmx] PostProcessors:map[alicloud-import:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-alicloud-import amazon-import:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-amazon-import artifice:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-artifice checksum:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-checksum compress:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-compress digitalocean-import:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-digitalocean-import docker-import:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-docker-import docker-push:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-docker-push docker-save:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-docker-save docker-tag:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-docker-tag googlecompute-export:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-googlecompute-export googlecompute-import:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-googlecompute-import manifest:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-manifest shell-local:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-shell-local vagrant:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-vagrant vagrant-cloud:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-vagrant-cloud vsphere:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-vsphere vsphere-template:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-vsphere-template] Provisioners:map[ansible:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-ansible ansible-local:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-ansible-local breakpoint:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-breakpoint chef-client:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-chef-client chef-solo:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-chef-solo converge:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-converge file:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-file inspec:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-inspec powershell:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-powershell puppet-masterless:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-puppet-masterless puppet-server:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-puppet-server salt-masterless:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-salt-masterless shell:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-shell shell-local:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-shell-local windows-restart:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-windows-restart windows-shell:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-windows-shell]}
2019/12/09 14:19:48 Detected home directory from env var: /home/vagrant
2019/12/09 14:19:48 Setting cache directory: /tmp/packer_cache
2019/12/09 14:19:48 Detected home directory from env var: /home/vagrant
2019/12/09 14:19:48 Loading builder: arm-image
Failed to initialize build 'arm-image': builder type not found: arm-image
arm-image output will be in this color.
2019/12/09 14:19:48 Builder not found: arm-image
2019/12/09 14:19:48 ui error: Failed to initialize build 'arm-image': builder type not found: arm-image
2019/12/09 14:19:48 Build debug mode: false
2019/12/09 14:19:48 Force build: false
2019/12/09 14:19:48 On error:

2019/12/09 14:19:48 Waiting on builds to complete...
2019/12/09 14:19:48 Builds completed. Waiting on interrupt barrier...

==> Builds finished but no artifacts were created.
==> Builds finished but no artifacts were created.
2019/12/09 14:19:48 [INFO] (telemetry) Finalizing.
2019/12/09 14:19:49 waiting for all plugin processes to complete...
# echo $?
0
SwampDragons commented 4 years ago

Thanks for reaching out! We've fixed this in #8575, and it'll go out with the 1.5.0 release in a few weeks.

hoshsadiq commented 4 years ago

Merci

ghost commented 4 years ago

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.