{"record":{"id":"bfa7f2a94412de90","repo":"jdx/mise","slug":"cannot-write-task-stub-because-is-not-a-regular","errorCode":null,"errorMessage":"cannot write task stub because {} is not a regular file","messagePattern":"cannot write task stub because (.+?) is not a regular file","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/generate/task_stubs.rs","lineNumber":236,"sourceCode":"            Ok(metadata) if metadata.file_type().is_dir() => {\n                validate_generated_stub_directory(&stub.path, &stub.output, stub.task)?;\n                migrations.insert(StubMigration::Directory(stub.path.clone()));\n            }\n            Ok(metadata) if metadata.file_type().is_symlink() => bail!(\n                \"cannot write task stub because {} is a symbolic link\",\n                display_path(&stub.path)\n            ),\n            Ok(metadata) if metadata.file_type().is_file() => {\n                let existing = file::read_to_string(&stub.path)?;\n                let legacy_leaf = stub.legacy_path == stub.path && existing == stub.legacy_output;\n                if existing != stub.output && !legacy_leaf {\n                    bail!(\n                        \"cannot write task stub because {} is not a generated task stub\",\n                        display_path(&stub.path)\n                    );\n                }\n            }\n            Ok(_) => bail!(\n                \"cannot write task stub because {} is not a regular file\",\n                display_path(&stub.path)\n            ),\n            Err(err) if matches!(err.kind(), ErrorKind::NotFound | ErrorKind::NotADirectory) => {}\n            Err(err) => return Err(err.into()),\n        }\n        validate_launcher_path(stub)?;\n        for parent in stub.path.ancestors().skip(1) {\n            match fs::symlink_metadata(parent) {\n                Ok(metadata)\n                    if metadata.file_type().is_dir()\n                        || migrations.contains(&StubMigration::File(parent.to_path_buf())) => {}\n                Ok(_) => bail!(\n                    \"cannot create task stub directory because {} is not a directory\",\n                    display_path(parent)\n                ),\n                Err(err)\n                    if matches!(err.kind(), ErrorKind::NotFound | ErrorKind::NotADirectory) => {}","sourceCodeStart":218,"sourceCodeEnd":254,"githubUrl":"https://github.com/jdx/mise/blob/9dcfcaa0dc8747a2577d3270b69bb9d8313b2807/src/cli/generate/task_stubs.rs#L218-L254","documentation":"The stub path exists but is not a regular file (and not one of the directory/symlink cases handled elsewhere) — typically a fifo or socket. mise cannot write a stub onto a special file, so it aborts with the offending path.","triggerScenarios":"`mise generate task-stubs` with a special file at bin/<task> or bin/<parent>/_default (mkfifo leftover, socket, device node).","commonSituations":"Artifacts dropped into bin/ by other tooling; broken mounts; experiments left behind.","solutions":["Delete the special file: `rm bin/<task>`","Regenerate with a different --dir","Rename the task so its stub path avoids the object"],"exampleFix":"# before\n$ rm -f bin/lint && mkfifo bin/lint   # accidental leftover\n$ mise generate task-stubs\n# error: bin/lint is not a regular file\n\n# after\n$ rm bin/lint\n$ mise generate task-stubs","handlingStrategy":"type-guard","validationCode":"#!/bin/bash\nfind bin -mindepth 1 ! -type d ! -type f ! -type l -print -quit | grep -q . \\\n  && { echo 'special file under bin/' >&2; exit 1; }\nmise generate task-stubs","typeGuard":"is_regular_or_absent() {\n  [ ! -e \"$1\" ] || { [ -f \"$1\" ] && [ ! -L \"$1\" ]; }\n}","tryCatchPattern":null,"preventionTips":["Keep the stub directory limited to regular files and directories","Clean experimental fifos/sockets out of bin/ before generating"],"tags":["mise","task-stubs","file-type","generate"],"backgroundTag":"unsupported-file-type","analyzedSha":"9dcfcaa0dc8747a2577d3270b69bb9d8313b2807","analyzedAt":"2026-08-17T14:28:50.624Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}