Skip to content
Latchkey

Packer manifest post-processor write error in CI

The manifest post-processor records built artifacts (such as AMI ids) to a JSON file that later steps read. If the output path is missing or not writable, the post-processor fails after a successful build.

What this error means

packer build completes the image, then the manifest post-processor fails writing the output file, often with a "no such file or directory" or permission error on the path.

packer
==> Running post-processor: manifest
Build errored: open output/manifest.json: no such file or directory

Common causes

The output directory does not exist

The manifest output points at a directory the runner never created, so the write fails.

The path is not writable

A permission issue on the target directory blocks the write on the runner.

How to fix it

Create the output directory and write there

  1. Create the output directory before build, or write to the working directory.
  2. Point the manifest output at that writable path.
  3. Read the manifest in a later step for the artifact ids.
build.pkr.hcl
post-processor "manifest" {
  output     = "manifest.json"
  strip_path = true
}

Ensure the directory exists in CI

If you use a subdirectory, create it before packer build so the write path is present.

.github/workflows/build.yml
- run: mkdir -p output
- run: packer build .

How to prevent it

  • Write the manifest to a path you know is writable.
  • Create output directories before build.
  • Read artifact ids from the manifest in downstream steps.

Frequently asked questions

What causes "manifest write error"?
The manifest output points at a directory the runner never created, so the write fails.
How do I fix manifest write error?
Create the output directory and write there

Related guides

References

Run this faster and cheaper on Latchkey managed runners - self-healing included. Start free → 30-day trial · No credit card