Project

General

Profile

Actions

Bug #81857

open
RF RF

qa/mgr/dashboard: test_list_enabled_module times out because the dashboard restarts on the default port 8443 instead of the assigned 7789

Bug #81857: qa/mgr/dashboard: test_list_enabled_module times out because the dashboard restarts on the default port 8443 instead of the assigned 7789

Added by Ronen Friedman about 2 months ago. Updated about 13 hours ago.

Status:
New
Priority:
Normal
Category:
-
Target version:
-
Due date:
% Done:

0%

Source:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Tags (freeform):
Merge Commit:
Fixed In:
Released In:
Upkeep Timestamp:

Description

Run: rfriedma-2026-10-18_07:28:21-rados-wip-rf-snapby1-distro-default-trial, job 652999
Suite: rados/dashboard/{0-single-container-host debug/mgr mon_election/classic random-objectstore$/{bluestore-comp-lz4} tasks/dashboard}
Version: 21.3.0-4339-g2a0b8e06 (main plus five commits touching only src/osd/OSD.{cc,h} and qa/standalone/osd/osd-purged-snaps.sh)
Hosts: trial144 (mon.a, mon.c, mgr.x, mds.a, mds.c, osd.0, client.0), trial182 (mon.b, mgr.y, mgr.z, mds.b, osd.1-3)

90 tests ran; 1 error, 1 skipped:

Test failure: test_list_enabled_module (tasks.mgr.dashboard.test_mgr_module.MgrModuleTest.test_list_enabled_module)
tasks.ceph_test_case.TestTimeoutError: Timed out after 30s and 0 retries
caused by: requests.exceptions.ConnectionError: HTTPSConnectionPool(host='10.20.193.144', port=7789):
Max retries exceeded with url: /api/mgr/module
(Caused by NewConnectionError("... Failed to establish a new connection: [Errno 111] Connection refused"))

Observed sequence (mon.a, mgr.x, mgr.y, mgr.z logs):

08:16:17-08:16:31  MgrModuleTest setUpClass: mgr fail x/y/z, dashboard disabled/re-enabled,
config/mgr/mgr/dashboard/{x,y,z}/ssl_server_port set to 7789/7790/7791,
mgrs restarted. mgr.x becomes active and logs:
"mgr get_typed_config x/ssl_server_port found"
"[dashboard INFO dashboard] server: ssl=yes host=:: port=7789"
"Starting ceph dashboard server at https://10.20.193.144:7789/"
mgr.y binds 7790, mgr.z binds 7791.
08:16:42-08:16:43 test_disable runs and passes.
08:16:43.611 mon.a receives mon_command({"prefix": "config reset", "num": 1}) from
client.admin and logs:
encode_pending_to_kvmon rm config/mgr/mgr/dashboard/x/ssl_server_port
encode_pending_to_kvmon rm config/mgr/mgr/dashboard/y/ssl_server_port
encode_pending_to_kvmon rm config/mgr/mgr/dashboard/z/ssl_server_port
encode_pending_to_kvmon rm config/mgr/mgr/dashboard/MULTICLUSTER_CONFIG
encode_pending_to_kvmon rm config/mds/defer_client_eviction_on_laggy_osds
The same command is issued 316 times over the job.
08:16:47-08:16:55 test_get and test_list_disabled_module run and pass; the already-running
dashboard is still bound to 7789.
08:17:00.13 test_list_enabled_module runs "ceph mgr module enable iostat";
mgrmap e238 shows x(active, starting) - all three mgrs respawn.
08:17:00.95-.97 All three mgrs fail to find the per-mgr option and fall back to the default:
mgr.x: "get_typed_config [x/]ssl_server_port not found"
"server: ssl=yes host=:: port=8443"
"Starting ceph dashboard server at https://10.20.193.144:8443/"
mgr.y: "[y/]ssl_server_port not found" -> port 8443
mgr.z: "[z/]ssl_server_port not found" -> port 8443
08:17:02.14 mgr.z (co-located with mgr.y on trial182) logs
[ERR] Unhandled exception from module 'dashboard' while running on mgr.z:
Port 8443 not free on ::.
and archives a crash record
(remote/trial182/crash/2026-10-18T08:17:02.140590Z_1267e7c8-532c-427b-bea4-a8212ffe82c2,
portend.PortNotFree: Port 8443 is in use on ::).
08:16:59-08:18:04 The test polls https://10.20.193.144:7789/api/mgr/module and gets
ECONNREFUSED throughout; wait_until_rest_api_accessible (30s timeout,
@retry(tries=2)) exhausts after ~65s and the test errors out.

