Feb
26
[原]解决metadata-agent 报AttributeError: 'HTTPClient' object has no attribute 'auth_tenant_id'错误
通过yum 更新使用RDO 安装OpenStack Havana 版本环境,发现实例无法获取metadata 信息,查看/var/log/neutron/metadata-agent.log 日志,发现如下报错信息:
查询Google 得知,是个Bug问题:
https://bugs.launchpad.net/python-neutronclient/+bug/1280941
1.临时的解决办法
目前没有可用的更新包,只能通过降级处理,参考:
https://ask.openstack.org/en/question/12439/metadata-agent-throwing-attributeerror-httpclient-object-has-no-attribute-auth_tenant_id-with-latest-release/
1)当前升级后的运行版本
2)降级
重启metadata-agent 服务:
测试,问题解决!
2.更新python-neutronclient 到2.3.4版本
从地址可以获取到python-neutronclient 2.3.4 版本的源码。
通过对比python-neutronclient-2.3.1-2.el6.src.rpm,根据其中的0001-Remove-runtime-dependency-on-python-pbr.patch 补丁,修改生成2.3.4版本的rpm:
经测试,可以解决openstack-neutron-2013.2.2-2.el6.noarch 版本的metadata-agent 错误问题。
下载 python-neutronclient-2.3.4-2.el6.tgz:
源码:
※ 20140304 更新
在RDO已经提供了python-neutronclient-2.3.1-3 的更新包以解决该问题。
* 二 2月 25 2014 Jakub Ruzicka 2.3.1-3
- Fixed get_auth_info() for pre-authenticated clients
引用
2014-02-25 17:48:52.486 4578 ERROR neutron.agent.metadata.agent [-] Unexpected error.
2014-02-25 17:48:52.486 4578 TRACE neutron.agent.metadata.agent Traceback (most recent call last):
2014-02-25 17:48:52.486 4578 TRACE neutron.agent.metadata.agent File "/usr/lib/python2.6/site-packages/neutron/agent/metadata/agent.py", line 94, in __call__
2014-02-25 17:48:52.486 4578 TRACE neutron.agent.metadata.agent instance_id, tenant_id = self._get_instance_and_tenant_id(req)
2014-02-25 17:48:52.486 4578 TRACE neutron.agent.metadata.agent File "/usr/lib/python2.6/site-packages/neutron/agent/metadata/agent.py", line 126, in _get_instance_and_tenant_id
2014-02-25 17:48:52.486 4578 TRACE neutron.agent.metadata.agent self.auth_info = qclient.get_auth_info()
2014-02-25 17:48:52.486 4578 TRACE neutron.agent.metadata.agent File "/usr/lib/python2.6/site-packages/neutronclient/v2_0/client.py", line 1114, in get_auth_info
2014-02-25 17:48:52.486 4578 TRACE neutron.agent.metadata.agent return self.httpclient.get_auth_info()
2014-02-25 17:48:52.486 4578 TRACE neutron.agent.metadata.agent File "/usr/lib/python2.6/site-packages/neutronclient/client.py", line 270, in get_auth_info
2014-02-25 17:48:52.486 4578 TRACE neutron.agent.metadata.agent 'auth_tenant_id': self.auth_tenant_id,
2014-02-25 17:48:52.486 4578 TRACE neutron.agent.metadata.agent AttributeError: 'HTTPClient' object has no attribute 'auth_tenant_id'
2014-02-25 17:48:52.486 4578 TRACE neutron.agent.metadata.agent
2014-02-25 17:48:52.486 4578 TRACE neutron.agent.metadata.agent Traceback (most recent call last):
2014-02-25 17:48:52.486 4578 TRACE neutron.agent.metadata.agent File "/usr/lib/python2.6/site-packages/neutron/agent/metadata/agent.py", line 94, in __call__
2014-02-25 17:48:52.486 4578 TRACE neutron.agent.metadata.agent instance_id, tenant_id = self._get_instance_and_tenant_id(req)
2014-02-25 17:48:52.486 4578 TRACE neutron.agent.metadata.agent File "/usr/lib/python2.6/site-packages/neutron/agent/metadata/agent.py", line 126, in _get_instance_and_tenant_id
2014-02-25 17:48:52.486 4578 TRACE neutron.agent.metadata.agent self.auth_info = qclient.get_auth_info()
2014-02-25 17:48:52.486 4578 TRACE neutron.agent.metadata.agent File "/usr/lib/python2.6/site-packages/neutronclient/v2_0/client.py", line 1114, in get_auth_info
2014-02-25 17:48:52.486 4578 TRACE neutron.agent.metadata.agent return self.httpclient.get_auth_info()
2014-02-25 17:48:52.486 4578 TRACE neutron.agent.metadata.agent File "/usr/lib/python2.6/site-packages/neutronclient/client.py", line 270, in get_auth_info
2014-02-25 17:48:52.486 4578 TRACE neutron.agent.metadata.agent 'auth_tenant_id': self.auth_tenant_id,
2014-02-25 17:48:52.486 4578 TRACE neutron.agent.metadata.agent AttributeError: 'HTTPClient' object has no attribute 'auth_tenant_id'
2014-02-25 17:48:52.486 4578 TRACE neutron.agent.metadata.agent
查询Google 得知,是个Bug问题:
https://bugs.launchpad.net/python-neutronclient/+bug/1280941
1.临时的解决办法
目前没有可用的更新包,只能通过降级处理,参考:
https://ask.openstack.org/en/question/12439/metadata-agent-throwing-attributeerror-httpclient-object-has-no-attribute-auth_tenant_id-with-latest-release/
1)当前升级后的运行版本
引用
[root@controller ~]# rpm -qa|grep neutron
python-neutronclient-2.3.1-2.el6.noarch
openstack-neutron-openvswitch-2013.2.2-2.el6.noarch
python-neutron-2013.2.2-2.el6.noarch
openstack-neutron-2013.2.2-2.el6.noarch
python-neutronclient-2.3.1-2.el6.noarch
openstack-neutron-openvswitch-2013.2.2-2.el6.noarch
python-neutron-2013.2.2-2.el6.noarch
openstack-neutron-2013.2.2-2.el6.noarch
2)降级
引用
[root@controller ~]# yum downgrade openstack-neutron python-neutron openstack-neutron-openvswitch python-neutronclient
Removed:
openstack-neutron.noarch 0:2013.2.2-2.el6 openstack-neutron-openvswitch.noarch 0:2013.2.2-2.el6 python-neutron.noarch 0:2013.2.2-2.el6
python-neutronclient.noarch 0:2.3.1-2.el6
Installed:
openstack-neutron.noarch 0:2013.2.1-1.el6 openstack-neutron-openvswitch.noarch 0:2013.2.1-1.el6 python-neutron.noarch 0:2013.2.1-1.el6
python-neutronclient.noarch 0:2.3.1-1.el6
Complete!
Removed:
openstack-neutron.noarch 0:2013.2.2-2.el6 openstack-neutron-openvswitch.noarch 0:2013.2.2-2.el6 python-neutron.noarch 0:2013.2.2-2.el6
python-neutronclient.noarch 0:2.3.1-2.el6
Installed:
openstack-neutron.noarch 0:2013.2.1-1.el6 openstack-neutron-openvswitch.noarch 0:2013.2.1-1.el6 python-neutron.noarch 0:2013.2.1-1.el6
python-neutronclient.noarch 0:2.3.1-1.el6
Complete!
重启metadata-agent 服务:
引用
[root@controller ~]# /etc/init.d/neutron-metadata-agent restart
停止 neutron-metadata-agent: [确定]
正在启动 neutron-metadata-agent: [确定]
停止 neutron-metadata-agent: [确定]
正在启动 neutron-metadata-agent: [确定]
测试,问题解决!
2.更新python-neutronclient 到2.3.4版本
从地址可以获取到python-neutronclient 2.3.4 版本的源码。
通过对比python-neutronclient-2.3.1-2.el6.src.rpm,根据其中的0001-Remove-runtime-dependency-on-python-pbr.patch 补丁,修改生成2.3.4版本的rpm:
引用
Wrote: /root/rpmbuild/SRPMS/python-neutronclient-2.3.4-2.el6.src.rpm
Wrote: /root/rpmbuild/RPMS/noarch/python-neutronclient-2.3.4-2.el6.noarch.rpm
Wrote: /root/rpmbuild/RPMS/noarch/python-neutronclient-2.3.4-2.el6.noarch.rpm
经测试,可以解决openstack-neutron-2013.2.2-2.el6.noarch 版本的metadata-agent 错误问题。
下载 python-neutronclient-2.3.4-2.el6.tgz:
下载文件
源码:
※ 20140304 更新
在RDO已经提供了python-neutronclient-2.3.1-3 的更新包以解决该问题。
引用
* 二 2月 25 2014 Jakub Ruzicka
- Fixed get_auth_info() for pre-authenticated clients