{"record":{"id":"a6f422fe6ee43ecb","repo":"hashicorp/nomad","slug":"misconfigured-connection-a6f422","errorCode":null,"errorMessage":"misconfigured connection","messagePattern":"misconfigured connection","errorType":"http","errorClass":null,"httpStatus":500,"severity":"error","filePath":"command/agent/operator_endpoint.go","lineNumber":372,"sourceCode":"\t}\n\n}\n\nfunc (s *HTTPServer) snapshotSaveRequest(resp http.ResponseWriter, req *http.Request) (any, error) {\n\targs := &structs.SnapshotSaveRequest{}\n\tif s.parse(resp, req, &args.Region, &args.QueryOptions) {\n\t\treturn nil, nil\n\t}\n\n\tvar handler structs.StreamingRpcHandler\n\tvar handlerErr error\n\n\tif server := s.agent.Server(); server != nil {\n\t\thandler, handlerErr = server.StreamingRpcHandler(\"Operator.SnapshotSave\")\n\t} else if client := s.agent.Client(); client != nil {\n\t\thandler, handlerErr = client.RemoteStreamingRpcHandler(\"Operator.SnapshotSave\")\n\t} else {\n\t\thandlerErr = fmt.Errorf(\"misconfigured connection\")\n\t}\n\n\tif handlerErr != nil {\n\t\treturn nil, CodedError(500, handlerErr.Error())\n\t}\n\n\thttpPipe, handlerPipe := net.Pipe()\n\tdecoder := codec.NewDecoder(httpPipe, structs.MsgpackHandle)\n\tencoder := codec.NewEncoder(httpPipe, structs.MsgpackHandle)\n\n\t// Create a goroutine that closes the pipe if the connection closes.\n\tctx, cancel := context.WithCancel(req.Context())\n\tdefer cancel()\n\tgo func() {\n\t\t<-ctx.Done()\n\t\thttpPipe.Close()\n\t}()\n","sourceCodeStart":354,"sourceCodeEnd":390,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/command/agent/operator_endpoint.go#L354-L390","documentation":"Sentinel-style error from snapshotSaveRequest when the Nomad agent has neither a server nor a client running, so no StreamingRpcHandler for Operator.SnapshotSave can be obtained; the agent is in a state where snapshots are impossible.","triggerScenarios":"Thrown at command/agent/operator_endpoint.go:372 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Run the snapshot request against an agent running as a server or client, not a bare agent","Verify the agent configuration starts the server or client role","Point the CLI at the correct agent address"],"exampleFix":null,"handlingStrategy":"validation","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"}