{"record":{"id":"3ba30ad210fce560","repo":"hashicorp/nomad","slug":"failed-to-convert-parsed-config-to-map-v","errorCode":null,"errorMessage":"failed to convert parsed config to map: %v","messagePattern":"failed to convert parsed config to map: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"helper/pluginutils/loader/init.go","lineNumber":531,"sourceCode":"\n\tb, ok := instance.Plugin().(base.BasePlugin)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"dispensed plugin %s doesn't meet base plugin interface\", id)\n\t}\n\n\tc := &base.Config{\n\t\tPluginConfig: cdata,\n\t\tAgentConfig:  nil,\n\t\tApiVersion:   info.apiVersion,\n\t}\n\n\tif err := b.SetConfig(c); err != nil {\n\t\treturn nil, fmt.Errorf(\"setting config on plugin failed: %v\", err)\n\t}\n\n\tparsedConfig, err := hclutils.CtyValueToMapInterface(val)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to convert parsed config to map: %v\", err)\n\t}\n\n\treturn parsedConfig, nil\n}\n","sourceCodeStart":513,"sourceCodeEnd":536,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/helper/pluginutils/loader/init.go#L513-L536","documentation":"This error occurs when hclutils.CtyValueToMapInterface fails to convert the parsed HCL config (a Cty value) into a plain Go map after the config was successfully set on the plugin. It indicates the validated config could not be serialized back to a generic map for the loader to return.","triggerScenarios":"validatePluginConfig, after a successful b.SetConfig(c), calls hclutils.CtyValueToMapInterface(val) and the Cty-to-map conversion errors — typically when `val` contains Cty types unsupported by the converter or is malformed.","commonSituations":"Plugin config schema includes exotic Cty types (e.g. certain capsule/atomic types) that CtyValueToMapInterface cannot represent; internal inconsistency between the HCL parser output and the converter's expectations; version skew between hclutils and the schema.","solutions":["Inspect the wrapped %v message to identify the un-convertible Cty value/type.","Simplify the plugin config (avoid exotic nested/object types) if the schema allows exotic types.","Ensure Nomad and any external plugin use compatible versions so schemas produce convertible Cty values.","If reproducible with a stock config, file/upgrade against the Nomad version — this is usually an internal bug."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"parsed, err := validatePluginConfig(...)\nif err != nil && strings.Contains(err.Error(), \"failed to convert parsed config to map\") {\n    // internal conversion failure: capture config + Nomad version for bug report\n    return fmt.Errorf(\"cty conversion bug (nomad %s): %w\", version.Version, err)\n}","preventionTips":["Keep Nomad and external plugins on compatible released versions","Avoid exotic config types unless documented as supported","Report reproducible conversion failures upstream with the config snippet"],"tags":["plugin-loader","cty","type-conversion","nomad"],"backgroundTag":"cty-value-conversion-failed","analyzedSha":"482b49bf1aec006f089bcfc7e632d8f6ac303e5e","analyzedAt":"2026-09-04T07:54:14.808Z","contentChangedAt":"2026-09-04T07:54:14.808Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}