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

`java.nio.file.AccessDeniedException` while Jenkins deletes the workspace.

IntermediateTroubleshootingJenkins Build and Agent Failures
Answer

Likely causes → A container build created root-owned files in the mounted workspace; open file handles on Windows.

Diagnose → ls -ln workspace/ and compare to the Jenkins user's UID.

Fix → Run the container with -u $(id -u):$(id -g), or delete the files via a container as root; on Windows stop locking processes.

Prevent → Always run build containers as the agent's UID, and use ephemeral agents.

All CI/CD questions Roadmap: CI/CD fundamentals

More on Jenkins Build and Agent Failures