dubious ownership in repository
We are trying to use Git for Source Code control in our existing application. Currently all Source Control is a manual process. We are running IRIS on a Windows server. The git extension has been installed and initial configuration done. We do get the git tab in Studio. We keep getting the following error:
fatal: detected dubious ownership in repository at 'C:/KBS/dev/server/db'
'C:/KBS/dev/server/db' is owned by:
'S-1-1-0'
but the current user is:
'S-1-5-18'
To add an exception for this directory, call: git config --global --add safe.directory C:/KBS/dev/server/db.
Tried [ git config --global --add safe.directory C:/KBS/dev/server/db ] in git bash with and without quotes. No change.
Tried [ git config --global --add safe.directory "*" ] single and double quotes in git bash with and without double quotes. No change.
Tried changing the owner of the folder in Windows, but cannot find 'S-1-5-18' as a user in Windows.
Most of our attempts have been in git or Windows with no affect. We suspect there is something in IRIS that we need to do as we are trying to use git source control within IRIS. Using it in git bash only lets us put IRIS.DAT into the repository. Which is not very helpful.
@Alan Watts - to clarify, can you please confirm that you are trying to use Embedded (aka Server-side) source control using the git-source-control package from OEM?
Yes, as far as I know.
User S-1-5-18 is (Local) Sytem a hidden account, https://learn.microsoft.com/en-us/windows-server/identity/ad-ds/manage/u.... git config --global --add safe.directory' command.
Your IRIS server is probably running under the System account.
I'm using a Git plugin for Studio and let that background process execute the '
@Herman Slagman how did you have the background process do that? (Just curious; this could be simpler.)
In the Git plugin, a %Studio.SourceControl.Base subclass , I get the active branch
Set Active=##class(Git.Utils).GetActiveBranch(Repos.Directory)
Set Command="cd "_Repository.Directory_" && git config --global --add safe.directory "_Dir
If Active["fatal" {
Set sc=##class(Git.Utils).AddToSaveList(Repos.Name)
}
If that gets a fatal I call:
Set sc=..CPipe(Command,.Output)
This process runs under the Studio account
Where and how did you get the Git plugin for Studio? This is what we thought might be the solution. But we thought we had already installed any extensions/ add-ons needed.
@Alan Watts - there is no client-side Git plugin for Studio. Studio works exclusively with server-side source-control hooks. This is what the git-source-control package on OEX is ... it is server-side source control hooks to allow multiple developers to properly interact with a git repo from a single Namespace within InterSystems IRIS. So once this is properly installed and configured for a given Namespace, once you connect via Studio you should see new top level Menu items in Studio and all changes will be governed by the source control hooks. Nothing else is needed to be installed on the developers' Studio instances in terms of plug-ins, etc.
It is a custom build Git Studio plugin plus application and CLI, that can handle multiple repositories per namespace. It is one of the reasons I still use Studio.
If I am understanding this correctly (I'm probably not), You go to the Git tab in Studio, select Launch Git UI (?). When i do that I get a small window with a red X button graphic and nothing else. I was thinking it would have a window to enter in the commands/ code you mention, I don't seem to get that.
No, if you build a Git plugin yourself, you will also have to build the Git menu and optional context menu.
Assuming this is with git-source-control, the approach would be to have the temp folder *and all subfolders* owned by SYSTEM (in this case), as discussed at https://github.com/intersystems/git-source-control?tab=readme-ov-file#du.... This is under folder Properties > Security > Advanced. Click "Change" next to "Owner", and under Object Names to Select type in "SYSTEM". Before applying, check the box with "Replace all child object permission entries..." at the bottom of the dialog. That should do it.
💡 This question is considered a Key Question. More details here.