{"record":{"id":"1a0f915fe69b14d9","repo":"wasmerio/wasmer","slug":"failed-to-determine-file-type-for","errorCode":null,"errorMessage":"failed to determine file type for '{}'","messagePattern":"failed to determine file type for '(.+?)'","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"lib/sdk/src/app/deploy_remote_build.rs","lineNumber":328,"sourceCode":"            .git_global(true)\n            .require_git(true)\n            .parents(true)\n            .follow_links(false);\n\n        // Ignore .shipit directories, since they are for local use only.\n        let mut overrides = ignore::overrides::OverrideBuilder::new(\".\");\n        overrides.add(\"!.shipit\").expect(\"valid override\");\n        b.overrides(overrides.build()?);\n\n        b.build()\n    };\n\n    let entries = walker.into_iter();\n    for entry in entries {\n        let entry = entry?;\n\n        let ty = entry.file_type().ok_or_else(|| {\n            anyhow::anyhow!(\n                \"failed to determine file type for '{}'\",\n                entry.path().display()\n            )\n        })?;\n\n        let rel_path = entry.path().strip_prefix(base_dir)?;\n\n        if ty.is_symlink() {\n            bail!(\n                \"cannot deploy projects containing symbolic links (found '{}')\",\n                rel_path.display()\n            );\n        }\n\n        let rel_str = rel_path.to_string_lossy().replace('\\\\', \"/\");\n\n        if ty.is_dir() {\n            writer.add_directory(format!(\"{rel_str}/\"), SimpleFileOptions::default())?;","sourceCodeStart":310,"sourceCodeEnd":346,"githubUrl":"https://github.com/wasmerio/wasmer/blob/8c4b9ee9d33fb2068863fbb3d328683e7e6ff7f5/lib/sdk/src/app/deploy_remote_build.rs#L310-L346","documentation":"create_zip_archive in lib/sdk/src/app/deploy_remote_build.rs walks the app directory and needs each entry's file type to decide how to add it to the zip. `entry.file_type()` (from the DirEntry walker) returns None when the type cannot be determined (e.g. broken symlink or an io error statting the entry), and the code then raises this error naming the path.","triggerScenarios":"Zipping an app directory containing a dangling symlink, a file removed between directory walk and stat (race), or a filesystem where file_type metadata is unavailable (some network/FUSE mounts).","commonSituations":"App folder contains a symlink to a nonexistent target (e.g. node_modules/.bin links after partial install); files changing while `wasmer deploy` runs; deploying from an NFS/SMB share with flaky metadata; permission-restricted files.","solutions":["Find and remove/fix broken symlinks: `find . -xtype l` inside the app directory, delete or repoint them.","Ensure nothing else is modifying the directory during deploy (stop watchers/builders, then retry).","Add problematic paths to .wasmerignore / .gitignore so the walker skips them.","Copy the app to a local filesystem directory and deploy from there if on a network mount.","Check permissions: `ls -la` the reported path to confirm it is stat-able by your user."],"exampleFix":"// shell: before deploying, clean dangling symlinks\nfind . -xtype l -print -delete\nwasmer deploy\n// or in .wasmerignore\nnode_modules\nlink-to-nowhere","handlingStrategy":"validation","validationCode":"# shell: detect dangling symlinks in the app dir before deploying\nfind . -xtype l -print\n# exit non-zero if any found, fix before `wasmer deploy`","typeGuard":"fn is_statable(e: &walkdir::DirEntry) -> bool { e.file_type().is_some() }","tryCatchPattern":"match create_zip_archive(&dir, &out) {\n    Err(e) if e.to_string().contains(\"failed to determine file type\") => {\n        eprintln!(\"{e}\\nHint: remove broken symlinks: find . -xtype l -delete\");\n        std::process::exit(1);\n    }\n    other => other,\n}","preventionTips":["Run `find . -xtype l` in CI before packaging to catch dangling symlinks","Ignore volatile directories (node_modules, .cache) via .wasmerignore","Avoid deploying from network/FUSE mounts; copy to local disk first","Freeze writes to the app directory during deploy (stop dev servers/watchers)"],"tags":["rust","filesystem","zip","symlink","deploy"],"backgroundTag":"broken-symlink","analyzedSha":"8c4b9ee9d33fb2068863fbb3d328683e7e6ff7f5","analyzedAt":"2026-09-01T23:06:31.009Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}