From: Willy Tarreau Date: Wed, 25 Nov 2026 14:09:21 +0000 (+0100) Subject: BUG/MINOR: resolvers: display the template name instead of "server '(null)'" X-Git-Tag: v3.5-dev14~24 X-Git-Url: https://git.kaiwu.me/http/%22../static/gitweb.js?a=commitdiff_plain;h=55803208c939a9d8d02d474f3c62e97ff8e49f65;p=haproxy.git BUG/MINOR: resolvers: display the template name instead of "server '(null)'" When resolvers fail to create a resolution, the server name is printed, but for templates, the server is not yet assigned so "server '(null)'" is printed, which is ugly and not really helpful. Let's just fall back to the template name and indicate it. This can be backported to all versions. --- diff --git a/src/resolvers.c b/src/resolvers.c index 83f1f17e2..233977825 100644 --- a/src/resolvers.c +++ b/src/resolvers.c @@ -299,8 +299,9 @@ struct resolv_srvrq *new_resolv_srvrq(struct server *srv, char *fqdn) hostname_dn_len = resolv_str_to_dn_label(fqdn, fqdn_len, trash.area, trash.size); if (hostname_dn_len == -1) { - ha_alert("%s '%s', server '%s': failed to parse FQDN '%s'\n", - proxy_type_str(px), px->id, srv->id, fqdn); + ha_alert("%s '%s', server %s'%s': failed to parse FQDN '%s'.\n", + proxy_type_str(px), px->id, srv->id ? "" : "template ", + srv->id ? srv->id : srv->tmpl_info.prefix, fqdn); goto err; }