{"record":{"id":"871e31c383584a33","repo":"larksuite/cli","slug":"bus-probe-decode-status-w","errorCode":null,"errorMessage":"bus probe: decode status: %w","messagePattern":"bus probe: decode status: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/event/consume/startup.go","lineNumber":117,"sourceCode":"func probeAndDialBus(tr transport.IPC, addr string) (net.Conn, error) {\n\tprobe, err := tr.Dial(addr)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tprobe.SetDeadline(time.Now().Add(2 * time.Second))\n\tif err := protocol.Encode(probe, protocol.NewStatusQuery()); err != nil {\n\t\tprobe.Close()\n\t\treturn nil, fmt.Errorf(\"bus probe: encode: %w\", err)\n\t}\n\tbr := bufio.NewReader(probe)\n\tline, err := protocol.ReadFrame(br)\n\tprobe.Close()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"bus probe: read status: %w\", err)\n\t}\n\tmsg, err := protocol.Decode(bytes.TrimRight(line, \"\\n\"))\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"bus probe: decode status: %w\", err)\n\t}\n\tif _, ok := msg.(*protocol.StatusResponse); !ok {\n\t\treturn nil, fmt.Errorf(\"bus probe: expected StatusResponse, got %T\", msg)\n\t}\n\n\treturn tr.Dial(addr)\n}\n\n// forkBus holds bus.fork.lock until the spawned daemon is dial-able, so concurrent callers can't race past the empty-socket gap and fork independent buses.\nfunc forkBus(tr transport.IPC, appID, profileName, domain string) (int, error) {\n\tlockPath := filepath.Join(core.GetConfigDir(), \"events\", event.SanitizeAppID(appID), \"bus.fork.lock\")\n\tif err := vfs.MkdirAll(filepath.Dir(lockPath), 0700); err != nil {\n\t\treturn 0, err\n\t}\n\n\tlock := lockfile.New(lockPath)\n\tif err := lock.TryLock(); err != nil {\n\t\treturn 0, err","sourceCodeStart":99,"sourceCodeEnd":135,"githubUrl":"https://github.com/larksuite/cli/blob/7fd6ef3c07182257ce776cdc5a614e122d5bd4b3/internal/event/consume/startup.go#L99-L135","documentation":"Wraps a decode failure of the bus's status-reply frame during the startup probe in probeAndDialBus. The probe connection answered but the bytes returned could not be parsed as a protocol message, so the bus daemon is considered unhealthy and the connection is abandoned.","triggerScenarios":"Thrown at internal/event/consume/startup.go:117 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Confirm the socket address points at a current-version CLI bus, not another process","Remove stale sockets and logs and let the bus restart"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7fd6ef3c07182257ce776cdc5a614e122d5bd4b3","analyzedAt":"2026-09-04T21:17:44.649Z","contentChangedAt":"2026-09-04T21:17:44.649Z","schemaVersion":2},"datasetVersion":"2026-09-12T02:17:10.037Z"}