BigPizzaV3/CodexPlusPlus · error · anyhow::Error

DreamSkin 社区缓存无效

Error message

DreamSkin 社区缓存无效

What it means

Raised in read_cached_catalog: the locally cached DreamSkin community catalog file in the state dir failed safety checks — not a regular file, is a symlink, or otherwise fails validation — so the cache cannot be trusted and is rejected.

Source

Thrown at crates/codex-plus-core/src/dream_skin_community.rs:368

    }
}

fn cache_catalog(state_dir: &Path, catalog: &DreamSkinCommunityCatalog) -> anyhow::Result<()> {
    let path = state_dir.join(CACHE_FILE);
    if let Some(parent) = path.parent() {
        std::fs::create_dir_all(parent)?;
    }
    crate::settings::atomic_write(&path, &serde_json::to_vec(catalog)?)
}

fn read_cached_catalog(state_dir: &Path) -> anyhow::Result<DreamSkinCommunityCatalog> {
    let path = state_dir.join(CACHE_FILE);
    let metadata = std::fs::symlink_metadata(&path)?;
    if !metadata.file_type().is_file()
        || metadata.file_type().is_symlink()
        || metadata.len() as usize > CATALOG_BYTES_LIMIT
    {
        bail!("DreamSkin 社区缓存无效");
    }
    let catalog: DreamSkinCommunityCatalog = serde_json::from_slice(&std::fs::read(path)?)?;
    validate_catalog(&catalog.items)?;
    Ok(catalog)
}

fn community_http_client(timeout: Duration) -> anyhow::Result<reqwest::Client> {
    Ok(reqwest::Client::builder()
        .user_agent(format!(
            "CodexPlusPlus/{} DreamSkin",
            env!("CARGO_PKG_VERSION")
        ))
        .redirect(reqwest::redirect::Policy::none())
        .connect_timeout(Duration::from_secs(8))
        .timeout(timeout)
        .build()?)
}

View on GitHub (pinned to f2074595a2)

Solutions

  1. Delete the cache file in the state dir to force a fresh fetch
  2. Check for symlink attacks or corruption in the state dir
  3. Retry the catalog load after clearing the cache
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at crates/codex-plus-core/src/dream_skin_community.rs:368 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of BigPizzaV3/CodexPlusPlus@f2074595a2 (2026-08-23). Data as JSON: /api/errors/47831d489dc38055. Report an issue: GitHub.