From 508d232a06cf082ff2cc694d3f1c03b10a07e719 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Fri, 24 Jan 2020 07:19:34 +0100 Subject: [PATCH] BUG/MINOR: stktable: report the current proxy name in error messages Since commit 1b8e68e89a ("MEDIUM: stick-table: Stop handling stick-tables as proxies."), a rule referencing the current proxy with no table leads to the following error : [ALERT] 023/071924 (16479) : Proxy 'px': unable to find stick-table '(null)'. [ALERT] 023/071914 (16479) : Fatal errors found in configuration. for a config like this one: backend px stick on src This patch fixes it and should be backported as far as 2.0. --- src/cfgparse.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cfgparse.c b/src/cfgparse.c index 3d72af9ad..91ca63d6a 100644 --- a/src/cfgparse.c +++ b/src/cfgparse.c @@ -2728,7 +2728,7 @@ int check_config_validity() if (!target) { ha_alert("Proxy '%s': unable to find stick-table '%s'.\n", - curproxy->id, mrule->table.name); + curproxy->id, mrule->table.name ? mrule->table.name : curproxy->id); cfgerr++; } else if (!stktable_compatible_sample(mrule->expr, target->type)) { @@ -2766,7 +2766,7 @@ int check_config_validity() if (!target) { ha_alert("Proxy '%s': unable to find store table '%s'.\n", - curproxy->id, mrule->table.name); + curproxy->id, mrule->table.name ? mrule->table.name : curproxy->id); cfgerr++; } else if (!stktable_compatible_sample(mrule->expr, target->type)) {