{"record":{"id":"2f00c6280e5aea25","repo":"astral-sh/ruff","slug":"error","errorCode":null,"errorMessage":"{}","messagePattern":"\\{\\}","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/ty_project/src/db.rs","lineNumber":146,"sourceCode":"        //   cache and load the cache if it exists.\n        //   we may want to have a dedicated method for this?\n        // Important: For persistent caching it's essential that we can compute the\n        // cache key before loading the DB. Because of that, access to the `db` (other than system and vendored) is\n        // strictly forbidden before resolving the `program_settings`.\n\n        let merged_options = project_metadata.to_merged_options();\n\n        let (program_settings, program_settings_diagnostics) = strategy\n            .to_anyhow(merged_options.to_program_settings(db.system(), db.vendored(), strategy))?;\n\n        // This must be called before `from_metadata`, or the `SearchPath` root\n        // will take precedence over the `Project` root, resulting in\n        // all project files having HIGH durability.\n        project_metadata.try_add_project_root(&db);\n\n        let (settings, mut settings_diagnostics) = strategy\n            .map_err(merged_options.to_settings(&db, strategy), |error| {\n                anyhow::anyhow!(\"{}\", error.pretty(&db))\n            })?;\n        settings_diagnostics.extend(\n            program_settings_diagnostics\n                .into_iter()\n                .map(|diagnostic| diagnostic.into_diagnostic(&db)),\n        );\n\n        db.project = Some(Project::from_metadata(\n            &db,\n            project_metadata,\n            settings,\n            program_settings,\n            settings_diagnostics,\n        ));\n\n        Ok(db)\n    }\n","sourceCodeStart":128,"sourceCodeEnd":164,"githubUrl":"https://github.com/astral-sh/ruff/blob/672bb4edf04c84f8b0753346359daee4057158f2/crates/ty_project/src/db.rs#L128-L164","documentation":"Thrown while constructing ty's ProjectDatabase: resolving the merged project options into settings failed. The message is the pretty-printed options error, which names the offending config file, the invalid setting, and the reason. This is ty's generic 'your configuration is invalid' path (db.rs:146 wraps error.pretty(&db) in anyhow).","triggerScenarios":"Calling ProjectDatabase::new (or `ty check` on a project) where pyproject.toml [tool.ty] or ty.toml contains an unknown option key, a value of the wrong type, or an option invalid for the resolved environment; the error comes from merged_options.to_settings(&db, strategy) via strategy.map_err.","commonSituations":"Typos in setting names (e.g. `sourse` instead of `src`), copy-pasting ruff options into [tool.ty], using options added in a newer ty version, wrong TOML types (string where a list is expected), or a stale config after upgrading/downgrading ty.","solutions":["Read the pretty message — it identifies the exact file, key, and violation; fix that key first","Correct or delete the flagged option in pyproject.toml [tool.ty] / ty.toml / user-level config","Re-run `ty check` in the project root to confirm the config now parses","Compare your settings against the ty version's documentation; drop options that don't exist in that version"],"exampleFix":"# before — pyproject.toml\n[tool.ty]\nsourse = [\"src\"]  # typo: unknown option -> ProjectDatabase::new fails\n\n# after\n[tool.ty]\nsrc = [\"src\"]","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"// Rust embedder: capture the pretty config diagnostic at construction\nmatch ProjectDatabase::new(metadata, system, &strategy) {\n    Ok(db) => { /* proceed */ }\n    Err(err) => {\n        // err already contains error.pretty(&db): file + setting + reason\n        eprintln!(\"ty project setup failed:\\n{err:#}\");\n        return;\n    }\n}","preventionTips":["Validate ty config edits by running `ty check` before opening the editor","Keep [tool.ty] minimal; only add options documented for your ty version","Treat any options-resolution failure as a config bug — print the pretty message verbatim, don't retry"],"tags":["config","settings","pyproject","project-database","toml"],"backgroundTag":null,"analyzedSha":"672bb4edf04c84f8b0753346359daee4057158f2","analyzedAt":"2026-08-16T08:54:05.464Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}