Detected dubious ownership in repository with Jenkins upgrade

I am currently in the process of trying to upgrade from Jenkins 2.384 to 2.394 as a regular upgrade we do.

In our test environment we are running into an issue where now any git checkouts (even if they are new, I created a test job to verify) will give the error:
detected dubious ownership in repository at xyz
if it is in a freestyle project
stderr: fatal: not in a git directory
if it is a pipeline, I figured the first is likely just somehow being masked by the pipeline and is the actual issue.

Our setup:
Jenkins is deployed to Amazon ECS, the head node has no executers. All of the agents are spun up through fargate.

The agent is based on “jenkins/inbound-agent”
And the Jenkins server is based on “jenkins/jenkins:jdk11”
We do make some modifications to both images.

We mount an EFS on the agents through an access point so all of the workspaces are shared.

How all of that is handled is the same between both environments, the only difference is the new agent and server container, and the only difference is that it pulled a newer version of the container.

I am hoping that there may just be some change that I can’t find that may point why this is happening. Especially for a job with a new checkout giving this error.


Update, I wanted to try to see if maybe I could find a solution that wasn’t a drastic one just to see what would happen.

So in the agent dockefle I set:

git config --global --add '*'

This fixed the issue for a freestyle project but not for the pipeline.
Both of the jobs are cloning the same repo and has the same configuration for the git checkout except for pipeline vs freestyle.

The error message for the pipeline has not changed so I am fully at a loss now.

1 Like


I encountered a similar problem and found the solution here: Github checkout fails with status code 128 · Issue #728 · jenkinsci/helm-charts · GitHub
In my values.yaml file there was storageClass defined as efs-sc. After removing it the pipeline worked.

You need to run it on the master as the intial check out would happen there

i ran it and it fixed the issue for me

HI, I am facing same issue. have you find any solution?