{"record":{"id":"3341282efbc9f662","repo":"hashicorp/nomad","slug":"nil-reattachconfig-cannot-be-converted","errorCode":null,"errorMessage":"nil ReattachConfig cannot be converted","messagePattern":"nil ReattachConfig cannot be converted","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"plugins/shared/structs/plugin_reattach_config.go","lineNumber":26,"sourceCode":"\t\"net\"\n\n\tplugin \"github.com/hashicorp/go-plugin\"\n)\n\n// ReattachConfig is a wrapper around plugin.ReattachConfig to better support\n// serialization\ntype ReattachConfig struct {\n\tProtocol string\n\tNetwork  string\n\tAddr     string\n\tPid      int\n}\n\n// ReattachConfigToGoPlugin converts a ReattachConfig wrapper struct into a go\n// plugin ReattachConfig struct\nfunc ReattachConfigToGoPlugin(rc *ReattachConfig) (*plugin.ReattachConfig, error) {\n\tif rc == nil {\n\t\treturn nil, fmt.Errorf(\"nil ReattachConfig cannot be converted\")\n\t}\n\n\tplug := &plugin.ReattachConfig{\n\t\tProtocol: plugin.Protocol(rc.Protocol),\n\t\tPid:      rc.Pid,\n\t}\n\n\tswitch rc.Network {\n\tcase \"tcp\", \"tcp4\", \"tcp6\":\n\t\taddr, err := net.ResolveTCPAddr(rc.Network, rc.Addr)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tplug.Addr = addr\n\tcase \"udp\", \"udp4\", \"udp6\":\n\t\taddr, err := net.ResolveUDPAddr(rc.Network, rc.Addr)\n\t\tif err != nil {\n\t\t\treturn nil, err","sourceCodeStart":8,"sourceCodeEnd":44,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/plugins/shared/structs/plugin_reattach_config.go#L8-L44","documentation":"ReattachConfigToGoPlugin was passed a nil ReattachConfig wrapper. The converter cannot build a go-plugin reattach handle from nothing, so this guard rejects nil input immediately.","triggerScenarios":"Thrown at plugins/shared/structs/plugin_reattach_config.go:26 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a populated ReattachConfig from the plugin's reattach handshake","Check the caller for a lost config (e.g. missing from plugin handle) before converting"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}