[Yahoo-eng-team] [Bug 1852665] Re: HostMappingNotFound in wigi.py

2019-11-19 Thread Matt Riedemann
*** This bug is a duplicate of bug 1780727 ***
https://bugs.launchpad.net/bugs/1780727

What release are you using? You must not have this fix:

https://review.opendev.org/#/q/I0d7644db3537a67b94e75972b3c4fce25a623763

I'm going to mark this as a duplicate of bug 1780727.

** This bug has been marked a duplicate of bug 1780727
   Handle HostMappingNotFound when deleting a service

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1852665

Title:
  HostMappingNotFound in wigi.py

Status in OpenStack Compute (nova):
  New

Bug description:
  It seems to be diffrent from #1780727.

  # openstack compute service delete 26

  
  Failed to delete compute service with ID '26': 发生意外 API 错误。请在 
http://bugs.launchpad.net/nova/ 处报告此错误,并且附上 Nova API 日志(如果可能)。
   (HTTP 500) (Request-ID: 
req-a693a664-5834-48c6-acd9-c92d8b2eea28)

  nova-api-log:
  2019-11-15 08:41:23.576 11235 ERROR nova.api.openstack.wsgi 
[req-099cb32c-dfbb-4eaf-a067-a3737720977f 7c177645d83f4a769d51ab4b9801a90d 
04627ab3503248cb8d714ac1a44f543f - default default] Unexpected exception in API 
method: HostMappingNotFound: \u4e3b\u673a 
'computer3713hpdl580'\u6ca1\u6709\u6620\u5c04\u5230\u4efb\u4f55\u5355\u5143
  2019-11-15 08:41:23.576 11235 ERROR nova.api.openstack.wsgi Traceback (most 
recent call last):
  2019-11-15 08:41:23.576 11235 ERROR nova.api.openstack.wsgi   File 
"/usr/lib/python2.7/site-packages/nova/api/openstack/wsgi.py", line 801, in 
wrapped
  2019-11-15 08:41:23.576 11235 ERROR nova.api.openstack.wsgi return 
f(*args, **kwargs)
  2019-11-15 08:41:23.576 11235 ERROR nova.api.openstack.wsgi   File 
"/usr/lib/python2.7/site-packages/nova/api/openstack/compute/services.py", line 
237, in delete
  2019-11-15 08:41:23.576 11235 ERROR nova.api.openstack.wsgi service.host)
  2019-11-15 08:41:23.576 11235 ERROR nova.api.openstack.wsgi   File 
"/usr/lib/python2.7/site-packages/nova/exception_wrapper.py", line 79, in 
wrapped
  2019-11-15 08:41:23.576 11235 ERROR nova.api.openstack.wsgi 
function_name, call_dict, binary, tb)
  2019-11-15 08:41:23.576 11235 ERROR nova.api.openstack.wsgi   File 
"/usr/lib/python2.7/site-packages/oslo_utils/excutils.py", line 220, in __exit__
  2019-11-15 08:41:23.576 11235 ERROR nova.api.openstack.wsgi 
self.force_reraise()
  2019-11-15 08:41:23.576 11235 ERROR nova.api.openstack.wsgi   File 
"/usr/lib/python2.7/site-packages/oslo_utils/excutils.py", line 196, in 
force_reraise
  2019-11-15 08:41:23.576 11235 ERROR nova.api.openstack.wsgi 
six.reraise(self.type_, self.value, self.tb)
  2019-11-15 08:41:23.576 11235 ERROR nova.api.openstack.wsgi   File 
"/usr/lib/python2.7/site-packages/nova/exception_wrapper.py", line 69, in 
wrapped
  2019-11-15 08:41:23.576 11235 ERROR nova.api.openstack.wsgi return 
f(self, context, *args, **kw)
  2019-11-15 08:41:23.576 11235 ERROR nova.api.openstack.wsgi   File 
"/usr/lib/python2.7/site-packages/nova/compute/api.py", line 5416, in 
remove_host_from_aggregate
  2019-11-15 08:41:23.576 11235 ERROR nova.api.openstack.wsgi mapping = 
objects.HostMapping.get_by_host(context, host_name)
  2019-11-15 08:41:23.576 11235 ERROR nova.api.openstack.wsgi   File 
"/usr/lib/python2.7/site-packages/oslo_versionedobjects/base.py", line 184, in 
wrapper
  2019-11-15 08:41:23.576 11235 ERROR nova.api.openstack.wsgi result = 
fn(cls, context, *args, **kwargs)
  2019-11-15 08:41:23.576 11235 ERROR nova.api.openstack.wsgi   File 
"/usr/lib/python2.7/site-packages/nova/objects/host_mapping.py", line 100, in 
get_by_host
  2019-11-15 08:41:23.576 11235 ERROR nova.api.openstack.wsgi db_mapping = 
