Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix failed to stat '/root/.gitconfig' issue on gitfs (bsc#1230944) (bsc#1234881) #699

Open
wants to merge 3 commits into
base: openSUSE/release/3006.0
Choose a base branch
from

Conversation

meaksh
Copy link
Member

@meaksh meaksh commented Jan 22, 2025

What does this PR do?

This PR ensures the right value for HOME environment is set during Pygit2 remote initialization, otherwise there are chances that it gets a wrong value depending on the execution stack.

Upstream PR: saltstack/salt#67186

Previous Behavior

The previous way of setting the HOME value for pygit2 gitfs remotes was done at _fetch function, there are chances, i.a. when fetching a non-existing branch, that HOME value gets wrongly replaced by /root/ in the corresponding MWorker, leading to errors like:

_pygit2.GitError: /var/cache/salt/master/git_pillar/xxxxx/master: failed to stat '/root/.gitconfig'

This error starts happening randomly until all the MWorker processes get the HOME value polluted and therefore leading always to get this exception when fetching from the gitfs remote.

New Behavior

The right value is set for HOME environment: /var/lib/salt/, and the value gets preserved on the MWorker processes even if there are exceptions fetching non-existing remotes.

Merge requirements satisfied?

[NOTICE] Bug fixes or features added to Salt require tests.

Commits signed with GPG?

Yes

Please review Salt's Contributing Guide for best practices.

See GitHub's page on GPG signing for more information about signing commits with GPG.

…sc#1234881)

This commit ensures the right HOME value is set during Pygit2 remote
initialization, otherwise there are chances that it gets a wrong value
depending on the execution stack.
Copy link
Contributor

@vzhestkov vzhestkov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants