{"record":{"id":"81d322a9cef8551b","repo":"wavetermdev/waveterm","slug":"setpeerinfo-only-valid-for-proxy-connections","errorCode":null,"errorMessage":"setpeerinfo only valid for proxy connections","messagePattern":"setpeerinfo only valid for proxy connections","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/wshutil/wshrouter_controlimpl.go","lineNumber":87,"sourceCode":"\t}\n\treturn lm.sourceRouteId, nil\n}\n\nfunc (impl *WshRouterControlImpl) SetPeerInfoCommand(ctx context.Context, peerInfo string) error {\n\tsource := GetRpcSourceFromContext(ctx)\n\tlinkId := impl.Router.GetLinkIdForRoute(source)\n\tif linkId == baseds.NoLinkId {\n\t\treturn fmt.Errorf(\"no link found for source route %q\", source)\n\t}\n\tlm := impl.Router.getLinkMeta(linkId)\n\tif lm == nil {\n\t\treturn fmt.Errorf(\"no link meta found for linkId %d\", linkId)\n\t}\n\tif proxy, ok := lm.client.(*WshRpcProxy); ok {\n\t\tproxy.SetPeerInfo(peerInfo)\n\t\treturn nil\n\t}\n\treturn fmt.Errorf(\"setpeerinfo only valid for proxy connections\")\n}\n\nfunc (impl *WshRouterControlImpl) AuthenticateCommand(ctx context.Context, data string) (wshrpc.CommandAuthenticateRtnData, error) {\n\thandler := GetRpcResponseHandlerFromContext(ctx)\n\tif handler == nil {\n\t\treturn wshrpc.CommandAuthenticateRtnData{}, fmt.Errorf(\"no response handler in context\")\n\t}\n\tlinkId := handler.GetIngressLinkId()\n\tif linkId == baseds.NoLinkId {\n\t\treturn wshrpc.CommandAuthenticateRtnData{}, fmt.Errorf(\"no ingress link found\")\n\t}\n\n\tnewCtx, err := ValidateAndExtractRpcContextFromToken(data)\n\tif err != nil {\n\t\tlog.Printf(\"wshrouter authenticate error linkid=%d: %v\", linkId, err)\n\t\treturn wshrpc.CommandAuthenticateRtnData{}, fmt.Errorf(\"error validating token: %w\", err)\n\t}\n\trouteId, err := validateRpcContextFromAuth(newCtx)","sourceCodeStart":69,"sourceCodeEnd":105,"githubUrl":"https://github.com/wavetermdev/waveterm/blob/a4447c1563b2df285ab89e76c82f91e1a1a49c1e/pkg/wshutil/wshrouter_controlimpl.go#L69-L105","documentation":"Error \"setpeerinfo only valid for proxy connections\" thrown in wavetermdev/waveterm.","triggerScenarios":"Thrown at pkg/wshutil/wshrouter_controlimpl.go:87 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a4447c1563b2df285ab89e76c82f91e1a1a49c1e","analyzedAt":"2026-09-01T15:26:23.972Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}