Skip to content

Address infinite loop in gitprocessexception while invoking push #9208

@scbedd

Description

@scbedd

@skadhiresan reported a very interesting issue where the test-proxy entered an infinite loop of retrying the git push command before erroring. Looking something like [1].

On running the failing push command with debug mode enabled, the issue became apparent:

PS C:\Users\skadhiresan\source\repos\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources> test-proxy push -a ./assets.json
Running proxy version is Azure.Sdk.Tools.TestProxy 20240919.1
git --version
StdOut: git version 2.47.0.windows.1
 
StdErr:
ExitCode: 0
git remote -v
StdOut: origin  https://github.com/skadhiresan/azure-sdk-for-net.git (fetch)
origin  https://github.com/skadhiresan/azure-sdk-for-net.git (push)
 
StdErr:
ExitCode: 0
git remote set-url origin https://github.com/Azure/azure-sdk-assets
StdOut:
StdErr: fatal: detected dubious ownership in repository at 'C:/Users/skadhiresan/source/repos/azure-sdk-for-net/.assets/sztCmI9VWt'
'C:/Users/skadhiresan/source/repos/azure-sdk-for-net/.assets/sztCmI9VWt' is owned by:
        BUILTIN/Administrators (S-1-5-32-544)
but the current user is:
        REDMOND/skadhiresan (S-1-12-1-2625456001-1339269914-2951898773-3550298200)
To add an exception for this directory, call:
 
        git config --global --add safe.directory C:/Users/skadhiresan/source/repos/azure-sdk-for-net/.assets/sztCmI9VWt
 
ExitCode: 128
Exception of type 'Azure.Sdk.Tools.TestProxy.Common.Exceptions.GitProcessException' was thrown.
Unhandled exception:
PS C:\Users\skadhiresan\source\repos\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources>

We checked that this issue disappeared if we ran the test-proxy push from the same elevated command prompt. It worked flawlesslyl. This proves to me that it's a permissions issue. The real problem is that the proxy is hiding these file permissions error behind a wall of exception output.

This issue covers addressing the infinite loop so that the exception can dump out immediately.

[1]
Image
Image

Metadata

Metadata

Assignees

Labels

Asset-SyncAny issues relating to moving test assets out of repos.

Type

No type

Projects

Status

🎊 Closed

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions