{"record":{"id":"0f7a1055d3a87bcb","repo":"jdx/mise","slug":"remote-task-path-is-not-a-regular-file-or-director","errorCode":null,"errorMessage":"remote task path is not a regular file or directory: {}","messagePattern":"remote task path is not a regular file or directory: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/task/task_file_providers/remote_task_git.rs","lineNumber":80,"sourceCode":"        Self {\n            url_without_path: url_without_path.to_string(),\n            path: path.to_string(),\n            branch,\n        }\n    }\n}\n\nimpl RemoteTaskGit {\n    /// Make fetched task files executable while leaving task include directories intact.\n    fn prepare_remote_path(path: &PathBuf) -> Result<()> {\n        let metadata = path.symlink_metadata()?;\n        if metadata.file_type().is_file() {\n            return file::make_executable(path);\n        }\n        if metadata.file_type().is_dir() {\n            return Ok(());\n        }\n        eyre::bail!(\n            \"remote task path is not a regular file or directory: {}\",\n            display_path(path)\n        )\n    }\n\n    fn get_cache_key(&self, repo_structure: &GitRepoStructure) -> String {\n        let key = format!(\n            \"{}{}\",\n            repo_structure.url_without_path,\n            repo_structure.branch.to_owned().unwrap_or(\"\".to_string())\n        );\n        hash::hash_sha256_to_str(&key)\n    }\n\n    fn get_repo_structure(&self, file: &str) -> GitRepoStructure {\n        RemoteSource::parse_git(file)\n            .map(|source| source.into())\n            .unwrap()","sourceCodeStart":62,"sourceCodeEnd":98,"githubUrl":"https://github.com/jdx/mise/blob/9dcfcaa0dc8747a2577d3270b69bb9d8313b2807/src/task/task_file_providers/remote_task_git.rs#L62-L98","documentation":"After mise clones a remote-tasks git repository, prepare_remote_path() chmods fetched regular files and leaves directories intact. It stats with symlink_metadata, so a symlink - which is neither a regular file nor a directory to lstat - bails with 'remote task path is not a regular file or directory'. The same applies to any other special file type found where a task file is expected.","triggerScenarios":"The remote tasks repository contains a symlink where a task file or include path is expected; on checkout (Linux/macOS, or Windows with core.symlinks=true) the path is a real symlink and prepare_remote_path rejects it when making task files executable.","commonSituations":"Monorepos sharing one task file between packages via symlink; a symlinked directory of tasks; repos where a setup script linked files into the tasks directory.","solutions":["Replace the symlink with the real file (or a copy) in the tasks repo and commit it","Duplicate shared task files instead of symlinking them","Use mise's task include mechanisms rather than filesystem links"],"exampleFix":"# before: tasks/deploy.sh is a symlink\nln -s ../shared/deploy.sh tasks/deploy.sh\n# after: a real file\ncp ../shared/deploy.sh tasks/deploy.sh","handlingStrategy":"validation","validationCode":"// lint the tasks repo so symlinks never reach prepare_remote_path:\nfor entry in walkdir::WalkDir::new(&tasks_dir).follow_links(false) {\n    let e = entry?;\n    if !e.file_type().is_file() && !e.file_type().is_dir() {\n        return Err(eyre::bail!(\"non-regular task path: {}\", e.path().display()));\n    }\n}","typeGuard":"fn is_regular_or_dir(path: &std::path::Path) -> bool {\n    path.symlink_metadata()\n        .map(|m| m.file_type().is_file() || m.file_type().is_dir())\n        .unwrap_or(false)\n}","tryCatchPattern":"match fetch_remote_tasks(&source).await {\n    Ok(tasks) => tasks,\n    Err(err) if err.to_string().contains(\"not a regular file or directory\") => {\n        eprintln!(\"replace the symlinked task file in {} with a real file\", source.repo);\n        Err(err) // a config/repo fix is required; retrying changes nothing\n    }\n    Err(err) => return Err(err),\n}","preventionTips":["Commit real files, not symlinks, in remote-task repositories","Add a CI lint that rejects symlinks inside the tasks directory","Share task logic via includes or duplicated files, not filesystem links","If symlinks are required for local dev, keep them out of the synced tasks dir"],"tags":["mise","remote-tasks","git","symlink","filesystem"],"backgroundTag":"unsupported-file-type","analyzedSha":"9dcfcaa0dc8747a2577d3270b69bb9d8313b2807","analyzedAt":"2026-08-17T14:28:50.624Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}