ara连接到mysql,但总是出现错误“sqlalchemy.exc.operationalerror”

dy2hfwbg  于 2021-06-20  发布在  Mysql
关注(0)|答案(2)|浏览(562)

我已经安装了一个ara门户来观察ansible playbook的执行状态。但是,我总是从ara门户网站得到一个错误:
sqlalchemy.exc.operationalerror operationalerror:(pymysql.err.operationalerror)(2006年,“mysql服务器已消失(错误(32,'断管')”)“[sql:u'select files.id as files\u id,files.playbook\u id as files\u playbook\u id,files.path as files\u path,files.content\u id as files\u content\u id,files.is \u playbook as files \u is \u playbook from files \n其中files.id=%(param \u 1)s'][参数:{u'param \u 1':u'9e533f28-1780-49ac-99d8-306040567d9b'}](此错误的背景信息位于:http://sqlalche.me/e/e3q8)
我确保我的ara安装遵循以下链接:

https://ara.readthedocs.io/en/latest/installation.html

我的设置如下所示:
操作系统:ubuntu 16.04
python:3.5,也尝试过使用python2.7,但都出现了错误。
mysql:5.7.23(所有数据库和表都使用utf8mb4)
pymysql:0.9.2,也尝试过使用0.7.1版本,但都出现了错误。
sqlalchemy:1.2.11版
我使用以下命令启动ara门户:

export ARA_DATABASE="mysql+pymysql://ara:password@localhost/ara?charset=utf8mb4"

ara-manage runserver -h <server_ip> -p 9191 -d

我已经确认了我的ara和mysql的连接,mysql'ara'数据库保存了ansible playbook执行日志。
有人能帮我吗?

6jjcrrmo

6jjcrrmo1#

我是ara的作者,刚刚遇到这个问题。
在ara1.0版本的重写过程中,对mysql的支持得到了极大的改进,现在它已经进行了集成测试。
目前没有要将数据库从0.x升级到1.x的sql迁移,这在很大程度上是由于后端的重写,因此您需要从一个新的数据库开始。
如果您能测试一下,让我知道现在是否更好,我将不胜感激。如果您发现任何问题或改进机会,请随时在github上打开一个问题:https://github.com/ansible-community/ara/issues
谢谢!

kuuvgm7e

kuuvgm7e2#

我发现ara的较新版本(~0.16.1)与mysql并不完全兼容。除了修改 max_allowed_packet_size 正如评论中所建议的那样,安装ara版本0.14.6对我来说是可行的。

pip install ara==0.14.6

下面是关于ara和mysql兼容性的更多内容

相关问题