nova-scheduler will crash at startup if placement is not up

Bug #2012530 reported by Dan Smith
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Unassigned

Bug Description

This is the same problem as https://bugs.launchpad.net/nova/+bug/1846820 but for scheduler. Because we initialize our placement client during manager init, we will crash (and loop) on startup if keystone or placement are down. Example trace:

Mar 22 15:54:39 jammy nova-scheduler[119746]: ERROR nova.scheduler.client.report [None req-edf51111-6f86-4910-a458-72decae8e451 None None] Failed to initialize placement client (is keystone available?): openstack.exceptions.NotSupported: The placement service for 192.168.122.154:RegionOne exists but does not have any supported versions.
Mar 22 15:54:39 jammy nova-scheduler[119746]: CRITICAL nova [None req-edf51111-6f86-4910-a458-72decae8e451 None None] Unhandled error: openstack.exceptions.NotSupported: The placement service for 192.168.122.154:RegionOne exists but does not have any supported versions.
Mar 22 15:54:39 jammy nova-scheduler[119746]: ERROR nova Traceback (most recent call last):
Mar 22 15:54:39 jammy nova-scheduler[119746]: ERROR nova File "/usr/local/bin/nova-scheduler", line 10, in <module>
Mar 22 15:54:39 jammy nova-scheduler[119746]: ERROR nova sys.exit(main())
Mar 22 15:54:39 jammy nova-scheduler[119746]: ERROR nova File "/opt/stack/nova/nova/cmd/scheduler.py", line 47, in main
Mar 22 15:54:39 jammy nova-scheduler[119746]: ERROR nova server = service.Service.create(
Mar 22 15:54:39 jammy nova-scheduler[119746]: ERROR nova File "/opt/stack/nova/nova/service.py", line 252, in create
Mar 22 15:54:39 jammy nova-scheduler[119746]: ERROR nova service_obj = cls(host, binary, topic, manager,
Mar 22 15:54:39 jammy nova-scheduler[119746]: ERROR nova File "/opt/stack/nova/nova/service.py", line 116, in __init__
Mar 22 15:54:39 jammy nova-scheduler[119746]: ERROR nova self.manager = manager_class(host=self.host, *args, **kwargs)
Mar 22 15:54:39 jammy nova-scheduler[119746]: ERROR nova File "/opt/stack/nova/nova/scheduler/manager.py", line 70, in __init__
Mar 22 15:54:39 jammy nova-scheduler[119746]: ERROR nova self.placement_client = report.report_client_singleton()
Mar 22 15:54:39 jammy nova-scheduler[119746]: ERROR nova File "/opt/stack/nova/nova/scheduler/client/report.py", line 91, in report_client_singleton
Mar 22 15:54:39 jammy nova-scheduler[119746]: ERROR nova PLACEMENTCLIENT = SchedulerReportClient()
Mar 22 15:54:39 jammy nova-scheduler[119746]: ERROR nova File "/opt/stack/nova/nova/scheduler/client/report.py", line 234, in __init__
Mar 22 15:54:39 jammy nova-scheduler[119746]: ERROR nova self._client = self._create_client()
Mar 22 15:54:39 jammy nova-scheduler[119746]: ERROR nova File "/opt/stack/nova/nova/scheduler/client/report.py", line 277, in _create_client
Mar 22 15:54:39 jammy nova-scheduler[119746]: ERROR nova client = self._adapter or utils.get_sdk_adapter('placement')
Mar 22 15:54:39 jammy nova-scheduler[119746]: ERROR nova File "/opt/stack/nova/nova/utils.py", line 984, in get_sdk_adapter
Mar 22 15:54:39 jammy nova-scheduler[119746]: ERROR nova return getattr(conn, service_type)
Mar 22 15:54:39 jammy nova-scheduler[119746]: ERROR nova File "/usr/local/lib/python3.10/dist-packages/openstack/service_description.py", line 87, in __get__
Mar 22 15:54:39 jammy nova-scheduler[119746]: ERROR nova proxy = self._make_proxy(instance)
Mar 22 15:54:39 jammy nova-scheduler[119746]: ERROR nova File "/usr/local/lib/python3.10/dist-packages/openstack/service_description.py", line 266, in _make_proxy
Mar 22 15:54:39 jammy nova-scheduler[119746]: ERROR nova raise exceptions.NotSupported(
Mar 22 15:54:39 jammy nova-scheduler[119746]: ERROR nova openstack.exceptions.NotSupported: The placement service for 192.168.122.154:RegionOne exists but does not have any supported versions.
Mar 22 15:54:39 jammy nova-scheduler[119746]: ERROR nova

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

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/nova/+/878238

Changed in nova:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.opendev.org/c/openstack/nova/+/878238
Committed: https://opendev.org/openstack/nova/commit/d37cca361a4d575311318cb870da40079eb1617c
Submitter: "Zuul (22348)"
Branch: master

commit d37cca361a4d575311318cb870da40079eb1617c
Author: Dan Smith <email address hidden>
Date: Wed Mar 22 08:20:58 2023 -0700

    Make scheduler lazy-load the placement client

    Like we did for conductor, this makes the scheduler lazy-load the
    placement client instead of only doing it during __init__. This avoids
    a startup crash if keystone or placement are not available, but
    retains startup failures for other problems and errors likely to be
    a result of misconfigurations.

    Closes-Bug: #2012530
    Change-Id: I42ed876b84d80536e83d9ae01696b0a64299c9f7

Changed in nova:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 28.0.0.0rc1

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

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.