{"record":{"id":"e9ba61fda224ef79","repo":"wasmerio/wasmer","slug":"could-not-save-config-file","errorCode":null,"errorMessage":"could not save config file","messagePattern":"could not save config file","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"lib/cli/src/commands/config.rs","lineNumber":307,"sourceCode":"                        );\n                    }\n                    StorableConfigField::TelemetryEnabled(t) => {\n                        config.telemetry_enabled = t.enabled.0;\n                    }\n                    StorableConfigField::ProxyUrl(p) => {\n                        if p.url == \"none\" || p.url.is_empty() {\n                            config.proxy.url = None;\n                        } else {\n                            config.proxy.url = Some(p.url.clone());\n                        }\n                    }\n                    StorableConfigField::UpdateNotificationsEnabled(u) => {\n                        config.update_notifications_enabled = u.enabled.0;\n                    }\n                }\n                config\n                    .save(config_file)\n                    .with_context(|| anyhow::anyhow!(\"could not save config file\"))?;\n            }\n        }\n        Ok(())\n    }\n}\n","sourceCodeStart":289,"sourceCodeEnd":313,"githubUrl":"https://github.com/wasmerio/wasmer/blob/8c4b9ee9d33fb2068863fbb3d328683e7e6ff7f5/lib/cli/src/commands/config.rs#L289-L313","documentation":"In the `wasmer config` command's `execute`, after applying requested field updates (e.g. `update_notifications_enabled`) the CLI calls `config.save(config_file)` to persist the config to disk. This error wraps any failure of that save — typically an I/O or serialization problem writing the wasmer config file.","triggerScenarios":"Running a `wasmer config set ...` (or equivalent) command where `config.save(config_file)` returns Err: the config file path is not writable (permission denied), the parent directory is missing, the disk is full, or serialization of the updated config fails.","commonSituations":"Read-only ~/.wasmer directory or filesystem (read-only mount, container with restricted writes); HOME set incorrectly so config_file points at a nonexistent dir; disk quota exceeded; corrupted config file that fails to re-serialize.","solutions":["Check write permissions on the config file and its directory: `ls -la ~/.wasmer/` and `chmod u+w` as needed.","Ensure the parent directory exists (`mkdir -p ~/.wasmer`) and HOME points to a writable location.","Free disk space or address quota limits if the filesystem reports no space.","Back up and repair/reset the config file if it is corrupted, then retry the config command."],"exampleFix":"// before\nwasmer config set update_notifications_enabled false  // could not save config file\n// after\nmkdir -p ~/.wasmer && chmod u+w ~/.wasmer\nwasmer config set update_notifications_enabled false","handlingStrategy":"validation","validationCode":"fn config_file_writable(path: &Path) -> bool {\n    path.parent().map(|d| d.is_dir()).unwrap_or(false)\n        && std::fs::OpenOptions::new()\n            .write(true)\n            .create(true)\n            .open(path)\n            .is_ok()\n}\n// verify before running config set:\nassert!(config_file_writable(&config_path), \"config file not writable\");","typeGuard":null,"tryCatchPattern":"match config_set(key, value) {\n    Err(e) if e.to_string().contains(\"could not save config file\") => {\n        eprintln!(\"Check ~/.wasmer permissions/disk space: {e}\");\n    }\n    other => other?,\n}","preventionTips":["Keep ~/.wasmer owned by the running user and writable (u+w).","Verify HOME is set correctly in containers/CI.","Monitor disk space/quota on the volume holding the config.","Back up the config before bulk edits to ease recovery."],"tags":["config","filesystem","cli"],"backgroundTag":"config-save-failed","analyzedSha":"8c4b9ee9d33fb2068863fbb3d328683e7e6ff7f5","analyzedAt":"2026-09-01T23:06:31.009Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}