{"record":{"id":"65c2092cb8e3ee5c","repo":"windmill-labs/windmill","slug":"file-not-found-filepath","errorCode":null,"errorMessage":"File not found: ${filePath}","messagePattern":"File not found: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/src/commands/dependencies/dependencies.ts","lineNumber":20,"sourceCode":"import { resolveWorkspace } from \"../../core/context.ts\";\nimport { GlobalOptions } from \"../../types.ts\";\nimport { colors } from \"@cliffy/ansi/colors\";\nimport { Command } from \"@cliffy/command\";\nimport * as log from \"../../core/log.ts\";\nimport * as wmill from \"../../../gen/services.gen.ts\";\nimport fs from \"node:fs\";\nimport { workspaceDependenciesPathToLanguageAndFilename } from \"../../utils/metadata.ts\";\nimport { readTextFileSync } from \"../../utils/utils.ts\";\n\nasync function push(\n  opts: GlobalOptions,\n  filePath: string,\n): Promise<void> {\n  const workspace = await resolveWorkspace(opts);\n  await requireLogin(opts);\n\n  if (!fs.existsSync(filePath)) {\n    throw new Error(`File not found: ${filePath}`);\n  }\n\n  const content = readTextFileSync(filePath);\n\n  // Use the existing pushWorkspaceDependencies function\n  await pushWorkspaceDependencies(\n    workspace.workspaceId,\n    filePath,\n    null,\n    content,\n  );\n}\n\nconst command = new Command()\n  .alias(\"deps\")\n  .description(\"workspace dependencies related commands\")\n  .command(\"push\", \"Push workspace dependencies from a local file\")\n  .arguments(\"<file_path:string>\")","sourceCodeStart":2,"sourceCodeEnd":38,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/cli/src/commands/dependencies/dependencies.ts#L2-L38","documentation":"`wmill dependency push <filePath>` uploads a workspace dependencies file. Before reading, it checks `fs.existsSync(filePath)` and throws this error when the file does not exist on the local filesystem, aborting before any network call.","triggerScenarios":"Running `wmill dependency push` with a path that doesn't exist — typo in filename, wrong working directory, file deleted, or passing the directory instead of the file.","commonSituations":"Running from a different cwd in CI than locally; pushing `requirements.in` but the project uses `requirements.txt`; relative vs absolute path confusion in scripts.","solutions":["Verify the path: `ls <filePath>` from the same directory you run wmill in.","Run the command from the project root or pass an absolute path.","Check the file name matches a supported format (package.json, requirements.in, composer.json, go.mod, modules.json)."],"exampleFix":"// before\nawait $`wmill dependency push ./deps/reqirements.in`;\n// after\nawait $`wmill dependency push ./deps/requirements.in`;","handlingStrategy":"validation","validationCode":"import { existsSync } from 'node:fs';\nif (!existsSync(filePath)) throw new Error(`dependencies file missing: ${filePath} (cwd: ${process.cwd()})`);","typeGuard":"null","tryCatchPattern":"try { await pushDeps(file) } catch (e) { if (String(e).startsWith('File not found')) console.error(`check path, cwd=${process.cwd()}`); throw e; }","preventionTips":["Run push from the project root or use absolute paths","Verify filename spelling and supported extensions before pushing","In CI, assert the file exists in a pre-step for clearer failures"],"tags":["cli","filesystem","file-not-found","dependencies"],"backgroundTag":"file-not-found","analyzedSha":"e474e8803ce2ff5c2df09a58dab51d45f5c922ca","analyzedAt":"2026-09-03T12:38:19.024Z","contentChangedAt":"2026-09-03T12:38:19.024Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}