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

gitfs fails with pygit2 v0.27.4 #51664

Closed
amendlik opened this issue Feb 15, 2019 · 1 comment
Closed

gitfs fails with pygit2 v0.27.4 #51664

amendlik opened this issue Feb 15, 2019 · 1 comment
Labels
Bug broken, incorrect, or confusing behavior Duplicate Duplicate of another issue or PR - will be closed P2 Priority 2 severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around
Milestone

Comments

@amendlik
Copy link
Contributor

Description of Issue/Question

Using gitfs with the lastest version of pygit2 (v0.27.4) causes a stack trace:

2019-02-14 23:55:45,939 [salt.master                              :448 ][ERROR   ][33914] Uncaught exception while updating gitfs fileserver cache
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/salt/master.py", line 444, in _do_update
    update_func(*args)
  File "/usr/local/lib/python3.6/site-packages/salt/fileserver/gitfs.py", line 133, in update
    _gitfs().update(remotes)
  File "/usr/local/lib/python3.6/site-packages/salt/utils/gitfs.py", line 2412, in update
    self.find_file
  File "/usr/local/lib/python3.6/site-packages/salt/fileserver/__init__.py", line 256, in reap_fileserver_cache_dir
    ret = find_func(filename, saltenv=saltenv)
  File "/usr/local/lib/python3.6/site-packages/salt/utils/gitfs.py", line 2755, in find_file
    blob, blob_hexsha, blob_mode = repo.find_file(repo_path, tgt_env)
  File "/usr/local/lib/python3.6/site-packages/salt/utils/gitfs.py", line 1809, in find_file
    tree = self.get_tree(tgt_env)
  File "/usr/local/lib/python3.6/site-packages/salt/utils/gitfs.py", line 1016, in get_tree
    candidate = func(tgt_ref)
  File "/usr/local/lib/python3.6/site-packages/salt/utils/gitfs.py", line 1852, in get_tree_from_branch
    'refs/remotes/origin/{0}'.format(ref)).get_object().tree
AttributeError: '_pygit2.Reference' object has no attribute 'get_object'

According to the pygit2 CHANGELOG, Reference.get_object() was deprecated in v0.21.4 (November, 2014), and removed entirely in v0.27.4 (January, 2019)

Versions Report

Salt Version:
           Salt: 2018.3.3
 
Dependency Versions:
           cffi: 1.11.5
       cherrypy: unknown
       dateutil: Not Installed
      docker-py: Not Installed
          gitdb: Not Installed
      gitpython: Not Installed
          ioflo: Not Installed
         Jinja2: 2.10
        libgit2: 0.27.7
        libnacl: Not Installed
       M2Crypto: Not Installed
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.6.1
   mysql-python: Not Installed
      pycparser: 2.18
       pycrypto: 2.6.1
   pycryptodome: Not Installed
         pygit2: 0.27.4
         Python: 3.6.8 (default, Feb  8 2019, 21:14:59)
   python-gnupg: Not Installed
         PyYAML: 3.13
          PyZMQ: 17.1.2
           RAET: Not Installed
          smmap: Not Installed
        timelib: Not Installed
        Tornado: 4.5.3
            ZMQ: 4.3.1
 
System Versions:
           dist:   
         locale: UTF-8
        machine: amd64
        release: 11.2-STABLE
         system: FreeBSD
        version: Not Installed
@garethgreenaway garethgreenaway added this to the Approved milestone Feb 19, 2019
@garethgreenaway garethgreenaway added severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around bugfix-bckport will be be back-ported to an older release branch by creating a PR against that branch P2 Priority 2 Bug broken, incorrect, or confusing behavior Duplicate Duplicate of another issue or PR - will be closed and removed bugfix-bckport will be be back-ported to an older release branch by creating a PR against that branch labels Feb 19, 2019
@garethgreenaway
Copy link
Contributor

Duplicate of #51270 and fixed in #51304

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior Duplicate Duplicate of another issue or PR - will be closed P2 Priority 2 severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around
Projects
None yet
Development

No branches or pull requests

2 participants