{"record":{"id":"2589add7404b3939","repo":"sigoden/dufs","slug":"path-doesn-t-contains-index-html","errorCode":null,"errorMessage":"Path `{}` doesn't contains index.html","messagePattern":"Path `(.+?)` doesn't contains index\\.html","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/args.rs","lineNumber":476,"sourceCode":"\n    fn sanitize_path<P: AsRef<Path>>(path: P) -> Result<PathBuf> {\n        let path = path.as_ref();\n        if !path.exists() {\n            bail!(\"Path `{}` doesn't exist\", path.display());\n        }\n\n        env::current_dir()\n            .and_then(|mut p| {\n                p.push(path); // If path is absolute, it replaces the current path.\n                std::fs::canonicalize(p)\n            })\n            .with_context(|| format!(\"Failed to access path `{}`\", path.display()))\n    }\n\n    fn sanitize_assets_path<P: AsRef<Path>>(path: P) -> Result<PathBuf> {\n        let path = Self::sanitize_path(path)?;\n        if !path.join(\"index.html\").exists() {\n            bail!(\"Path `{}` doesn't contains index.html\", path.display());\n        }\n        Ok(path)\n    }\n}\n\n#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord)]\npub enum BindAddr {\n    IpAddr(IpAddr),\n    #[cfg(unix)]\n    SocketPath(String),\n}\n\nimpl BindAddr {\n    fn parse_addrs(addrs: &[&str]) -> Result<Vec<Self>> {\n        let mut bind_addrs = vec![];\n        #[cfg(not(unix))]\n        let mut invalid_addrs = vec![];\n        for addr in addrs {","sourceCodeStart":458,"sourceCodeEnd":494,"githubUrl":"https://github.com/sigoden/dufs/blob/fe7fd564f80dfbac361c8e0589c3845638149d38/src/args.rs#L458-L494","documentation":"sanitize_assets_path in src/args.rs first runs sanitize_path, then requires that the assets directory contains an index.html file. If <assets>/index.html is missing it bails with \"Path `<path>` doesn't contains index.html\". dufs serves the bundled UI from this directory, so an index.html is mandatory for custom asset overrides.","triggerScenarios":"Running dufs with --assets <dir> where <dir> exists but has no index.html; pointing --assets at a data directory, an empty folder, or a partially copied frontend build.","commonSituations":"Custom UI overrides where only some files were copied into the assets dir; CI build step that didn't emit index.html; pointing --assets at the served data root instead of the UI directory.","solutions":["Place an index.html in the directory passed to --assets","Copy the complete dufs frontend assets (including index.html) into the directory","Verify you passed the UI assets dir, not the data/share root","Re-run your frontend build if index.html failed to generate"],"exampleFix":"# before\ndufs --assets ./data\n# after\ncp -r dist/* ./custom-assets/   # ensure custom-assets/index.html exists\ndufs --assets ./custom-assets ./data","handlingStrategy":"validation","validationCode":"#!/bin/sh\nASSETS_DIR=./custom-assets\n[ -f \"$ASSETS_DIR/index.html\" ] || { echo \"$ASSETS_DIR/index.html missing\"; exit 1; }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Copy the full frontend build (including index.html) into the assets dir","Point --assets at the UI directory, never at the data root","Add an existence check for index.html to your deploy script"],"tags":["cli","assets","rust","configuration","missing-file"],"backgroundTag":"file-not-found","analyzedSha":"fe7fd564f80dfbac361c8e0589c3845638149d38","analyzedAt":"2026-09-09T13:01:22.843Z","contentChangedAt":"2026-09-09T13:01:22.843Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}