From a6a4674a21b02f2680d281720a36f18b1ddaf275 Mon Sep 17 00:00:00 2001 From: David Krauser Date: Mon, 12 May 2025 13:38:10 -0400 Subject: [PATCH] Better handle missing cluster node info fields (#30844) A recent change to the enterprise cluster code introduced the possibility that we could get cluster info with empty fields. This happens when we can't properly communicate with the related cluster node. In that case, we now show a warning to the admin. --- .../src/components/admin_console/cluster_table.tsx | 8 ++++++-- .../components/admin_console/cluster_table_container.tsx | 1 + webapp/channels/src/i18n/en.json | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/webapp/channels/src/components/admin_console/cluster_table.tsx b/webapp/channels/src/components/admin_console/cluster_table.tsx index 9593b7dc23..f859c2d02a 100644 --- a/webapp/channels/src/components/admin_console/cluster_table.tsx +++ b/webapp/channels/src/components/admin_console/cluster_table.tsx @@ -74,7 +74,7 @@ export default class ClusterTable extends PureComponent { ); @@ -94,10 +94,12 @@ export default class ClusterTable extends PureComponent { }); const items = this.props.clusterInfos.map((clusterInfo) => { + let hasUnknownFields = false; let status = null; let hostname: React.ReactNode = clusterInfo.hostname; if (hostname === '') { + hasUnknownFields = true; hostname = ( { let version: React.ReactNode = clusterInfo.version; if (version === '') { + hasUnknownFields = true; version = ( { let configHash: React.ReactNode = clusterInfo.config_hash; if (configHash === '') { + hasUnknownFields = true; configHash = ( { ); } - if (singleItem) { + if (singleItem || hasUnknownFields) { status = ( Cluster status { const [clusterInfos, setClusterInfos] = useState(null); const load = useCallback(() => { + setClusterInfos(null); getClusterStatus(setClusterInfos, null); }, []); diff --git a/webapp/channels/src/i18n/en.json b/webapp/channels/src/i18n/en.json index 6bd3971292..f2ad5dffbb 100644 --- a/webapp/channels/src/i18n/en.json +++ b/webapp/channels/src/i18n/en.json @@ -567,7 +567,7 @@ "admin.cluster.unknown": "unknown", "admin.cluster.UseIPAddress": "Use IP Address:", "admin.cluster.UseIPAddressDesc": "When true, the cluster will attempt to communicate via IP Address vs using the hostname.", - "admin.cluster.version_mismatch_warning": "WARNING: Multiple versions of Mattermost has been detected in your HA cluster. Unless you are currently performing an upgrade please ensure all nodes in your cluster are running the same Mattermost version to avoid platform disruption.", + "admin.cluster.version_mismatch_warning": "WARNING: Multiple Mattermost versions have been detected in your HA cluster, or the running versions cannot be properly identified. Unless upgrading, ensure all nodes are on the same version and can communicate via Gossip to prevent platform issues.", "admin.compliance_export_feature_discovery.copy": "Run daily compliance reports and export them to a variety of formats consumable by third-party integration tools such as Smarsh (Actiance).", "admin.compliance_export_feature_discovery.title": "Run compliance exports with Mattermost Enterprise", "admin.compliance_reports.desc": "Job Name:",