[BUG] MySQL master job cache doesn't work because mysql Python package is missing
@dwoz is already working on this.
Since May 5, 2025.
- Dominant language
- Python
- Stars
- 15.7k
- Forks
- 5.6k
- Avg merge
- 2d 44m
- Merged PRs (30d)
- 80
Description
Description
Upon upgrade to the latest salt master version (3007.1, installed via Debian Bookworm package from https://packages.broadcom.com/artifactory/saltproject-deb/ ), the salt master failed to start. We were using the mysql master job cache. In the master's log, I saw the error:
2025-04-24 16:14:05,473 [salt.utils.lazy :102 ][DEBUG ][1014420] Could not LazyLoad mysql.prep_jid: 'mysql' virtual returned False: No python mysql client installed.
2025-04-24 16:14:05,473 [salt.master :2355][ERROR ][1014420] Failed to allocate a jid. The requested returner 'mysql' could not be loaded.
I was able to fix it by installing the mysql module manually with pip:
/opt/saltstack/salt/bin/pip install mysql
This only worked after installing other packages with apt necessary for the mysql module to build:
apt-get install pkg-config python3-dev default-libmysqlclient-dev build-essential
This python module should be installed into /opt/saltstack by the package, right? Otherwise, further upgrades to the salt-master will blow it away again and undo my manual fix, I think.
Setup
(Please provide relevant configs and/or SLS files (be sure to remove sensitive info. There is no general set-up of Salt.)
This is an on-prem virtual machine in VMWare running Debian 12 bookworm. The onedir version of the salt-master package was installed from
https://packages.broadcom.com/artifactory/saltproject-deb/
using apt, e. g. apt install salt-master
Then the mysql job cache was configured by dropping a file called mysql_job_cache.conf into /etc/salt/master.d. Its contents are:
mysql.host: 'database_ip_address'
mysql.user: 'db_user'
mysql.pass: 'db_user_password_here'
mysql.port: 3306
master_job_cache: mysql
Steps to Reproduce the behavior
Install the salt master and attempt to configure the mysql master job cache, then restart the salt-master service.
Expected behavior
The master should start properly and send job results to the mysql database. After installing the python mysql package manually with pip in salt's onedir in /opt/saltstack as described above, this expected behavior works again.
Versions Report
salt --versions-report
(Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)alt Version:
Salt: 3007.1
Python Version:
Python: 3.10.14 (main, Apr 3 2024, 21:30:09) [GCC 11.2.0]
Dependency Versions:
cffi: 1.16.0
cherrypy: unknown
dateutil: 2.8.2
docker-py: Not Installed
gitdb: Not Installed
gitpython: Not Installed
Jinja2: 3.1.4
libgit2: Not Installed
looseversion: 1.3.0
M2Crypto: Not Installed
Mako: Not Installed
msgpack: 1.0.7
msgpack-pure: Not Installed
mysql-python: Not Installed
packaging: 23.1
pycparser: 2.21
pycrypto: Not Installed
pycryptodome: 3.19.1
pygit2: Not Installed
python-gnupg: 0.5.2
PyYAML: 6.0.1
PyZMQ: 25.1.2
relenv: 0.16.0
smmap: Not Installed
timelib: 0.3.0
Tornado: 6.3.3
ZMQ: 4.3.4
Salt Package Information:
Package Type: onedir
System Versions:
dist: debian 12.10 bookworm
locale: utf-8
machine: x86_64
release: 6.1.0-21-amd64
system: Linux
version: Debian GNU/Linux 12.10 bookworm
Additional context
Add any other context about the problem here.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.