Not able to clone a repo: fatal: detected dubious ownership in repository
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
diskimage-builder |
New
|
Undecided
|
Unassigned |
Bug Description
When I tried to create an Octavia Amphore on an ubuntu 22.04 with git 2.34.1
I have run in the following Error:
```
2023-08-24 09:12:23.484 | (0001 / 0002)
2023-08-24 09:12:23.500 | Updating cache of /home/sanders/
2023-08-24 09:12:23.512 | Cloning from amphora-agent cache and applying ref master
2023-08-24 09:12:23.682 | HEAD is now at a88aa18d Merge "Fix the issue of losing nf_conntrace* values after a reboot."
2023-08-24 09:12:23.684 | fatal: detected dubious ownership in repository at '/home/
2023-08-24 09:12:23.684 | To add an exception for this directory, call:
2023-08-24 09:12:23.684 |
2023-08-24 09:12:23.684 | git config --global --add safe.directory /home/sanders/
```
Please note that I set `TMP_DIR=
I was able to hotfix it with the follwoing path:
```
--- /usr/lib/
+++ /usr/lib/
@@ -171,6 +171,11 @@
+
+ echo "Git config add global ${REPO_DEST}"
+ sudo git config --global --add safe.directory ${REPO_DEST}
+ git config --global --add safe.directory ${REPO_DEST}
+
@@ -184,6 +189,10 @@
+ echo "Git config unset global ${REPO_DEST}"
+ sudo git config --global --unset safe.directory ${REPO_DEST}
+ git config --global --unset safe.directory ${REPO_DEST}
+
fi
```
The error message "fatal: detected dubious ownership in repository at '/home/ sanders/ tmp/x1/ dib_build. WIyP3c3x/ mnt/opt/ amphora- agent'" means that the folder '/home/ sanders/ tmp/x1/ dib_build. WIyP3c3x/ mnt/opt/ amphora- agent' is owned by someone else, not you. This can happen if another person made the folder or changed its ownership. To fix it, you added the folder to a special list in Git settings to avoid this check. But, this isn't very safe. A better way is to change the folder's ownership to yours. To do this, run: "sudo chown -R sanders /home/sanders/ tmp/x1/ dib_build. WIyP3c3x/ mnt/opt/ amphora- agent". After this, the error should go away. Remember: the special list applies to all your folders, don't use it for shared folders. Use "ls -l" to check ownership. Hope this helps! Ask if you need more help. Source: https:/ /www.poolservic esanantonio. us/pool- renovation- services/