{"record":{"id":"5bc9a86d9e681978","repo":"wavetermdev/waveterm","slug":"connection-s-not-found","errorCode":null,"errorMessage":"connection %s not found","messagePattern":"connection (.+?) not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/wshrpc/wshserver/wshserver.go","lineNumber":777,"sourceCode":" */\nfunc (ws *WshServer) DismissWshFailCommand(ctx context.Context, connName string) error {\n\tif strings.HasPrefix(connName, \"wsl://\") {\n\t\tdistroName := strings.TrimPrefix(connName, \"wsl://\")\n\t\tconn := wslconn.GetWslConn(distroName)\n\t\tif conn == nil {\n\t\t\treturn fmt.Errorf(\"connection not found: %s\", connName)\n\t\t}\n\t\tconn.ClearWshError()\n\t\tconn.FireConnChangeEvent()\n\t\treturn nil\n\t}\n\topts, err := remote.ParseOpts(connName)\n\tif err != nil {\n\t\treturn err\n\t}\n\tconn := conncontroller.GetConn(opts)\n\tif conn == nil {\n\t\treturn fmt.Errorf(\"connection %s not found\", connName)\n\t}\n\tconn.ClearWshError()\n\tconn.FireConnChangeEvent()\n\treturn nil\n}\n\nfunc (ws *WshServer) NotifySystemResumeCommand(ctx context.Context) error {\n\tlog.Printf(\"NotifySystemResumeCommand called\\n\")\n\treturn nil\n}\n\nfunc (ws *WshServer) FindGitBashCommand(ctx context.Context, rescan bool) (string, error) {\n\tfullConfig := wconfig.GetWatcher().GetFullConfig()\n\treturn shellutil.FindGitBash(&fullConfig, rescan), nil\n}\n\nfunc waveFileToWaveFileInfo(wf *filestore.WaveFile) *wshrpc.WaveFileInfo {\n\treturn &wshrpc.WaveFileInfo{","sourceCodeStart":759,"sourceCodeEnd":795,"githubUrl":"https://github.com/wavetermdev/waveterm/blob/a4447c1563b2df285ab89e76c82f91e1a1a49c1e/pkg/wshrpc/wshserver/wshserver.go#L759-L795","documentation":"DismissWshFailCommand clears a recorded wsh failure on a connection. After parsing the connection name into opts and fetching the live connection via conncontroller.GetConn, this error is thrown when no connection object exists for that name. It means dismissal was attempted against an unknown or not-currently-open connection.","triggerScenarios":"Calling DismissWshFailCommand with a connName that has no active connection: typo in the connection name, connection was closed/removed, or the connection was never established.","commonSituations":"UI showing a stale wsh-error banner for a connection that has since been deleted; calling dismiss after the connection dropped and was garbage-collected; config renamed the connection profile.","solutions":["Check the connection name against conncontroller's active connection list (or `wsh conn ls`-style listing) before dismissing.","If the connection is gone, the wsh error no longer applies — drop the banner/state instead of calling dismiss.","Reconnect to the connection first, then dismiss the wsh failure.","Fix the connName in the caller (config or saved reference)."],"exampleFix":"// before\nconncontroller.DismissWshFail(ctx, \"prod-server\") // typo: actual name \"prodserver\"\n// after\nconnName := \"prodserver\"\nif conncontroller.GetConn(remote.ParseOpts(connName)) != nil {\n    conncontroller.DismissWshFail(ctx, connName)\n}","handlingStrategy":"validation","validationCode":"opts, err := remote.ParseOpts(connName)\nif err != nil || conncontroller.GetConn(opts) == nil {\n    // skip dismissal: connection not active\n} else {\n    _ = wshclient.DismissWshFailCommand(ctx, connName, nil)\n}","typeGuard":"func connIsActive(connName string) bool {\n    opts, err := remote.ParseOpts(connName)\n    return err == nil && conncontroller.GetConn(opts) != nil\n}","tryCatchPattern":"err := wshclient.DismissWshFailCommand(ctx, connName, nil)\nif err != nil && strings.Contains(err.Error(), \"not found\") {\n    // connection already gone: clear local banner state instead\n}","preventionTips":["Verify the connection exists before dismissing its wsh failure","Drop stale wsh-error banners when a connection is removed","Use canonical connection names from config, not ad-hoc strings","Reconnect first if you need the failure record cleared on a live conn"],"tags":["connection","wsh","resolver"],"backgroundTag":"connection-not-found","analyzedSha":"a4447c1563b2df285ab89e76c82f91e1a1a49c1e","analyzedAt":"2026-09-01T15:26:23.972Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}