cls._get_by_host_from_db(context, host)
  2019-11-15 08:41:23.576 11235 ERROR nova.api.openstack.wsgi   File 
"/usr/lib/python2.7/site-packages/oslo_db/sqlalchemy/enginefacade.py", line 
993, in wrapper
  2019-11-15 08:41:23.576 11235 ERROR nova.api.openstack.wsgi return 
fn(*args, **kwargs)
  2019-11-15 08:41:23.576 11235 ERROR nova.api.openstack.wsgi   File 
"/usr/lib/python2.7/site-packages/nova/objects/host_mapping.py", line 95, in 
_get_by_host_from_db
  2019-11-15 08:41:23.576 11235 ERROR nova.api.openstack.wsgi raise 
exception.HostMappingNotFound(name=host)
  2019-11-15 08:41:23.576 11235 ERROR nova.api.openstack.wsgi 
HostMappingNotFound: \u4e3b\u673a 
'computer3713hpdl580'\u6ca1\u6709\u6620\u5c04\u5230\u4efb\u4f55\u5355\u5143
  2019-11-15 08:41:23.576 11235 ERROR nova.api.openstack.wsgi 
  。

  # openstack compute service list |egrep "(3713|ID)"
  | ID | Binary   | Host| Zone  | Status   | State 
| Updated At |
  | 26 | nova-compute | computer3713hpdl580 | sugonZone | disabled | down  
| 2019-07-24T01:25:20.00 |

  # nova service-list |egrep "(3713|Id)"
  | Id   | Binary   | Host  
  | Zone  | Status   | State | Updated_at 

[Yahoo-eng-team] [Bug 1852665] Re: HostMappingNotFound in wigi.py

2019-11-18 Thread hua zhao
** Changed in: nova
   Status: Invalid => New

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1852665

Title:
  HostMappingNotFound in wigi.py

Status in OpenStack Compute (nova):
  New

Bug description:
  It seems to be diffrent from #1780727.

  # openstack compute service delete 26

  
  Failed to delete compute service with ID '26': 发生意外 API 错误。请在 
http://bugs.launchpad.net/nova/ 处报告此错误,并且附上 Nova API 日志(如果可能)。
   (HTTP 500) (Request-ID: 
req-a693a664-5834-48c6-acd9-c92d8b2eea28)

  nova-api-log:
  2019-11-15 08:41:23.576 11235 ERROR nova.api.openstack.wsgi 
[req-099cb32c-dfbb-4eaf-a067-a3737720977f 7c177645d83f4a769d51ab4b9801a90d 
04627ab3503248cb8d714ac1a44f543f - default default] Unexpected exception in API 
method: HostMappingNotFound: \u4e3b\u673a 
'computer3713hpdl580'\u6ca1\u6709\u6620\u5c04\u5230\u4efb\u4f55\u5355\u5143
  2019-11-15 08:41:23.576 11235 ERROR nova.api.openstack.wsgi Traceback (most 
recent call last):
  2019-11-15 08:41:23.576 11235 ERROR nova.api.openstack.wsgi   File 
"/usr/lib/python2.7/site-packages/nova/api/openstack/wsgi.py", line 801, in 
wrapped
  2019-11-15 08:41:23.576 11235 ERROR nova.api.openstack.wsgi return 
f(*args, **kwargs)
  2019-11-15 08:41:23.576 11235 ERROR nova.api.openstack.wsgi   File 
"/usr/lib/python2.7/site-packages/nova/api/openstack/compute/services.py", line 
237, in delete
  2019-11-15 08:41:23.576 11235 ERROR nova.api.openstack.wsgi service.host)
  2019-11-15 08:41:23.576 11235 ERROR nova.api.openstack.wsgi   File 
"/usr/lib/python2.7/site-packages/nova/exception_wrapper.py", line 79, in 
wrapped
  2019-11-15 08:41:23.576 11235 ERROR nova.api.openstack.wsgi 
function_name, call_dict, binary, tb)
  2019-11-15 08:41:23.576 11235 ERROR nova.api.openstack.wsgi   File 
"/usr/lib/python2.7/site-packages/oslo_utils/excutils.py", line 220, in __exit__
  2019-11-15 08:41:23.576 11235 ERROR nova.api.openstack.wsgi 
self.force_reraise()
  2019-11-15 08:41:23.576 11235 ERROR nova.api.openstack.wsgi   File 
"/usr/lib/python2.7/site-packages/oslo_utils/excutils.py", line 196, in 
force_reraise
  2019-11-15 08:41:23.576 11235 ERROR nova.api.openstack.wsgi 
