报错内容
root@controller:~# su -s /bin/sh -c "keystone-manage db_sync" keystone
Exception ignored in: <function _removeHandlerRef at 0x7bc261a4c3a0>
Traceback (most recent call last):
File "/usr/lib/python3.10/logging/__init__.py", line 846, in _removeHandlerRef
File "/usr/lib/python3.10/logging/__init__.py", line 226, in _acquireLock
File "/usr/lib/python3.10/threading.py", line 164, in acquire
File "/usr/lib/python3/dist-packages/eventlet/green/thread.py", line 34, in get_ident
AttributeError: 'NoneType' object has no attribute 'getcurrent'
解决方法
- 打开文件:
vi /usr/lib/python3/dist-packages/eventlet/green/thread.py # or your path to thread.py from exception traceback
- 修改:
def get_ident(gr=None): if gr is None: return id(greenlet.getcurrent()) else: return id(gr) and make try-except contruction for get id like this: # 修改这个函数 def get_ident(gr=None): try: if gr is None: return id(greenlet.getcurrent()) else: return id(gr) except: return id(gr)
- 重试
su -s /bin/bash keystone -c "keystone-manage db_sync"
参考
https://www.mail-archive.com/ubuntu-bugs@lists.ubuntu.com/msg6040774.html
https://github.com/eventlet/eventlet/issues/953