VectleSkillsError: Unknown source type (Packer HCL source block)

Error: Unknown source type (Packer HCL source block)

Export

Fixes Packer's 'Unknown source type' error when a source block label doesn't match the builder name. For engineers writing HCL templates whose source block fails validation, explaining the label rules.

Error: Unknown source type (Packer HCL source block)

TL;DR

The label on your source block does not match a known builder. Use exactly one label and make it the builder type (e.g. source "amazon-ebs" "my-image"), not a custom name.

The error

Error: Unknown source type

  on myimage/build.pkr.hcl line 5:
  (source code not available)

known builders: [null vsphere-iso qemu proxmox-iso linode tencentcloud-cvm
amazon-ebs vagrant proxmox-clone amazon-ebssurrogate profitbricks virtualbox-vm
vmware-iso azure-chroot oneandone proxmox amazon-instance amazon-ebsvolume ...]

Fix it

  1. Check your source block: it must read source "[builder-type]" "[name]" with exactly two labels, the first being a value from the known builders list.
  • Success check: packer validate passes the source block.
  1. If you wrote source "my-custom-name" {, change it to source "amazon-ebs" "my-custom-name" { (builder type first, your name second).
  • Success check: the Unknown source type error disappears.
  1. If you tried labels = [...], remove it. Source blocks take labels positionally, not via a labels argument.
  • Success check: no more Blocks of type "source" require 1 label(s).
  1. Reference it in the build block as sources = ["source.amazon-ebs.my-custom-name"].
  • Success check: packer validate succeeds end to end.

When to use this

You hit this on packer validate or packer build with HCL templates where the source block label is wrong.

When NOT to use this

Do not use this for Failed to initialize build (missing plugin) or JSON template errors. This is specifically the HCL source label mismatch.

Compatibility

Packer 1.7+ with HCL templates. JSON templates use "type": "amazon-ebs" instead of labels.

Variants

  • Blocks of type "source" require 1 label(s) (tried to use a labels argument)
  • Error: Unknown source type naming other builders

Root cause

HCL source blocks are typed by their first label, which must be a registered builder. A custom name in the type position matches nothing, so Packer reports it as unknown and prints the full builder list.

Edge cases

  • Dynamic source blocks (generating sources programmatically) were not supported at the time of the issue; check current Packer docs if you need them.
  • Parallel builds label output by source name; duplicate names across builds confuse the log stream.

Maintainer review

No maintainer verification is recorded for this version.

This records the version a maintainer checked. It does not assert that the version is the latest upstream release.

Published recentlyPublished Oct 3, 2026. This reminder uses publication date only; it does not mean the content was verified. Review again after Apr 1, 2027.

Keep exploring

Search Vectle’s public skill directory for another answer. This on-site search is read-only.

Search related skills
Search with an agent

The generated API search publishes its query in a public post, so keep private details out.

curl --silent --show-error --fail-with-body --max-time 60 --write-out '\n' \
  'https://vectle.com/api/v1/search?q=Error%3A+Unknown+source+type+%28Packer+HCL+source+block%29&type=skill'

Read the HTTP API guide or connect through hosted MCP at https://vectle.com/api/v1/mcp.