openEuler-22.03-LTS-SP2源码安装OpenStack-Bobcat问题解决
- 文章说明
- 机器详情
- Keystone 编译安装所遇到的问题
- glance编译安装遇到的问题
- placement编译安装遇到的问题
文章说明
记录openEuler-22.03-LTS-SP2源码安装OpenStack-Bobcat所遇到的问题及解决办法
机器详情
主机名 | IP | 磁盘 | CPU | 内存 |
---|---|---|---|---|
controller | ens160:192.168.46.31/24 ens192:不配置IP地址 | 100G | 2C | 8G |
compute | ens160:192.168.46.32/24 ens192:不配置IP地址 | 100G | 2C | 8G |
Keystone 编译安装所遇到的问题
CRITICAL keystone [-] Unhandled error: AttributeError: ‘function’ object has no attribute ‘ping’
运行如下命
su -s /bin/sh -c "keystone-manage db_sync" keystone
报错:
解决办法一(SQLAlchemy版本降低)
pip3 install SQLAlchemy==1.4.49 -i https://pypi.tuna.tsinghua.edu.cn/simple
解决办法二(修改代码)
根据报错信息可知出现问题的代码位于
File "/usr/local/lib64/python3.9/site-packages/sqlalchemy/dialects/mysql/pymysql.py", line 93, in _send_false_to_ping
进去查看代码
@langhelpers.memoized_property
def _send_false_to_ping(self):
"""determine if pymysql has deprecated, changed the default of,
or removed the 'reconnect' argument of connection.ping().
See #10492 and
https://github.com/PyMySQL/mysqlclient/discussions/651#discussioncomment-7308971
for background.
""" # noqa: E501
try:
Connection = __import__("pymysql.connections").Connection
except (ImportError, AttributeError):
return True
else:
insp = langhelpers.get_callable_argspec(Connection.ping)
try:
reconnect_arg = insp.args[1]
except IndexError:
return False
else:
return reconnect_arg == "reconnect" and (
not insp.defaults or insp.defaults[0] is not False
)
问题出现在这一行
insp = langhelpers.get_callable_argspec(Connection.ping)
这行代码的意思获取 Connection.ping 方法的参数规格
但是它报错AttributeError: 'function' object has no attribute 'ping'
这个时候就要去查看一下源代码确认一下ping是否存在
首先通过pip3 show pymysql查看模块的位置
[root@controller ~]# pip3 show pymysql
Name: PyMySQL
Version: 0.9.3
Summary: Pure Python MySQL Driver
Home-page: https://github.com/PyMySQL/PyMySQL/
Author: yutaka.matsubara
Author-email: yutaka.matsubara@gmail.com
License: "MIT"
Location: /usr/lib/python3.9/site-packages
Requires:
Required-by:
最终确认文件目录为/usr/lib/python3.9/site-packages/pymysql/connections.py
查看这个文件内容可以发现
是有ping存在的它是一个函数位于class Connection(object),这时就会发现Connection明明是一个class
为什么会报AttributeError: 'function'
这时返回/usr/local/lib64/python3.9/site-packages/sqlalchemy/dialects/mysql/pymysql.py
修改代码查看查看