Expected: after the mgr respawn triggered by "mgr module enable iostat", the dashboard on
mgr.x should come back on the port assigned to it by the test setup (7789), so that
wait_until_rest_api_accessible succeeds.

No OSD, MDS, mon or RADOS failures were observed in this job; the only archived crash is the
mgr.z dashboard module crash listed above.

RF Updated by Ronen Friedman about 2 months ago Actions #1

Analysis (hypothesis, consistent with the logs but not yet confirmed by a targeted reproducer):

The "config reset 1" at 08:16:43 appears to come from CephTestCase.tearDown()
(qa/tasks/ceph_test_case.py:170), which runs

self.ceph_cluster.mon_manager.raw_cluster_cmd("config", "reset", str(self.ctx.conf_epoch))

after every single test. ctx.conf_epoch is captured once during cluster bring-up by
CephManager.save_conf_epoch() (qa/tasks/ceph_manager.py:1654, invoked from the ceph task), and
in this job its value is 1 - i.e. earlier than any configuration the test framework itself
writes later.

The per-mgr dashboard ports are written after that point, by
MgrTestCase.setup_mgrs() -> _assign_module_ports() (qa/tasks/mgr/mgr_test_case.py:240), driven by
DashboardTestCase.MODULE_PORTS = [("dashboard", "ssl_server_port", 7789)]
(qa/tasks/mgr/dashboard/helper.py:41). Those keys therefore live at a config version above
conf_epoch and are removed by the first tearDown of the class. This matches the mon.a log, where
the same "config reset" also removes mgr/dashboard/MULTICLUSTER_CONFIG and
mds/defer_client_eviction_on_laggy_osds.

The damage stays latent because the dashboard module only reads ssl_server_port in serve(): the
instance already listening on 7789 keeps running, so test_get and test_list_disabled_module still
pass. The next mgr respawn is what exposes it - and "ceph mgr module enable iostat" in
test_list_enabled_module changes the mgrmap module list, respawning all three mgrs. On restart
the option is gone and every mgr falls back to the 8443 default, which also explains the mgr.z
"Port 8443 not free" crash: mgr.y and mgr.z share trial182 and both tried to bind the same
default port.

The test's own respawn handling (wait_until_rest_api_accessible with @retry(tries=2) and a 30s
wait_until_true) is working as designed; it is simply polling a port the dashboard no longer
listens on, so no amount of waiting can succeed.

Why this is intermittent rather than deterministic: it requires a test inside a class to cause
an mgr respawn after at least one tearDown has fired. In MgrModuleTest the alphabetically earlier
tests do not respawn (test_disable goes through the dashboard API, and
test_list_disabled_module's "mgr module disable iostat" is a no-op on an already-disabled
module), so test_list_enabled_module is the first one that does.

Possibly relevant history (unverified as the trigger): 4af78378a9d "qa/tasks/mgr: bounce the mgrs
once per test class" moved port assignment from the old per-class _assign_ports() into the
MODULE_PORTS path in setup_mgrs(). With the old code the ports were re-written on every class
bounce; with the new code nothing re-establishes the keys after a reset. This commit is in
upstream main, so the failure is not specific to the branch under test.

This looks like it may be the same underlying problem as #62972 ("test_list_enabled_module"),
which was addressed in a2a4a3415c0 by probing for a free port. That change does not prevent the
config keys from being deleted, so it would not cover this path.

Proposed fixing options (all unvalidated):
1. Have MgrTestCase override tearDown to re-apply MODULE_PORTS after CephTestCase.tearDown()
runs the config reset, making the assignment idempotent.
2. Have MgrTestCase.setup_mgrs() call save_conf_epoch() again after assigning the ports, so the
per-test reset rolls back to a point after the port assignment instead of before it.
3. Narrow CephTestCase.tearDown() so it does not reset configuration that the test framework
itself owns, rather than resetting the whole mon config store.

Option 2 looks like the smallest change, but I have not tested any of these.

Unrelated note that cost some time while reading the logs: the ceph-mgr log files in this archive
contain NUL bytes (a respawning mgr reopens the log and writes at an earlier offset), so plain
grep treats them as binary and silently stops printing. "grep -a" is needed.

LF Updated by Laura Flores about 1 month ago Actions #2

  • Project changed from Ceph to Dashboard

AL Updated by Adam Lyon-Jones about 1 month ago Actions #3

/a/skanta-2026-10-12_23:32:34-rados-wip-bharath20-testing-20261012.132505-main-distro-default-trial
2 jobs: ['631092', '631262']

TS Updated by Tom Sollers about 1 month ago Actions #4

