5024: Unable to add local git repo to reviewboard

jvolpe

What version are you running?

6.02

We host gitolite and Review Board on the same server so Review Board should have direct access to the git repos.

This has all worked in the past and existing repos configured the same way still work correctly for code reviews. This must be the result of either the 6.02 update or a git update as part of a regular server update procedure

I am simply trying to add another repo to Review Board and it fails.

What steps will reproduce the problem?

  1. See screenshot attached

With logging set to DEBUG I get the following in /var/www/log/reviewboard.log

2024-06-21 18:23:30,941 - ERROR - - reviewboard.scmtools.git - Git: Failed to find valid repository file:///home/gitolite/repositories/project.git: b"fatal: detected dubious ownership in repository at '/home/gitolite/repositories/project.git'\nTo add an exception for this directory, call:\n\n\tgit config --global --add safe.directory /home/gitolite/repositories/project.git\nfatal: Could not read from remote repository.\n\nPlease make sure you have the correct access rights\nand the repository exists.\n"

The repo directory is set as follows :

jvolpe@server:~$ sudo ls -l /home/gitolite/repositories/
total 444
drwxr-xr-x 7 gitolite gitolite 4096 Jun 19 19:29 project.git

I tried to add the repo as a safe directory, per log message, for git under www-data user (/var/www/.gitconfig) and that failed to fix the problem.

What is the expected output? What do you see instead?

I expect the repo to be added instead I gte an erro message

What operating system are you using? What browser?

Review Board is running on Linux Server running Ubuntu 22.04
Firefox browser
Review Board is running from Apache as virtual host user www-data

Please provide any additional information below.

david
#1 david

A new version of git has tightened up the rules for when it will access a .git directory owned by another user on the system, even if permissions are set to allow it. You should be able to get around this by running this commend as a privileged user:

git config --system --add safe.directory '*'

  • -New
    +SetupIssue
#2 jvolpe

Thanks that fixed the problem.