ubuntu22.04LTS安装keystone AttributeError: ‘NoneType‘ object has no attribute ‘getcurrent‘

报错内容

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'

解决方法

  1. 打开文件:
    vi /usr/lib/python3/dist-packages/eventlet/green/thread.py
    # or your path to thread.py from exception traceback
    
  2. 修改:
    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)
    
  3. 重试
    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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值