You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
gitfs and git_pillar do not work with pygit2 >= 1.15.0, rasing exceptions as below:
[ERROR] Error in function _file_find:
Traceback (most recent call last):
File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/master.py", line 1927, in run_func
ret = getattr(self, func)(load)
File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/fileserver/__init__.py", line 547, in _find_file
return self.find_file(path, tgt_env)
File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/fileserver/__init__.py", line 599, in find_file
fnd = self.servers[fstr](path, saltenv, **kwargs)
File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 159, in __call__
ret = self.loader.run(run_func, *args, **kwargs)
File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 1245, in run
return self._last_context.run(self._run_as, _func_or_method, *args, **kwargs)
File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 1260, in _run_as
ret = _func_or_method(*args, **kwargs)
File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/fileserver/gitfs.py", line 160, in find_file
return _gitfs().find_file(path, tgt_env=tgt_env, **kwargs)
File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/gitfs.py", line 3246, in find_file
blob, blob_hexsha, blob_mode = repo.find_file(repo_path, tgt_env)
File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/gitfs.py", line 2280, in find_file
return blob, blob.hex, mode
AttributeError: '_pygit2.Blob' object has no attribute 'hex'
[ERROR] Unable to get SHA of HEAD for git_pillar remote 'master [email protected]:owner/saltstack.git'
[ERROR] Failed to checkout ubuntu-24.04 from git_pillar remote '__env__ [email protected]:owner/saltstack.git': '_pygit2.Commit' object has no attribute 'hex'
Traceback (most recent call last):
File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/gitfs.py", line 1842, in checkout
target_sha = self.peel(self.repo.lookup_reference(remote_ref)).hex
AttributeError: '_pygit2.Commit' object has no attribute 'hex'
@dmurphy18 those are separate issues. That pull request fixes only the oid getting deprecated. There's a separate issue with newer pygit2 where salt is failing to talk to git because of the aforementioned
AttributeError: '_pygit2.Blob' object has no attribute 'hex'
Description
gitfs and git_pillar do not work with pygit2 >= 1.15.0, rasing exceptions as below:
Setup
Steps to Reproduce the behavior
While filserver contents can be listed (e.g. with
salt-run fileserver.file_list
), a highstate cannot be run, and pillar appears empty.Expected behavior
Git features continue to work as with previous pygit2 versions.
Versions Report
salt --versions-report
Additional context
It seems like the fix for #66590 was never tested, as it still doesn't work.
The text was updated successfully, but these errors were encountered: