Artiface -> amazon-import: No ova image file found

I’ve tried every seeming variation for specifying the artiface files, but can’t get past this failure. Am I doing something incorrectly, or is there a bug? Thanks, Mike

packer build -force -var-file=%HOME%.packer\secrets.json -only=‘step2.*’ vBoxISO
step2.null.direct_file: output will be in this color.

==> step2.null.direct_file: Running post-processor: (type artifice)
==> step2.null.direct_file (artifice): Using these artifact files: D:\VirtualBoxVMs\kcvi-export\KCVI_v0.0.1.ova
==> step2.null.direct_file: Running post-processor: (type amazon-import)
==> step2.null.direct_file: Running post-processor: (type manifest)
Build ‘step2.null.direct_file’ errored after 23 milliseconds 423 microseconds: 1 error(s) occurred:

  • Post-processor failed: No ova image file found in artifact from builder

dir D:\VirtualBoxVMs\kcvi-export\KCVI_v0.0.1.ova

Directory of D:\VirtualBoxVMs\kcvi-export

09/15/2020 07:01 PM 2,744,797,696 KCVI_v0.0.1.ova

The only relevant line from the debug log is: (provides no insight to me)
packer.exe plugin: {{direct_file null false false map[] []} { false false 0 it false false <nil> { } 0xc00099f9f0 <nil>} k-virtual-machines/LINUX packer-import-{{timestamp}}.ova false map[] KCVI_v0.0.1 KCVI 0.0.1 (CentOS 7.8) [] [all] false ova {map[] map[] map[] [] false direct_file null }}

Here are the post-processors.

build {
  name    = "step2"
  sources = ["source.null.direct_file"]

  post-processor "artifice" {
    files = ["${var.output_directory}\\${local.output_filename}.${local.export_format}"]
    keep_input_artifact = true
  }

  post-processor "amazon-import" {
    s3_bucket_name  = "k-virtual-machines/LINUX"
    profile         = "it"
    ami_name        = "${local.output_filename}"
    format          = "${local.export_format}"
    ami_groups      = ["all"]
    keep_input_artifact = true
  }
}

Hi! If you’re using v1.6.1 or more recent, you need to explicitly tell the post-processors to chain together. By default, HCL post-processors now follow the same mechanism as in the legacy json templates, where the post-processors run independently and concurrently unless you give them a serial definition. In HCL, the serial definition is in the form of a “post-processors” block which in your example would look like:

build {
  name    = "step2"
  sources = ["source.null.direct_file"]

  post-processors {
    post-processor "artifice" {
      files = ["${var.output_directory}\\${local.output_filename}.${local.export_format}"]
      keep_input_artifact = true
    }

    post-processor "amazon-import" {
      s3_bucket_name  = "k-virtual-machines/LINUX"
      profile         = "it"
      ami_name        = "${local.output_filename}"
      format          = "${local.export_format}"
      ami_groups      = ["all"]
      keep_input_artifact = true
    }
  }
}

Further docs on this behavior can be found here: https://www.packer.io/docs/from-1.5/blocks/build/post-processors

Hope this helps!

1 Like

Thanks so much for providing the solution to my problem!! I verified it.

Thanks also for the pointer to the relevant documentation. Its surprising the words concurrent, parallel and sequential are no where in the post-processors page.

That’s definitely an oversight. I’ll update the docs.

@SwampDragons — Your help here was exactly what I needed to address my problem too. Thanks.

My problem also came from other out-of-date docs, so I submitted a PR to fix: