{"record":{"id":"cef43783cf54d8d3","repo":"BigPizzaV3/CodexPlusPlus","slug":"dream-skin-theme-must-contain-exactly-one-image","errorCode":null,"errorMessage":"Dream Skin theme must contain exactly one image","messagePattern":"Dream Skin theme must contain exactly one image","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/codex-plus-core/src/dream_skin_library.rs","lineNumber":393,"sourceCode":"        .with_context(|| format!(\"Dream Skin theme not found: {id}\"))?;\n    if !metadata.file_type().is_dir() || metadata.file_type().is_symlink() {\n        bail!(\"Dream Skin theme path is not a safe directory\");\n    }\n    let config_path = directory.join(THEME_CONFIG_FILE);\n    let metadata = std::fs::symlink_metadata(&config_path)\n        .with_context(|| format!(\"Dream Skin theme config not found: {id}\"))?;\n    if !metadata.file_type().is_file()\n        || metadata.file_type().is_symlink()\n        || metadata.len() > THEME_CONFIG_LIMIT\n    {\n        bail!(\"invalid Dream Skin theme config\");\n    }\n    let config: DreamSkinThemeConfig = serde_json::from_slice(&std::fs::read(&config_path)?)?;\n    if config.id != id {\n        bail!(\"Dream Skin theme id does not match directory\");\n    }\n    let image = find_theme_image(&directory)\n        .ok_or_else(|| anyhow::anyhow!(\"Dream Skin theme must contain exactly one image\"))?;\n    let draft = DreamSkinThemeDraft {\n        config,\n        image_path: image.to_string_lossy().into_owned(),\n        builtin: false,\n    };\n    validate_theme_draft(&draft)?;\n    Ok(draft)\n}\n\npub fn rename_dream_skin_theme(\n    state_dir: &Path,\n    id: &str,\n    name: &str,\n) -> anyhow::Result<DreamSkinThemeSummary> {\n    let mut draft = load_stored_dream_skin_theme(state_dir, id)?;\n    draft.config.name = name.trim().to_string();\n    save_dream_skin_theme(state_dir, &draft)\n}","sourceCodeStart":375,"sourceCodeEnd":411,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/f2074595a281bc057525c748175c8eb9805b0673/crates/codex-plus-core/src/dream_skin_library.rs#L375-L411","documentation":"Thrown by the Dream Skin theme loader when a theme package's contents are scanned and the number of image files found is not exactly one. A valid theme directory must ship exactly one background image; zero images means an empty/corrupt package, and multiple images make the target asset ambiguous, so the load is rejected instead of guessing.","triggerScenarios":"Thrown at crates/codex-plus-core/src/dream_skin_library.rs:393 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Repackage the theme so its directory contains exactly one image file","Remove extra image files from the theme directory","Re-export or re-download the theme package if it is truncated or corrupt"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f2074595a281bc057525c748175c8eb9805b0673","analyzedAt":"2026-08-23T12:52:24.489Z","contentChangedAt":"2026-08-23T12:52:24.489Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}