Gitfs integration with SaltStack results in error_pygit2.GitError: too many redirects or authentication replays
search cancel

Gitfs integration with SaltStack results in error_pygit2.GitError: too many redirects or authentication replays

book

Article ID: 419945

calendar_today

Updated On:

Products

VCF Operations/Automation (formerly VMware Aria Suite)

Issue/Introduction

Your organization is using Github.com for their version control system and are trying to integrate the Salt master, but you seen an error like the following either when running a command like "salt-run -l debug fileserver.update backend=gitfs" or in the Salt master log file, /var/log/salt/master

[DEBUG   ] Fetching gitfs remote 'https://github.com/<ORG>/<REPO>.git
[ERROR   ] Error occurred fetching gitfs remote 'https://github.com/<ORG>/<REPO>.git: too many redirects or authentication replays
Traceback (most recent call last):
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/gitfs.py", line 2135, in _fetch
    fetch_results = origin.fetch(**fetch_kwargs)
  File "/opt/saltstack/salt/extras-3.10/pygit2/remotes.py", line 245, in fetch
    payload.check_error(err)
  File "/opt/saltstack/salt/extras-3.10/pygit2/callbacks.py", line 111, in check_error
    check_error(error_code)
  File "/opt/saltstack/salt/extras-3.10/pygit2/errors.py", line 67, in check_error
    raise GitError(message)
_pygit2.GitError: too many redirects or authentication replays

Environment

SaltProject - all versions

Cause

The GitFS configuration is likely configured to authenticate to Github with a user name and password which is no longer supported by Github. See https://github.blog/changelog/2021-08-12-git-password-authentication-is-shutting-down/ for more information.

Resolution

The user must create a personal access token through their Github.com site with access to the "Content" under the fine grain tokens section. See Github.com's documentation on how to create this token for your service account that will be used to authenticate.

 

Additional Information

If using the pygit2 driver for your GitFS integration, then users may also be able to use a SSH key to authenticate to Github as well.

https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account