John Klug
John Klug

Reputation: 131

git rev-parse HEAD fails in Jenkins with bitbake after switching to https from clear git

The problem is that the command:

git rev-parse HEAD

inside of the retrieved repository fails when retrieved under https but only on our Jenkins server called by bitbake.

I have switched our Jenkins server build back and forth between: https://git.multitech.net/cgit/mlinux.git/ and git://git.multitech.net/mlinux.git

If I do this outside of bitbake and Jenkins this works fine. Running in Jenkins works fine. Running bitbake outside of Jenkins is fine. But the combination of bitbake and Jenkins fails.

I ran strace, and in a successful git rev-parse HEAD, it calls geteuid().

In the unsuccessful case, run from bitbake, it never calls geteuid(). It is supposedly running as the same user. In the same bitbake execution, it returns the same UID every time in other commands run prior to git rev-parse HEAD.

If you look at the execution of git, it calls lstat on the directory in question eight times and gets st_uid=1001 each time. Each time the result is 0, which the source also checks.

The error:

fatal: detected dubious ownership in repository at '/home/jenkins/workspace/mlinux/nightly'
To add an exception for this directory ...

Since the code never called geteuid() in this case, how does it know the directory is of dubious ownership? I have also tried using env -i to remove the environment from the execution of git by wrapping it with a shell script. This did not help.

root@buildslavemtcdt3dm2:/home/jenkins/workspace/mlinux# find nightly ! -user 1001
[Nothing is returned]

Upvotes: 1

Views: 751

Answers (0)

Related Questions