/a/skanta-2026-10-18_03:25:53-rados-wip-bharath31-testing-20261017.231147-umbrella-distro-default-trial/651621

LS Updated by Lee Sanders about 1 month ago Actions #5

/a/skanta-2026-10-17_23:23:20-rados-wip-bharath4-testing-20261016.224944-main-distro-default-trial/650633
/a/skanta-2026-10-17_23:23:20-rados-wip-bharath4-testing-20261016.224944-main-distro-default-trial/650799

JP Updated by Jaya Prakash about 1 month ago Actions #6

/a/jayaprakash-2026-10-29_08:29:24-rados-wip-jaya-bs-testing-28-10-2026-distro-default-trial/690979

MW Updated by Matty Williams about 1 month ago Actions #7

/a/skanta-2026-10-28_03:11:19-rados-wip-bharath14-testing-20261027.071324-main-distro-default-trial/
Jobs: [‘684804’,’684970’]

JP Updated by Jaya Prakash 29 days ago Actions #8

/a/skanta-2026-10-28_01:57:03-rados-wip-bharath7-testing-20261027.080203-main-distro-default-trial
684145, 684311

KS Updated by Kamoltat (Junior) Sirivadhna 29 days ago Actions #9

/a/skanta-2026-10-12_16:15:49-rados-wip-bharath5-testing-20261012.095720-main-distro-default-trial/628564/

CF Updated by Connor Fawcett 29 days ago Actions #10

RADOS watcher: Showed up on the latest jenkins run

/a/jenkins-build-2026-10-31_06:05:10-rados-main-distro-default-trial/697686/
/a/jenkins-build-2026-10-31_06:05:10-rados-main-distro-default-trial/698015/

AL Updated by Adam Lyon-Jones 24 days ago Actions #12

/a/skanta-2026-10-28_02:23:40-rados-wip-bharath1-testing-20261027.065658-main-distro-default-trial
2 jobs: ['684475', '684640']

MW Updated by Matty Williams 9 days ago Actions #15

/a/skanta-2026-11-21_04:34:59-rados-wip-bharath32-testing-20261121.005100-umbrella-distro-default-trial/775911
/a/skanta-2026-11-21_04:34:59-rados-wip-bharath32-testing-20261121.005100-umbrella-distro-default-trial/776074

LF Updated by Laura Flores 9 days ago Actions #16

/a/lflores-2026-11-23_15:31:46-rados-wip-vallari-testing-20261120.045904-main-distro-default-trial/785271
/a/lflores-2026-11-23_15:31:46-rados-wip-vallari-testing-20261120.045904-main-distro-default-trial/785469

JP Updated by Jaya Prakash 8 days ago Actions #17

/a/jayaprakash-2026-11-24_13:05:30-rados-wip-jaya-bs-testing-24-11-2026-distro-default-trial/788011

JP Updated by Jaya Prakash 7 days ago Actions #18

/a/jayaprakash-2026-11-26_10:28:29-rados-wip-jaya-bs-testing-25-11-2026-distro-default-trial/796779

SS Updated by Sridhar Seshasayee 3 days ago Actions #19

/a/skanta-2026-11-22_04:11:52-rados-wip-bharath29-testing-20261121.045602-main-distro-default-trial/
2 jobs: ['780877', '780892']

JB Updated by Jonathan Bailey 2 days ago Actions #20

/a/skanta-2026-11-12_12:26:56-rados-wip-bharath7-testing-20261109.045335-tentacle-distro-default-trial/753853
/a/skanta-2026-11-12_12:26:56-rados-wip-bharath7-testing-20261109.045335-tentacle-distro-default-trial/754012

CJ Updated by Callum James 1 day ago Actions #21

skanta-2026-11-25_04:38:28-rados-wip-bharath39-testing-20261125.004814-main-distro-default-trial/789182/
skanta-2026-11-25_04:38:28-rados-wip-bharath39-testing-20261125.004814-main-distro-default-trial/789376/

CF Updated by Connor Fawcett 1 day ago Actions #22

/a/skanta-2026-11-12_03:57:47-rados-wip-bharath5-testing-20261109.044959-umbrella-distro-default-trial/750634
/a/skanta-2026-11-12_03:57:47-rados-wip-bharath5-testing-20261109.044959-umbrella-distro-default-trial/750669

AM Updated by Aishwarya Mathuria about 13 hours ago Actions #23

/a/skanta-2026-11-22_03:57:27-rados-wip-bharath9-testing-20261121.044028-main-distro-default-trial/
2 jobs: [780789, 780800]

Actions

Also available in: PDF Atom