{"record":{"id":"6f81a6d85f863524","repo":"DioxusLabs/dioxus","slug":"failed-to-save-global-cli-settings-e","errorCode":null,"errorMessage":"failed to save global cli settings: {e}","messagePattern":"failed to save global cli settings: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/cli/src/settings.rs","lineNumber":99,"sourceCode":"        })?;\n\n        // Create the directory structure if it doesn't exist.\n        let parent_path = path.parent().unwrap();\n        if let Err(e) = fs::create_dir_all(parent_path) {\n            error!(\n                dx_src = ?TraceSrc::Dev,\n                ?data,\n                ?path,\n                \"failed to create directories for settings file\"\n            );\n            bail!(\"failed to create directories for settings file: {e}\");\n        }\n\n        // Write the data.\n        let result = fs::write(&path, data.clone());\n        if let Err(e) = result {\n            error!(?data, ?path, \"failed to save global cli settings\");\n            bail!(\"failed to save global cli settings: {e}\");\n        }\n\n        Ok(())\n    }\n\n    /// Modify the settings toml file - doesn't change the settings for this session\n    pub(crate) fn modify_settings(with: impl FnOnce(&mut CliSettings)) -> Result<()> {\n        let mut _settings = CliSettings::load();\n        let settings: &mut CliSettings = Arc::make_mut(&mut _settings);\n        with(settings);\n        settings.save()?;\n\n        Ok(())\n    }\n\n    /// Check if we should prefer to use the no-downloads feature\n    pub(crate) fn prefer_no_downloads() -> bool {\n        if cfg!(feature = \"no-downloads\") && !cfg!(debug_assertions) {","sourceCodeStart":81,"sourceCodeEnd":117,"githubUrl":"https://github.com/DioxusLabs/dioxus/blob/24f6a829df0dfa203961a98ea4cae21c2ff27e28/packages/cli/src/settings.rs#L81-L117","documentation":"Write guard in CliSettings::save: the parent directory exists and the TOML was serialized, but the final fs::write of the settings data to the global settings file returned an error. This is an environment failure on the write itself — permissions, disk, or path issues on the settings file path, which is logged with the offending data and path.","triggerScenarios":"Thrown at packages/cli/src/settings.rs:99 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["The global CLI settings could not be saved. Check disk space and write permissions."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"24f6a829df0dfa203961a98ea4cae21c2ff27e28","analyzedAt":"2026-08-23T07:10:14.078Z","contentChangedAt":"2026-08-23T07:10:14.078Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}