[BUG] 3005.1 onedir: pxgit2 ext_pillar configuration fails with ssl certificate rejection
Description Salt-Master is not connecting to a Gitlab instance with a letsencrypt certificate on a fresh onedir installation as an ext_pillar.
The same configuration is working with another salt-master, same version. The only difference being that the working one is a classic installation.
Noteworthy as well: The gitfs connection using the same Gitlab instance works.
If i uninstall the salt-master onedir version and install the classic version instead it works. No other changes are made at that point.
Setup
Please be as specific as possible and give set-up details.
- [X] on-prem machine
- [X] VM (KVM on a proxmox server)
- [ ] VM running on a cloud service, please be explicit and add details
- [ ] container (Kubernetes, Docker, containerd, etc. please specify)
- [ ] or a combination, please be explicit
- [ ] jails if it is FreeBSD
- [ ] classic packaging
- [X] onedir packaging
- [ ] used bootstrap to install
The git-Server in question is a Gitlab installation with a letsencrypt certificate.
For reference the used gitfs configuration works:
gitfs_remotes:
- https://gitlab.example.com/salt/states.git:
- user: project_XXXX_bot
- password: <authentication token>
But the corresponding ext_pillar configuration fails:
ext_pillar:
- git:
- __env__ https://gitlab.example.com/salt/pillars.git:
- user: project_XXXX_bot
- password: <authentication token>
I did not change the providers away from pygit2!
Steps to Reproduce the behavior Produced Error :
[DEBUG ] Set update lock for git_pillar remote '__env__ https://gitlab.example.com/salt/pillars.git'
[DEBUG ] Fetching git_pillar remote '__env__ https://gitlab.example.com/salt/pillars.git'
[ERROR ] Error occurred fetching git_pillar remote '__env__ https://gitlab.example.com/salt/pillars.git: user rejected certificate for gitlab.glaeserundflaschen.de
Traceback (most recent call last):
File "salt/utils/gitfs.py", line 1870, in _fetch
fetch_results = origin.fetch(**fetch_kwargs)
File "/opt/saltstack/salt/pypath/lib/python3.9/site-packages/pygit2/remote.py", line 146, in fetch
payload.check_error(err)
File "/opt/saltstack/salt/pypath/lib/python3.9/site-packages/pygit2/callbacks.py", line 93, in check_error
check_error(error_code)
File "/opt/saltstack/salt/pypath/lib/python3.9/site-packages/pygit2/errors.py", line 65, in check_error
raise GitError(message)
_pygit2.GitError: user rejected certificate for gluflab.glaeserundflaschen.de
[DEBUG ] Removed update lock for git_pillar remote '__env__ https://gitlab.example.com/salt/pillars.git'
[DEBUG ] This salt-master instance has accepted 1 minion keys.
Certificate on the gitlab instance is a valid letsencrypt wildcard certificate.
The only thing i did to get this error is installing the salt-master as a onedir installation.
Expected behavior Behaving the same way as a classic installation.
Versions Report
salt --versions-report
(Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)Salt Version:
Salt: 3005.1
Dependency Versions:
cffi: 1.14.6
cherrypy: 18.6.1
dateutil: 2.8.1
docker-py: Not Installed
gitdb: 4.0.9
gitpython: 3.1.29
Jinja2: 3.1.0
libgit2: 1.5.0
M2Crypto: Not Installed
Mako: Not Installed
msgpack: 1.0.2
msgpack-pure: Not Installed
mysql-python: Not Installed
pycparser: 2.21
pycrypto: Not Installed
pycryptodome: 3.9.8
pygit2: 1.10.1
Python: 3.9.14 (main, Oct 3 2022, 21:19:30)
python-gnupg: 0.4.8
PyYAML: 5.4.1
PyZMQ: 23.2.0
smmap: 5.0.0
timelib: 0.2.4
Tornado: 4.5.3
ZMQ: 4.3.4
System Versions:
dist: debian 11 bullseye
locale: utf-8
machine: x86_64
release: 5.10.0-18-amd64
system: Linux
version: Debian GNU/Linux 11 bullseye
For comparison: The working master:
Salt Version:
Salt: 3005.1
Dependency Versions:
cffi: Not Installed
cherrypy: unknown
dateutil: 2.8.1
docker-py: Not Installed
gitdb: 4.0.5
gitpython: 3.1.14
Jinja2: 2.11.3
libgit2: 1.1.0
M2Crypto: Not Installed
Mako: Not Installed
msgpack: 1.0.0
msgpack-pure: Not Installed
mysql-python: Not Installed
pycparser: Not Installed
pycrypto: Not Installed
pycryptodome: 3.9.7
pygit2: 1.4.0
Python: 3.9.2 (default, Feb 28 2021, 17:03:44)
python-gnupg: Not Installed
PyYAML: 5.3.1
PyZMQ: 20.0.0
smmap: 4.0.0
timelib: Not Installed
Tornado: 4.5.3
ZMQ: 4.3.4
System Versions:
dist: debian 11 bullseye
locale: utf-8
machine: x86_64
release: 5.10.0-18-amd64
system: Linux
version: Debian GNU/Linux 11 bullseye
Additional context
Comparing the versions on the two masters i changed the pygit2 version in the onedir installation:
salt-pip uninstall pygit2
salt-pip install pygit2==1.4.0
After this the master startet working as expected. So it seems that something significantly changed from pygit2 1.4.0 to 1.10.1.
I'm currently using this as a workaround.
Hi there! Welcome to the Salt Community! Thank you for making your first contribution. We have a lengthy process for issues and PRs. Someone from the Core Team will follow up as soon as possible. In the meantime, here’s some information that may help as you continue your Salt journey. Please be sure to review our Code of Conduct. Also, check out some of our community resources including:
- Community Wiki
- Salt’s Contributor Guide
- Join our Community Slack
- IRC on LiberaChat
- Salt Project YouTube channel
- Salt Project Twitch channel
There are lots of ways to get involved in our community. Every month, there are around a dozen opportunities to meet with other contributors and the Salt Core team and collaborate in real time. The best way to keep track is by subscribing to the Salt Community Events Calendar. If you have additional questions, email us at [email protected]. We’re glad you’ve joined our community and look forward to doing awesome things with you!
That sounds like #62637, which should have been fixed in 3005.1
Not quite. #62637 failed to load the certificate, now it outright refuses to connect to server with a valid cert. I don't have the insight to state how much this really is the same problem or if there is some other certificate related problem at play here.
Thanks for the original report. This issue has been open for more than three years without recent activity and carries a severity label below severity-high. As part of a backlog cleanup, we're closing older low- and medium-severity issues so triage can focus on reports against currently supported releases.
Closing isn't a judgement that the problem wasn't real — only that the codebase has moved through several releases since this was filed, and much of the surrounding code has changed.
If you — or anyone else — can still reproduce this on the 3008.x LTS release, please leave a comment with a reproduction and a maintainer will reopen. The original reporter can also reopen directly.