six.reraise(self.type_, self.value, self.tb)
  2019-11-15 08:41:23.576 11235 ERROR nova.api.openstack.wsgi   File 
"/usr/lib/python2.7/site-packages/nova/exception_wrapper.py", line 69, in 
wrapped
  2019-11-15 08:41:23.576 11235 ERROR nova.api.openstack.wsgi return 
f(self, context, *args, **kw)
  2019-11-15 08:41:23.576 11235 ERROR nova.api.openstack.wsgi   File 
"/usr/lib/python2.7/site-packages/nova/compute/api.py", line 5416, in 
remove_host_from_aggregate
  2019-11-15 08:41:23.576 11235 ERROR nova.api.openstack.wsgi mapping = 
objects.HostMapping.get_by_host(context, host_name)
  2019-11-15 08:41:23.576 11235 ERROR nova.api.openstack.wsgi   File 
"/usr/lib/python2.7/site-packages/oslo_versionedobjects/base.py", line 184, in 
wrapper
  2019-11-15 08:41:23.576 11235 ERROR nova.api.openstack.wsgi result = 
fn(cls, context, *args, **kwargs)
  2019-11-15 08:41:23.576 11235 ERROR nova.api.openstack.wsgi   File 
"/usr/lib/python2.7/site-packages/nova/objects/host_mapping.py", line 100, in 
get_by_host
  2019-11-15 08:41:23.576 11235 ERROR nova.api.openstack.wsgi db_mapping = 
cls._get_by_host_from_db(context, host)
  2019-11-15 08:41:23.576 11235 ERROR nova.api.openstack.wsgi   File 
"/usr/lib/python2.7/site-packages/oslo_db/sqlalchemy/enginefacade.py", line 
993, in wrapper
  2019-11-15 08:41:23.576 11235 ERROR nova.api.openstack.wsgi return 
fn(*args, **kwargs)
  2019-11-15 08:41:23.576 11235 ERROR nova.api.openstack.wsgi   File 
"/usr/lib/python2.7/site-packages/nova/objects/host_mapping.py", line 95, in 
_get_by_host_from_db
  2019-11-15 08:41:23.576 11235 ERROR nova.api.openstack.wsgi raise 
exception.HostMappingNotFound(name=host)
  2019-11-15 08:41:23.576 11235 ERROR nova.api.openstack.wsgi 
HostMappingNotFound: \u4e3b\u673a 
'computer3713hpdl580'\u6ca1\u6709\u6620\u5c04\u5230\u4efb\u4f55\u5355\u5143
  2019-11-15 08:41:23.576 11235 ERROR nova.api.openstack.wsgi 
  。

  # openstack compute service list |egrep "(3713|ID)"
  | ID | Binary   | Host| Zone  | Status   | State 
| Updated At |
  | 26 | nova-compute | computer3713hpdl580 | sugonZone | disabled | down  
| 2019-07-24T01:25:20.00 |

  # nova service-list |egrep "(3713|Id)"
  | Id   | Binary   | Host  
  | Zone  | Status   | State | Updated_at | Disabled Reason 
| Forced down |
  | 8045be15-4866-4d2f-8cb5-79cca0f9744f | nova-compute | 
computer3713hpdl580 | sugonZone | disabled | down  | 2019-07-24T01:25:20.00 
| hostnotexist| False   |

  
  # openstack module list
  +-++
  | Field   | Value  |
  

[Yahoo-eng-team] [Bug 1852665] Re: HostMappingNotFound in wigi.py

2019-11-15 Thread Matt Riedemann
Which release is nova in the API?

As you can see from the service listing, nova CLI does it with the
latest microversion negotiated between novaclient and the server so you
see the service id as a uuid (microversion 2.53+) but openstack compute
service list uses microversion 2.1 by default, so you see the int id.

I think the issue is you're trying to delete the service using openstack
client but with the integer id and starting in pike you need to use the
uuid to uniquely identify the service in a cell.

See the note here:

https://docs.openstack.org/python-openstackclient/latest/cli/command-
objects/compute-service.html#compute-service-delete

"If using --os-compute-api-version 2.53 or greater, the ID is a UUID
which can be retrieved by listing compute services using the same 2.53+
microversion."

Anyway, try deleting the service using microversion 2.53 and the service
id as a uuid and see if that solves the issue.

** Changed in: nova
   Status: New => Invalid

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1852665

Title:
  HostMappingNotFound in wigi.py

Status in OpenStack Compute (nova):
  Invalid

Bug description:
  It seems to be diffrent from #1780727.

  # openstack compute service delete 26

  
  Failed to delete compute service with ID '26': 发生意外 API 错误。请在 
