Skip to content

'_pygit2.Blob' object has no attribute 'oid' with 1.15.1 #1316

Open
@silviumc

Description

I use pygit2 with Salt Stack (3007.1 from pypi.org). I upgraded pygit from 1.12.1 to 1.15.1 and got errors in /var/log/salt/master. Downgraded pygit2 to 1.14.1 and now it works.

2024-09-06 14:46:44,464 [salt.master      :279 ][ERROR   ][26484] Uncaught exception while updating gitfs fileserver cache
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/salt/master.py", line 532, in _do_update
    update_func(*args)
  File "/usr/local/lib/python3.11/site-packages/salt/loader/lazy.py", line 160, in __call__
    ret = self.loader.run(run_func, *args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/salt/loader/lazy.py", line 1269, in run
    return self._last_context.run(self._run_as, _func_or_method, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/salt/loader/lazy.py", line 1284, in _run_as
    return _func_or_method(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/salt/fileserver/gitfs.py", line 138, in update
    _gitfs().update(remotes)
  File "/usr/local/lib/python3.11/site-packages/salt/utils/gitfs.py", line 2798, in update
    salt.fileserver.reap_fileserver_cache_dir(
  File "/usr/local/lib/python3.11/site-packages/salt/fileserver/__init__.py", line 273, in reap_fileserver_cache_dir
    ret = find_func(filename, saltenv=saltenv)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/salt/utils/gitfs.py", line 3157, in find_file
    blob, blob_hexsha, blob_mode = repo.find_file(repo_path, tgt_env)
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/salt/utils/gitfs.py", line 2176, in find_file
    blob = self.repo[entry.oid]
                     ^^^^^^^^^
AttributeError: '_pygit2.Blob' object has no attribute 'oid'

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions