BigPizzaV3/CodexPlusPlus · error
Dream Skin theme directory contains unknown entry
Error message
Dream Skin theme directory contains unknown entry: {name} What it means
ensure_known_theme_directory scans an existing Dream Skin theme directory before it is backed up/removed and bails if any entry is not one of the whitelisted theme files (theme.json/.dream-skin-import.jpg/image.* with a supported extension/theme.css/manifest.json/LICENSE.txt). Regular files only are accepted: subdirectories and symlinks are also reported as unknown entries. This protects the replace/remove flow from deleting user data it does not recognize.
Solutions
- Inspect the theme directory and move out or delete any file that is not part of the known theme file set (theme.json, image.*, theme.css, manifest.json, LICENSE.txt, .dream-skin-import.jpg)
- Remove hidden OS metadata files (.DS_Store, Thumbs.db, desktop.ini) from the directory
- If the theme ships extra assets, ask the theme author to embed them in theme.css/theme.json rather than as extra files, or reinstall the theme from the market
- Delete the existing theme directory manually (after backing up) so the install can recreate a clean one
Example fix
# before dream-skin/themes/my-theme/ theme.json theme.css screenshot.png <- unknown entry # after dream-skin/themes/my-theme/ theme.json theme.css image.screenshot.png <- rename to an accepted image.* name (with supported extension) or remove the file
Defensive patterns
Strategy: validation
Validate before calling
fn has_only_known_entries(dir: &Path) -> std::io::Result<bool> {
const KNOWN: [&str; 5] = ["theme.json", ".dream-skin-import.jpg", "theme.css", "manifest.json", "LICENSE.txt"];
for entry in std::fs::read_dir(dir)? {
let p = entry?.path();
let md = std::fs::symlink_metadata(&p)?;
if !md.file_type().is_file() { return Ok(false); }
let name = p.file_name().and_then(|n| n.to_str()).unwrap_or("");
let ok = KNOWN.contains(&name)
|| (name.starts_with("image.") && p.extension().map_or(false, |e| ["png","jpg","jpeg","webp"].contains(&e.to_str().unwrap_or(""))));
if !ok { return Ok(false); }
}
Ok(true)
} Type guard
fn is_plain_file(p: &Path) -> bool {
std::fs::symlink_metadata(p).map(|m| m.file_type().is_file() && !m.file_type().is_symlink()).unwrap_or(false)
} Try / catch
match save_validated_dream_skin_package(...) {
Ok(summary) => println!("installed {}", summary.id),
Err(e) if e.to_string().contains("unknown entry") => {
eprintln!("theme dir has unrecognized files; clean it and retry: {e}");
}
Err(e) => return Err(e),
} Prevention
- Never hand-edit files inside installed theme directories; use the library's save APIs
- Exclude OS metadata files (.DS_Store, Thumbs.db) from any sync tool that touches the themes folder
- Package themes with only the whitelisted filenames and no subdirectories
- Before replacing a theme, list its contents and confirm only known entries exist
When it happens
Trigger: replace_theme_directory or remove_known_theme_directory is called on a target theme directory that contains any extra file (e.g. an OS artifact like .DS_Store or Thumbs.db, a downloaded README, an editor backup, a nested subfolder) or a symlinked entry.
Common situations: Users manually added files (screenshots, notes, extra CSS) into a theme folder; macOS/Windows metadata files (Thumbs.db, desktop.ini, .DS_Store) were created inside the directory; a theme exported by a third-party tool includes subdirectories; a symlinked theme directory shared from dotfiles.
Understand the failure class
Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.
Related errors
- Codex CLI 路径指向的是目录而不是可执行文件:
- Codex CLI 没有执行权限:
- Codex CLI 路径不存在: 请填 Codex CLI 可执行文件的完整路径。macOS 桌面版通常在…
- Dream Skin image is empty
- Dream Skin image is not a file
AI-assisted analysis of BigPizzaV3/CodexPlusPlus@b1ed92e5e4 (2026-09-19).
Data as JSON: /api/errors/4d2fc91936d3c115.
Report an issue: GitHub.
Appendix: source
Thrown at crates/codex-plus-core/src/dream_skin_library.rs:639
Ok(())
}
fn ensure_known_theme_directory(directory: &Path) -> anyhow::Result<()> {
for entry in std::fs::read_dir(directory)? {
let path = entry?.path();
let name = path
.file_name()
.and_then(|value| value.to_str())
.unwrap_or("");
let metadata = std::fs::symlink_metadata(&path)?;
let known = metadata.file_type().is_file()
&& !metadata.file_type().is_symlink()
&& (name == THEME_CONFIG_FILE
|| name == ".dream-skin-import.jpg"
|| (name.starts_with("image.") && supported_image_extension(&path))
|| matches!(name, "theme.css" | "manifest.json" | "LICENSE.txt"));
if !known {
bail!("Dream Skin theme directory contains unknown entry: {name}");
}
}
Ok(())
}
fn remove_known_theme_directory(directory: &Path) -> anyhow::Result<()> {
if !directory.exists() {
return Ok(());
}
ensure_known_theme_directory(directory)?;
for entry in std::fs::read_dir(directory)? {
let path = entry?.path();
std::fs::remove_file(&path)
.with_context(|| format!("failed to remove {}", path.display()))?;
}
std::fs::remove_dir(directory)
.with_context(|| format!("failed to remove {}", directory.display()))?;
Ok(())View on GitHub (pinned to b1ed92e5e4)