http://bugs.launchpad.net/nova/ 处报告此错误,并且附上 Nova API 日志(如果可能)。
   (HTTP 500) (Request-ID: 
req-a693a664-5834-48c6-acd9-c92d8b2eea28)

  nova-api-log:
  2019-11-15 08:41:23.576 11235 ERROR nova.api.openstack.wsgi 
[req-099cb32c-dfbb-4eaf-a067-a3737720977f 7c177645d83f4a769d51ab4b9801a90d 
04627ab3503248cb8d714ac1a44f543f - default default] Unexpected exception in API 
method: HostMappingNotFound: \u4e3b\u673a 
'computer3713hpdl580'\u6ca1\u6709\u6620\u5c04\u5230\u4efb\u4f55\u5355\u5143
  2019-11-15 08:41:23.576 11235 ERROR nova.api.openstack.wsgi Traceback (most 
recent call last):
  2019-11-15 08:41:23.576 11235 ERROR nova.api.openstack.wsgi   File 
"/usr/lib/python2.7/site-packages/nova/api/openstack/wsgi.py", line 801, in 
wrapped
  2019-11-15 08:41:23.576 11235 ERROR nova.api.openstack.wsgi return 
f(*args, **kwargs)
  2019-11-15 08:41:23.576 11235 ERROR nova.api.openstack.wsgi   File 
"/usr/lib/python2.7/site-packages/nova/api/openstack/compute/services.py", line 
237, in delete
  2019-11-15 08:41:23.576 11235 ERROR nova.api.openstack.wsgi service.host)
  2019-11-15 08:41:23.576 11235 ERROR nova.api.openstack.wsgi   File 
"/usr/lib/python2.7/site-packages/nova/exception_wrapper.py", line 79, in 
wrapped
  2019-11-15 08:41:23.576 11235 ERROR nova.api.openstack.wsgi 
function_name, call_dict, binary, tb)
  2019-11-15 08:41:23.576 11235 ERROR nova.api.openstack.wsgi   File 
"/usr/lib/python2.7/site-packages/oslo_utils/excutils.py", line 220, in __exit__
  2019-11-15 08:41:23.576 11235 ERROR nova.api.openstack.wsgi 
self.force_reraise()
  2019-11-15 08:41:23.576 11235 ERROR nova.api.openstack.wsgi   File 
"/usr/lib/python2.7/site-packages/oslo_utils/excutils.py", line 196, in 
force_reraise
  2019-11-15 08:41:23.576 11235 ERROR nova.api.openstack.wsgi 
six.reraise(self.type_, self.value, self.tb)
  2019-11-15 08:41:23.576 11235 ERROR nova.api.openstack.wsgi   File 
"/usr/lib/python2.7/site-packages/nova/exception_wrapper.py", line 69, in 
wrapped
  2019-11-15 08:41:23.576 11235 ERROR nova.api.openstack.wsgi return 
f(self, context, *args, **kw)
  2019-11-15 08:41:23.576 11235 ERROR nova.api.openstack.wsgi   File 
"/usr/lib/python2.7/site-packages/nova/compute/api.py", line 5416, in 
remove_host_from_aggregate
  2019-11-15 08:41:23.576 11235 ERROR nova.api.openstack.wsgi mapping = 
objects.HostMapping.get_by_host(context, host_name)
  2019-11-15 08:41:23.576 11235 ERROR nova.api.openstack.wsgi   File 
"/usr/lib/python2.7/site-packages/oslo_versionedobjects/base.py", line 184, in 
wrapper
  2019-11-15 08:41:23.576 11235 ERROR nova.api.openstack.wsgi result = 
fn(cls, context, *args, **kwargs)
  2019-11-15 08:41:23.576 11235 ERROR nova.api.openstack.wsgi   File 
"/usr/lib/python2.7/site-packages/nova/objects/host_mapping.py", line 100, in 
get_by_host
  2019-11-15 08:41:23.576 11235 ERROR nova.api.openstack.wsgi db_mapping = 
cls._get_by_host_from_db(context, host)
  2019-11-15 08:41:23.576 11235 ERROR nova.api.openstack.wsgi   File 
"/usr/lib/python2.7/site-packages/oslo_db/sqlalchemy/enginefacade.py", line 
993, in wrapper
  2019-11-15 08:41:23.576 11235 ERROR nova.api.openstack.wsgi return 
fn(*args, **kwargs)
  2019-11-15 08:41:23.576 11235 ERROR nova.api.openstack.wsgi   File 
"/usr/lib/python2.7/site-packages/nova/objects/host_mapping.py", line 95, in 
_get_by_host_from_db
  2019-11-15 08:41:23.576 11235 ERROR nova.api.openstack.wsgi raise 
exception.HostMappingNotFound(name=host)
  2019-11-15 08:41:23.576 11235 ERROR nova.api.openstack.wsgi 
HostMappingNotFound: