{"record":{"id":"c0b02190c2fbafdd","repo":"astral-sh/ruff","slug":"failed-to-get-the-current-working-directory-while","errorCode":null,"errorMessage":"Failed to get the current working directory while creating a default workspace.","messagePattern":"Failed to get the current working directory while creating a default workspace\\.","errorType":"error_code","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/ty_server/src/server.rs","lineNumber":154,"sourceCode":"                    .map(|folder| folder.uri)\n                    .collect::<Vec<_>>()\n            })\n            .or_else(|| {\n                let current_dir = native_system\n                    .current_directory()\n                    .as_std_path()\n                    .to_path_buf();\n                tracing::warn!(\n                    \"No workspace(s) were provided during initialization. \\\n                    Using the current working directory from the fallback system as a \\\n                    default workspace: {}\",\n                    current_dir.display()\n                );\n                let uri = Uri::from_file_path(current_dir).ok()?;\n                Some(vec![uri])\n            })\n            .ok_or_else(|| {\n                anyhow::anyhow!(\n                    \"Failed to get the current working directory while creating a \\\n                    default workspace.\"\n                )\n            })?;\n\n        Ok(Self {\n            connection,\n            worker_threads,\n            main_loop_receiver,\n            main_loop_sender,\n            session: Session::new(\n                resolved_client_capabilities,\n                position_encoding,\n                workspace_urls,\n                initialization_options,\n                native_system,\n                ClientName::from(client_info),\n                in_test,","sourceCodeStart":136,"sourceCodeEnd":172,"githubUrl":"https://github.com/astral-sh/ruff/blob/26f38c119cac42e4d320ba08f09224fdec74af2c/crates/ty_server/src/server.rs#L136-L172","documentation":"An anyhow error raised while constructing a default workspace during server initialization: the client provided no workspace folders, and the fallback attempt to read the current working directory from the system failed. The server cannot determine a root to check files against.","triggerScenarios":"Thrown at crates/ty_server/src/server.rs:154 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the editor sends at least one workspace folder during initialize","Run the server from a directory that can be resolved as a path"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"26f38c119cac42e4d320ba08f09224fdec74af2c","analyzedAt":"2026-09-05T10:32:37.492Z","contentChangedAt":"2026-09-05T10:32:37.492Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}