Confusing error message when trying to disable non-nova-compute service

Bug #1805164 reported by Jack Ivanov on 2018-11-26
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Low
Matt Riedemann
Pike
Low
Unassigned
Queens
Low
s10
Rocky
Low
Matt Riedemann

Bug Description

I'm trying to disable nova services, but the requests fail.

python-nova-17.0.7-1.el7.noarch
openstack-nova-api-17.0.7-1.el7.noarch
openstack-nova-novncproxy-17.0.7-1.el7.noarch
openstack-nova-placement-api-17.0.7-1.el7.noarch
python2-novaclient-10.1.0-1.el7.noarch
openstack-nova-conductor-17.0.7-1.el7.noarch
openstack-nova-scheduler-17.0.7-1.el7.noarch
openstack-nova-console-17.0.7-1.el7.noarch
openstack-nova-common-17.0.7-1.el7.noarch

How to reproduce:
# openstack compute service set p024.domain.com nova-consoleauth --disable
Failed to set service status to disabled
Compute service nova-consoleauth of host p024.domain.com failed to set.

Logs:
Action: 'update', calling method: <function version_select at 0x7f49474a8938>, body: {"binary": "nova-consoleauth", "host": "p024.domain.com"} _process_stack /usr/lib/python2.7/site-packages/nova/api/openstack/wsgi.py:604
HTTP exception thrown: Host 'p024.domain.com' is not mapped to any cell
Returning 404 to user: Host 'p024.domain.com' is not mapped to any cell __call__ /usr/lib/python2.7/site-packages/nova/api/openstack/wsgi.py:1064
XX.XX.XX.XX "PUT /v2.1/os-services/disable HTTP/1.1" status: 404 len: 511 time: 0.3039389

Why nova-consoleauth should be mapped to a cell? Is that a bug?

Thanks!

Jack Ivanov (gunph1ld) wrote :

# nova-manage cell_v2 simple_cell_setup
Cell0 is already setup
All hosts are already mapped to cell(s), exiting.

The "PUT /os-services/disable" API is just for a compute service (nova-compute).
It says that "Disables scheduling for a Compute service." in the compute API reference.

https://developer.openstack.org/api-ref/compute/?expanded=disable-scheduling-for-a-compute-service-detail#disable-scheduling-for-a-compute-service

But the error message is confusing and there are no checks whether the 'binary' is nova-compute or not.
It had better be fixed.

tags: added: api
Jack Ivanov (gunph1ld) wrote :

So there is no way to disable other services? I would love to see that implemented

Matt Riedemann (mriedem) wrote :

As Takashi noted, disabling/enabling/forcing down/up services is only for compute services. There is no functional point to disabling conductor/scheduler/consoleauth. This was noted in the Pike release notes:

https://docs.openstack.org/releasenotes/nova/pike.html#relnotes-16-0-0-stable-pike-other-notes

The thing I think Takashi notes is the confusing error message:

"HTTP exception thrown: Host 'p024.domain.com' is not mapped to any cell"

We could check the binary in that case and if it's not 'compute' then we can provide a more useful error message.

Changed in nova:
status: New → Triaged
importance: Undecided → Medium
tags: added: usability
summary: - Services can not be disabled
+ Confusing error message when trying to disable non-nova-compute service
Changed in nova:
importance: Medium → Low
assignee: nobody → Matt Riedemann (mriedem)

Fix proposed to branch: master
Review: https://review.openstack.org/620667

Changed in nova:
status: Triaged → In Progress
Jack Ivanov (gunph1ld) wrote :

This is not only about the error message. The command line client also should be fixed.

# openstack help compute service set
usage: openstack compute service set [-h] [--enable | --disable]
                                     [--disable-reason <reason>]
                                     [--up | --down]
                                     <host> <service>
...

It's confusing and absolutely doesn't make any sense of specifying <service> in the query, because there is no any choice to specify anything except nova-compute.

Reviewed: https://review.openstack.org/620667
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=95cbc35b0bdae0de15569bc35fadbcf970da5b9e
Submitter: Zuul
Branch: master

commit 95cbc35b0bdae0de15569bc35fadbcf970da5b9e
Author: Matt Riedemann <email address hidden>
Date: Wed Nov 28 12:52:17 2018 -0500

    Provide a useful error message when trying to update non-compute services

    Starting in Pike, we disallowed trying to update (enable/disable/force down)
    non-nova-compute services because of multi-cell support using host mappings
    to lookup service records, and simply because disabling non-compute services
    doesn't do anything.

    However, before microversion 2.53, the error the user gets back is confusing:

      HTTP exception thrown: Host 'p024.domain.com' is not mapped to any cell

    This change provides a useful error message in this case and also changes
    the 404 response to a 400 response to align with the type of error and the
    behavior of the 2.53 microversion.

    Change-Id: I44f09aec60b0b18c458f9ba6d8b725db962e9cc7
    Closes-Bug: #1805164

Changed in nova:
status: In Progress → Fix Released

Reviewed: https://review.openstack.org/636955
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=315d9fab7aaa6b9835e80f5f56b49b44d382ca1f
Submitter: Zuul
Branch: stable/rocky

commit 315d9fab7aaa6b9835e80f5f56b49b44d382ca1f
Author: Matt Riedemann <email address hidden>
Date: Wed Nov 28 12:52:17 2018 -0500

    Provide a useful error message when trying to update non-compute services

    Starting in Pike, we disallowed trying to update (enable/disable/force down)
    non-nova-compute services because of multi-cell support using host mappings
    to lookup service records, and simply because disabling non-compute services
    doesn't do anything.

    However, before microversion 2.53, the error the user gets back is confusing:

      HTTP exception thrown: Host 'p024.domain.com' is not mapped to any cell

    This change provides a useful error message in this case and also changes
    the 404 response to a 400 response to align with the type of error and the
    behavior of the 2.53 microversion.

    Change-Id: I44f09aec60b0b18c458f9ba6d8b725db962e9cc7
    Closes-Bug: #1805164
    (cherry picked from commit 95cbc35b0bdae0de15569bc35fadbcf970da5b9e)

Reviewed: https://review.openstack.org/638803
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=b041160c8d56f657059743bc5a0e6dbefc27ddd6
Submitter: Zuul
Branch: stable/queens

commit b041160c8d56f657059743bc5a0e6dbefc27ddd6
Author: Matt Riedemann <email address hidden>
Date: Wed Nov 28 12:52:17 2018 -0500

    Provide a useful error message when trying to update non-compute services

    Starting in Pike, we disallowed trying to update (enable/disable/force down)
    non-nova-compute services because of multi-cell support using host mappings
    to lookup service records, and simply because disabling non-compute services
    doesn't do anything.

    However, before microversion 2.53, the error the user gets back is confusing:

      HTTP exception thrown: Host 'p024.domain.com' is not mapped to any cell

    This change provides a useful error message in this case and also changes
    the 404 response to a 400 response to align with the type of error and the
    behavior of the 2.53 microversion.

    Change-Id: I44f09aec60b0b18c458f9ba6d8b725db962e9cc7
    Closes-Bug: #1805164
    (cherry picked from commit 95cbc35b0bdae0de15569bc35fadbcf970da5b9e)
    (cherry picked from commit 315d9fab7aaa6b9835e80f5f56b49b44d382ca1f)

This issue was fixed in the openstack/nova 19.0.0.0rc1 release candidate.

This issue was fixed in the openstack/nova 17.0.10 release.

This issue was fixed in the openstack/nova 18.2.0 release.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers