Interview Prep/CI/CD/Jenkins Build and Agent Failures

`fatal: detected dubious ownership in repository at '/var/jenkins_home/workspace/x'`.

IntermediateTroubleshootingJenkins Build and Agent Failures
Answer

Likely causes → Workspace owned by a different user than the one running git (common with containers).

Diagnose → ls -ld on the directory and id in the build.

Fix → Run containers with the matching UID, or git config --global --add safe.directory '*' as a last resort in ephemeral build images.

Prevent → Align UID/GID between host and container agents.

All CI/CD questions Roadmap: CI/CD fundamentals

More on Jenkins Build and Agent Failures