doc-en icon indicating copy to clipboard operation
doc-en copied to clipboard

fatal: detected dubious ownership in repository at '/var/www/doc-base'

Open pereorga opened this issue 1 year ago • 2 comments

It happens when I run make on a clean branch on this repo:

/dev/doc-en$ make
docker build .docker -t php/doc-en
[+] Building 6.0s (5/12)                                                                                                        docker:default
 => [internal] load build definition from Dockerfile                                                                                      0.0s
 => => transferring dockerfile: 685B                                                                                                      0.0s
 => [internal] load metadata for docker.io/library/php:8.2-cli                                                                            1.6s
 => [internal] load .dockerignore          
[...]
 => exporting to image                                                                                                                   0.8s
 => => exporting layers                                                                                                                  0.8s
 => => writing image sha256:7d2764eca497e1282db787a4c1ed74824f010d8b0fa10638d6040657d689a061                                             0.0s
 => => naming to docker.io/php/doc-en                                                                                                    0.0s

 1 warning found (use docker --debug to expand):
 - JSONArgsRecommended: JSON arguments recommended for CMD to prevent unintended behavior related to OS signals (line 18)
touch .docker/built
docker run --rm -v .:/var/www/en -w /var/www -u 1000:1000 php/doc-en
configure.php on PHP 8.2.27

fatal: detected dubious ownership in repository at '/var/www/doc-base'
To add an exception for this directory, call:

	git config --global --add safe.directory /var/www/doc-base
doc-base/temp clean up FAILED.
make: *** [Makefile:22: xhtml] Error 1

Reproduced on both Ubuntu 24.04.1 and macOS.

pereorga avatar Jan 11 '25 18:01 pereorga

Same issue here. A few different workarounds (that worked for me during testing) are:

  • Don't use Docker :)
  • To use Docker, checkout the doc-base repo next to doc-en as done when not using Docker (then it's used instead of attempting to use from the docker container as per Makefile) -- checking out phd is optional in this case as the error appears doc-base specific
  • Use the previous docker-compose up method before commit https://github.com/php/doc-en/commit/1ef0cab7c2af732b9ad043e9faf68b080b7f1200 (which would include re-adding docker-compose.yml)

I can't provide a true fix but the above options worked for me. I personally went the non-docker route.

philip avatar Feb 20 '25 16:02 philip

Hi @pereorga @philip, I noticed this might be related, could help once https://github.com/php/doc-en/pull/4962 gets merged. 🙂

lacatoire avatar Nov 10 '25 20:11 lacatoire