saltstack / salt

Software to automate the management and configuration of any infrastructure or application at scale. Install Salt from the Salt package repositories here:
https://docs.saltproject.io/salt/install-guide/en/latest/
Apache License 2.0
14.2k stars 5.48k forks source link

pygit2 0.28.0 from pip breaks git ext_pillar #52356

Closed x70b1 closed 4 years ago

x70b1 commented 5 years ago

My first attempt was in this issue: https://github.com/saltstack/salt/issues/52319

It was closed because I used example.com to hide my own git server. wtf. I can reproduce the problem now. And I would like to help to get this fixed.

pygit2 0.28.0 installed with pip produces errors like that:

2019-03-29 10:36:49,880 [salt.utils.gitfs :1437][ERROR   ][2001] Unable to get SHA of HEAD for git_pillar remote 'master https://github.com/x70b1/pillar.git'

This is my master config: (I set up a public repo to make sure that this is not a problem with a non-extisting server)

ext_pillar:
  - git:
    - master https://github.com/x70b1/pillar.git:
      - env: base

I see this on a debian system:

Salt Version:
           Salt: 2019.2.0

Dependency Versions:
           cffi: 1.12.2
       cherrypy: Not Installed
       dateutil: 2.5.3
      docker-py: Not Installed
          gitdb: 2.0.0
      gitpython: 2.1.1
          ioflo: Not Installed
         Jinja2: 2.9.4
        libgit2: 0.28.1
        libnacl: Not Installed
       M2Crypto: Not Installed
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.4.8
   mysql-python: Not Installed
      pycparser: 2.17
       pycrypto: 2.6.1
   pycryptodome: Not Installed
         pygit2: 0.28.0
         Python: 2.7.13 (default, Sep 26 2018, 18:42:22)
   python-gnupg: Not Installed
         PyYAML: 3.12
          PyZMQ: 16.0.2
           RAET: Not Installed
          smmap: 2.0.1
        timelib: Not Installed
        Tornado: 4.4.3
            ZMQ: 4.2.1

System Versions:
           dist: debian 9.8 
         locale: UTF-8
        machine: x86_64
        release: 4.9.0-8-amd64
         system: Linux
        version: debian 9.8 

But also on a Fedora system:

Salt Version:
           Salt: 2019.2.0

Dependency Versions:
           cffi: 1.12.2
       cherrypy: Not Installed
       dateutil: Not Installed
      docker-py: Not Installed
          gitdb: Not Installed
      gitpython: Not Installed
          ioflo: Not Installed
         Jinja2: 2.10
        libgit2: 0.28.1
        libnacl: Not Installed
       M2Crypto: Not Installed
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.5.6
   mysql-python: Not Installed
      pycparser: 2.17
       pycrypto: 2.6.1
   pycryptodome: Not Installed
         pygit2: 0.28.0
         Python: 2.7.15 (default, Oct 15 2018, 15:26:09)
   python-gnupg: Not Installed
         PyYAML: 5.1
          PyZMQ: 17.0.0
           RAET: Not Installed
          smmap: Not Installed
        timelib: Not Installed
        Tornado: 5.0.2
            ZMQ: 4.1.6

System Versions:
           dist: fedora 29 Twenty Nine
         locale: UTF-8
        machine: x86_64
        release: 4.18.16-300.fc29.x86_64
         system: Linux
        version: Fedora 29 Twenty Nine

If I install python2-pygit2 from fedoras package repos everything works. It is version 0.27.4

# dnf info python2-pygit2
Last metadata expiration check: 0:50:57 ago on Fri 29 Mar 2019 10:32:10 AM UTC.
Installed Packages
Name         : python2-pygit2
Version      : 0.27.4
Release      : 1.module_f29+2764+dbb9cdda
Arch         : x86_64
Size         : 723 k
Source       : python-pygit2-0.27.4-1.module_f29+2764+dbb9cdda.src.rpm
Repo         : @System
From repo    : updates-modular
Summary      : Python 2.x bindings for libgit2
URL          : https://www.pygit2.org/
License      : GPLv2 with linking exception
Description  : pygit2 is a set of Python bindings to the libgit2 library, which implements
             : the core of Git.
             : 
             : Python 2 version.
garethgreenaway commented 5 years ago

@x70b1 Thanks for the report. I was able to reproduce the error on fedora 29 with pygit2 0.28.0 using the 2019.2.0 release of Salt. Testing with the current head of the 2019.2 branch, the issue appears to be fixed so this issue should be resolved once 2019.2.1 is released. I am in the process of tracking down the pull request that provided the fix.

garethgreenaway commented 5 years ago

FYI, the fix was here: https://github.com/saltstack/salt/pull/51304

ptitdoc commented 5 years ago

For some reason, this pull request https://github.com/saltstack/salt/pull/51304 has been merged into saltstack:2018.3, but I use a 2019.2.0 install on archlinux and the commit is not applied. Is it normal ?

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.

stale[bot] commented 4 years ago

Thank you for updating this issue. It is no longer marked as stale.

sagetherage commented 4 years ago

@garethgreenaway can you look into this for sodium, please? removing fixed label to review in the release cycle, it maybe that this needs a port to master, perhaps?

sagetherage commented 4 years ago

closing as fixed in master and 3001RC