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

Bug #1805164 reported by Jack Ivanov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Matt Riedemann
Pike
Triaged
Low
Unassigned
Queens
Fix Committed
Low
s10
Rocky
Fix Committed
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!

Tags: api usability
Revision history for this message
Jack Ivanov (gunph1ld) wrote :

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

Revision history for this message
Takashi Natsume (natsume-takashi) wrote :

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
Revision history for this message
Jack Ivanov (gunph1ld) wrote :

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

Revision history for this message
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)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

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

Changed in nova:
status: Triaged → In Progress
Revision history for this message
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.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

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
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/rocky)

Fix proposed to branch: stable/rocky
Review: https://review.openstack.org/636955

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/rocky)

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)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/queens)

Fix proposed to branch: stable/queens
Review: https://review.openstack.org/638803

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/queens)

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)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 19.0.0.0rc1

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 17.0.10

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 18.2.0

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  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.