Wrong working directory

A command ran in an unexpected working directory.

working-directory medium confidence build

Matched signals

  • no such file or directory
  • cannot find the path specified
  • chdir
  • not a git repository
  • error: no such file
  • working directory not found
  • failed to change directory

Wrong working directory

What this failure means

A command ran in an unexpected working directory. Relative paths expected a specific directory layout that did not exist at the time of execution.

Symptoms

Faultline looks for one or more of these log fragments:

no such file or directory
cannot find the path specified
chdir
not a git repository
error: no such file
working directory not found
failed to change directory

Diagnosis

A command ran in an unexpected working directory. Relative paths expected a specific directory layout that did not exist at the time of execution.

Fix steps

  1. Check the working-directory configuration in your CI workflow file.
  2. Use absolute paths or $(pwd) references where possible.
  3. Add ls -la before the failing step to confirm the directory contents.
  4. Verify the repository structure matches what the workflow expects.

Validation

  • Re-run the failing workflow step.
  • Confirm the original failure signature for Wrong working directory is gone.

Why it matters

CI jobs sometimes change directory as part of a step but fail to restore the original directory, or a working-directory configuration in the workflow file points to a path that does not exist in the checked-out repository.

Prevention

  • Use explicit working-directory steps rather than relying on implicit directory state.
  • Document expected working directory requirements in step names or comments.
  • Add a directory existence check at the start of jobs that depend on specific paths.
  • Prefer commands anchored from the repository root in reusable scripts so directory assumptions are not duplicated across workflows.

How Faultline detects it

Use faultline explain working-directory to see the full playbook.

faultline analyze build.log
faultline explain working-directory

Generated from playbooks/bundled/log/build/working-directory.yaml. Do not edit directly.

Try it on your own failed log

$ faultline analyze failed.log
Want this across every CI run? Faultline Teams tracks recurring failures across all your repos and surfaces patterns in a shared dashboard.