{"record":{"id":"09b9f817a9bd61bd","repo":"Tencent/WeKnora","slug":"sandbox-connect-session-sandbox-w","errorCode":null,"errorMessage":"sandbox: connect session sandbox: %w","messagePattern":"sandbox: connect session sandbox: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/sandbox/session_manager.go","lineNumber":907,"sourceCode":"\t\treturn nil, false, nil\n\t}\n\tkey, err := m.sessionKey(ctx, sessionID)\n\tif err != nil {\n\t\treturn nil, false, err\n\t}\n\tbinding, err := m.bindings.Get(ctx, key)\n\tif err != nil {\n\t\treturn nil, false, fmt.Errorf(\"sandbox: read session binding: %w\", err)\n\t}\n\tif binding == nil || binding.Provider != m.client.Provider() {\n\t\treturn nil, false, nil\n\t}\n\thandle, err := m.client.Connect(ctx, binding.SandboxID)\n\tif err != nil {\n\t\tif CanReplaceRemoteBinding(err) {\n\t\t\treturn nil, false, nil\n\t\t}\n\t\treturn nil, false, fmt.Errorf(\"sandbox: connect session sandbox: %w\", err)\n\t}\n\tif handle == nil || handle.ID() != binding.SandboxID ||\n\t\thandle.Provider() != m.client.Provider() {\n\t\treturn nil, false, errors.New(\"sandbox: remote handle does not match binding\")\n\t}\n\treturn handle, true, nil\n}\n\nfunc (m *SessionBoundManager) listFilesRecursive(\n\tctx context.Context,\n\thandle RemoteSandboxHandle,\n\tdir string,\n) ([]RemoteDirEntry, error) {\n\tstat, err := m.client.Stat(ctx, handle, dir)\n\tif err != nil {\n\t\tif IsRemoteNotFound(err) {\n\t\t\treturn nil, nil\n\t\t}","sourceCodeStart":889,"sourceCodeEnd":925,"githubUrl":"https://github.com/Tencent/WeKnora/blob/988cbb03305e055d8ebb7d46d9ac6cc0803cd074/internal/sandbox/session_manager.go#L889-L925","documentation":"Wrapping error in lookupSessionHandle when m.client.Connect to the bound sandbox ID fails with an error that is not a replaceable-binding condition (CanReplaceRemoteBinding returned false, so stale bindings are not silently ignored). Indicates the remote sandbox exists in the binding but cannot be connected to (crashed, network issue, or provider error).","triggerScenarios":"Thrown at internal/sandbox/session_manager.go:907 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the wrapped Connect error for sandbox state","If the sandbox is gone, replace/recreate the binding rather than retrying connect","Retry transient connection failures with backoff"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"988cbb03305e055d8ebb7d46d9ac6cc0803cd074","analyzedAt":"2026-09-02T14:41:08.344Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}