Closed 11qeq11 closed 1 year ago
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:
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 saltproject@vmware.com. We’re glad you’ve joined our community and look forward to doing awesome things with you!
The actual problem is:
Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/salt/modules/mysql.py", line 436, in _connect
dbc = MySQLdb.connect(**connargs)
File "/usr/lib64/python3.6/site-packages/MySQLdb/__init__.py", line 85, in Connect
return Connection(*args, **kwargs)
File "/usr/lib64/python3.6/site-packages/MySQLdb/connections.py", line 247, in __init__
self.converter[t].append((None, string_decoder))
AttributeError: type object 'str' has no attribute 'append'
That appears to be caused by https://github.com/PyMySQL/mysqlclient/pull/215
I don't think there's anything Salt can do about that. You should file an issue with mysqlclient.
@OrangeDog Got it, thank you!
Looks like this problem is present in mysqlclient
v1.3.13 and v1.3.14 only, upgrading further actually solves the issue as well, and essentially I noticed it only because RPM package python36-mysql
from CentOS7 base
repo seems to contain exactly mysqlclient
v1.3.14, which can be seen here.
Description After upgrade to
mysqlclient==1.3.13
, which is one of the requirements for Salt'smysql
module to work according to documentation, module calling throwsAttributeError: module 'MySQLdb' has no attribute 'err'
. Reverting tomysqlclient=1.3.12
fixes the issue.Setup Info from VM (CentOS 7):
Info from parent host (Arch Linux):
Steps to Reproduce the behaviour
mysqlclient==1.3.13
with$ sudo pip3 install mysqlclient==1.3.13
.mysql
module, in my case:Full trace
```python [ERROR ] An un-handled exception was caught by Salt's global exception handler: AttributeError: module 'MySQLdb' has no attribute 'err' Traceback (most recent call last): File "/usr/lib/python3.6/site-packages/salt/modules/mysql.py", line 436, in _connect dbc = MySQLdb.connect(**connargs) File "/usr/lib64/python3.6/site-packages/MySQLdb/__init__.py", line 85, in Connect return Connection(*args, **kwargs) File "/usr/lib64/python3.6/site-packages/MySQLdb/connections.py", line 247, in __init__ self.converter[t].append((None, string_decoder)) AttributeError: type object 'str' has no attribute 'append' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/bin/salt-call", line 11, inmysqlclient
with$ sudo pip3 install mysqlclient==1.3.12
.Expected behaviour
I'd expect that
mysql
module is compatible withmysqlclient
on versionsmysqlclient>=1.3.13
, I think it's not a problem of my setup. Perhaps diff in https://github.com/PyMySQL/mysqlclient/compare/1.3.12...1.3.13 will be helpful to fix this incompatibility, until then I can hard-code1.3.12
.Versions Report
salt --versions-report
Master: ```yaml Salt Version: Salt: 3005.2 Dependency Versions: cffi: Not Installed cherrypy: unknown dateutil: 2.8.2 docker-py: Not Installed gitdb: Not Installed gitpython: Not Installed Jinja2: 2.11.1 libgit2: Not Installed M2Crypto: 0.35.2 Mako: Not Installed msgpack: 0.6.2 msgpack-pure: Not Installed mysql-python: Not Installed pycparser: Not Installed pycrypto: Not Installed pycryptodome: Not Installed pygit2: Not Installed Python: 3.6.8 (default, Jun 20 2023, 11:53:23) python-gnupg: 0.5.1 PyYAML: 3.13 PyZMQ: 20.0.0 smmap: Not Installed timelib: Not Installed Tornado: 4.5.3 ZMQ: 4.1.4 System Versions: dist: centos 7 Core locale: UTF-8 machine: x86_64 release: 3.10.0-1160.95.1.el7.x86_64 system: Linux version: CentOS Linux 7 Core ``` Minion: ```yaml Salt Version: Salt: 3005.2 Dependency Versions: cffi: Not Installed cherrypy: Not Installed dateutil: Not Installed docker-py: Not Installed gitdb: 4.0.9 gitpython: Not Installed Jinja2: 2.11.1 libgit2: Not Installed M2Crypto: 0.35.2 Mako: Not Installed msgpack: 0.6.2 msgpack-pure: Not Installed mysql-python: 1.3.12 pycparser: Not Installed pycrypto: Not Installed pycryptodome: Not Installed pygit2: Not Installed Python: 3.6.8 (default, Jun 20 2023, 11:53:23) python-gnupg: Not Installed PyYAML: 3.13 PyZMQ: 20.0.0 smmap: 5.0.0 timelib: Not Installed Tornado: 4.5.3 ZMQ: 4.1.4 System Versions: dist: centos 7 Core locale: UTF-8 machine: x86_64 release: 3.10.0-1160.95.1.el7.x86_64 system: Linux version: CentOS Linux 7 Core ```