{"record":{"id":"1f280fcdd4fd01e4","repo":"hashicorp/packer","slug":"unknown-builder-s","errorCode":null,"errorMessage":"Unknown builder %s","messagePattern":"Unknown builder (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packer/maps.go","lineNumber":80,"sourceCode":"\t}\n\treturn res\n}\n\ntype MapOfBuilder map[string]func() (packersdk.Builder, error)\n\nfunc (mob MapOfBuilder) Has(builder string) bool {\n\t_, res := mob[builder]\n\treturn res\n}\n\nfunc (mob MapOfBuilder) Set(builder string, starter func() (packersdk.Builder, error)) {\n\tmob[builder] = starter\n}\n\nfunc (mob MapOfBuilder) Start(builder string) (packersdk.Builder, error) {\n\td, found := mob[builder]\n\tif !found {\n\t\treturn nil, fmt.Errorf(\"Unknown builder %s\", builder)\n\t}\n\treturn d()\n}\n\nfunc (mob MapOfBuilder) List() []string {\n\tres := []string{}\n\tfor k := range mob {\n\t\tres = append(res, k)\n\t}\n\treturn res\n}\n\ntype MapOfDatasource map[string]func() (packersdk.Datasource, error)\n\nfunc (mod MapOfDatasource) Has(dataSource string) bool {\n\t_, res := mod[dataSource]\n\treturn res\n}","sourceCodeStart":62,"sourceCodeEnd":98,"githubUrl":"https://github.com/hashicorp/packer/blob/eb36e3c3e48a036f3e8cc94087636ee72e1303c9/packer/maps.go#L62-L98","documentation":"MapOfBuilder.Start returns this error when the requested builder name is not a key in the registry map. It indicates Packer could not resolve the builder referenced by a source/build block — the builder plugin is unknown to the running Packer binary.","triggerScenarios":"Calling Start(builder) with an unregistered name: source block type misspelled (e.g. \"amazon-ebs2\"), a builder plugin not declared in required_plugins/installed, or a name registered only via a plugin binary that wasn't discovered.","commonSituations":"Misspelled source type in HCL2 template; forgot `packer init`; third-party builder plugin binary missing or misnamed; upgrading Packer where a legacy builtin (e.g. from JSON templates) no longer exists.","solutions":["Fix the source/builder type name in the template (check `packer plugins list`).","Run `packer init .` to install plugins declared in required_plugins.","Ensure the plugin binary follows the github.com/<org>/<name> PACKER_PLUGIN_PATH naming layout.","In embedded Go usage, register the builder with Set() before Start()."],"exampleFix":"// before (typo)\nsource \"amazon-ebs2\" { ... }\n\n// after\nsource \"amazon-ebs\" { ... }","handlingStrategy":"validation","validationCode":"if !builders.Has(name) {\n    return fmt.Errorf(\"builder %q not found; run `packer init` (known: %v)\", name, builders.List())\n}\nb, err := builders.Start(name)","typeGuard":null,"tryCatchPattern":"if err != nil {\n    if strings.Contains(err.Error(), \"Unknown builder\") { /* install the plugin, then retry */ }\n}","preventionTips":["Always declare builder plugins in required_plugins with version constraints.","Run `packer validate` before `packer build`.","Verify plugin binaries exist in PACKER_PLUGIN_PATH after CI image updates."],"tags":["plugin-registry","builder","config"],"backgroundTag":"unknown-component-type","analyzedSha":"eb36e3c3e48a036f3e8cc94087636ee72e1303c9","analyzedAt":"2026-09-05T13:20:43.127Z","contentChangedAt":"2026-09-05T13:20:43.127Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}