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.
(cherry picked from commit 508d232a06cf082ff2cc694d3f1c03b10a07e719)
Signed-off-by: Willy Tarreau <w@1wt.eu>
(cherry picked from commit e66ed8abc963ec689e2ba672e1be90249ab2612c)
Signed-off-by: Willy Tarreau <w@1wt.eu>
diff --git a/src/cfgparse.c b/src/cfgparse.c
index 3bbb802..3496d25 100644
--- a/src/cfgparse.c
+++ b/src/cfgparse.c
@@ -2729,7 +2729,7 @@
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)) {
@@ -2767,7 +2767,7 @@
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)) {