{"record":{"id":"c9ebf7078d2604ab","repo":"ginuerzh/gost","slug":"accpet-on-closed-listener-c9ebf7","errorCode":null,"errorMessage":"accpet on closed listener","messagePattern":"accpet on closed listener","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"ssh.go","lineNumber":835,"sourceCode":"\t\t\tdefault:\n\t\t\t\tlog.Log(\"[ssh] Unknown channel type:\", t)\n\t\t\t\tnewChannel.Reject(ssh.UnknownChannelType, fmt.Sprintf(\"unknown channel type: %s\", t))\n\t\t\t}\n\t\t}\n\t}()\n\n\tlog.Logf(\"[ssh] %s <-> %s\", conn.RemoteAddr(), conn.LocalAddr())\n\tsc.Wait()\n\tlog.Logf(\"[ssh] %s >-< %s\", conn.RemoteAddr(), conn.LocalAddr())\n}\n\nfunc (l *sshTunnelListener) Accept() (conn net.Conn, err error) {\n\tvar ok bool\n\tselect {\n\tcase conn = <-l.connChan:\n\tcase err, ok = <-l.errChan:\n\t\tif !ok {\n\t\t\terr = errors.New(\"accpet on closed listener\")\n\t\t}\n\t}\n\treturn\n}\n\n// directForward is structure for RFC 4254 7.2 - can be used for \"forwarded-tcpip\" and \"direct-tcpip\"\ntype directForward struct {\n\tHost1 string\n\tPort1 uint32\n\tHost2 string\n\tPort2 uint32\n}\n\nfunc (p directForward) String() string {\n\treturn fmt.Sprintf(\"%s:%d -> %s:%d\", p.Host2, p.Port2, p.Host1, p.Port1)\n}\n\nfunc getHostPortFromAddr(addr net.Addr) (host string, port int, err error) {","sourceCodeStart":817,"sourceCodeEnd":853,"githubUrl":"https://github.com/ginuerzh/gost/blob/a33fdbf4c98034f4bfeeaea9868909822b9c526d/ssh.go#L817-L853","documentation":"Returned by sshTunnelListener.Accept when its errChan is closed and no value was received — the tunnel's error channel has been shut down, so the listener can no longer produce connections or errors. It is the sentinel for accept-after-close on the SSH tunnel listener (note the misspelling 'accpet' in the message).","triggerScenarios":"Thrown at ssh.go:835 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Stop calling Accept after the tunnel listener is closed","Re-establish the SSH tunnel and create a new listener if forwarding must continue","Propagate the error so callers shut down their accept loops cleanly"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a33fdbf4c98034f4bfeeaea9868909822b9c526d","analyzedAt":"2026-09-02T22:15:54.506Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T02:17:09.455Z"}