Repository navigation
Failed to start HAProxy's event listener:version data not found #391
Copy link
Copy link
Closed as not planned
Description
I'd like to make event listener work to avoid reloading haproxy frequently.
Similar to #387
time="2025-10-04T02:51:09Z" level=info msg="HAProxy Data Plane API v3.2.4 1eed677a"
time="2025-10-04T02:51:09Z" level=info msg="Build from: https://github.com/haproxytech/dataplaneapi"
time="2025-10-04T02:51:09Z" level=info msg="Build date: 2025-09-23T08:14:28Z"
time="2025-10-04T02:51:09Z" level=info msg="Reload strategy: systemd"
time="2025-10-04T02:51:09Z" level=error msg="Failed to start HAProxy's event listener:version data not found"
time="2025-10-04T02:51:09Z" level=debug msg="discovery job starting" ID=8328ca23-c6e4-4e9e-815f-1489baf2baf3 ServiceDiscovery=AWS
time="2025-10-04T02:51:09Z" level=debug msg="-- command socket updating client_native client"
time="2025-10-04T02:51:09Z" level=info msg="Serving data plane at http://[::]:5555"
time="2025-10-04T02:51:09Z" level=debug msg="-- command socket Server. conf ready..."
time="2025-10-04T02:51:10Z" level=debug msg="-- command socket handleClientNativeClientUpdate stopped"
time="2025-10-04T02:51:10Z" level=debug msg="-- command socket not set (--debug_socket_path). Not running the command socket server"
time="2025-10-04T02:51:10Z" level=debug msg="Mode: single"
time="2025-10-04T02:51:19Z" level=debug msg="discovery job update triggered" ID=8328ca23-c6e4-4e9e-815f-1489baf2baf3 ServiceDiscovery=AWS
time="2025-10-04T02:51:20Z" level=debug msg="discovery job reconciliation completed" ID=8328ca23-c6e4-4e9e-815f-1489baf2baf3 ServiceDiscovery=AWS
time="2025-10-04T02:51:20Z" level=debug msg="Scheduling a new reload..." reload_id=2025-10-04-0
time="2025-10-04T02:51:24Z" level=debug msg="Reload started" reload_id=2025-10-04-0
time="2025-10-04T02:51:24Z" level=debug msg="Reload successful" reload_id=2025-10-04-0
time="2025-10-04T02:51:24Z" level=debug msg="Reload finished in 108.304043ms" reload_id=2025-10-04-0
Just as the logs said, Data Plane API failed to start HAProxy's event listener because "version data not found".
I have traced that "version data not found" is supposed to be returned by client-native/v6.
I unit tested GetVersion() of client-native/v6 on the same server and it worked.
package main
import (
"context"
"fmt"
"log"
"os"
// Updated import paths for v6
runtime_api "github.com/haproxytech/client-native/v6/runtime"
"github.com/haproxytech/client-native/v6/runtime/options"
)
func main() {
ctx := context.Background()
// Check if socket exists (for local testing)
socketPath := "/var/run/haproxy.sock"
if _, err := os.Stat(socketPath); os.IsNotExist(err) {
fmt.Printf("HAProxy socket not found at %s\n", socketPath)
return
}
// Create runtime client with socket options
socketOption := options.Socket(socketPath)
runtimeClient, err := runtime_api.New(ctx, socketOption)
if err != nil {
log.Fatalf("Error creating runtime client: %v", err)
}
// Get the HAProxy version.
version, err := runtimeClient.GetVersion()
if err != nil {
log.Fatalf("Error getting HAProxy version: %v", err)
}
// Print the version. The version string might include the release date.
fmt.Printf("HAProxy Version: %s\n", version)
}
HAProxy Version: {ba0fd6b 3.2.5-ba0fd6b %!s(int=3) %!s(int=2) %!s(int=5)}
my dataplaneapi.yml
dataplaneapi:
host: 0.0.0.0
port: 5555
userlist:
userlist: dataplaneapi
resources:
maps_dir: /etc/haproxy/maps
ssl_certs_dir: /etc/haproxy/ssl
general_storage_dir: /etc/haproxy/general
spoe_dir: /etc/haproxy/spoe
transaction:
transaction_dir: /var/lib/dataplaneapi/transactions
backups_number: 10
backups_dir: /var/lib/dataplaneapi/backups
haproxy:
config_file: /etc/haproxy/haproxy.cfg
haproxy_bin: /usr/sbin/haproxy
master_runtime: /var/run/haproxy.sock
master_worker_mode: true
reload:
reload_delay: 5
service_name: haproxy
reload_strategy: systemd
log_targets:
- log_to: file
log_file: /var/log/dataplaneapi.log
log_level: info
log_types:
- access
- app
I guess it is some kind of misconfigure issue but I have lost in the code of dataplaneapi.
Any help?
Metadata
Metadata
Assignees
Labels
No labels
Activity
islue commentedon Oct 4, 2025
I have tried 3.2.3
The error message doesn't show but dataplaneapi still reloads haproxy when changes in service discovery happen.
oliwer commentedon Oct 6, 2025
FYI, the EventListener only starts if HAProxy runs in master/worker mode. It is only used during ACME renewals for now.
islue commentedon Oct 6, 2025
Thank you for the information.
I misunderstood the EventListener relevant logs. I thought it meant dataplaneapi failed to use the admin socket.
oliwer commentedon Oct 6, 2025
Still, thanks for the report. I will investigate because this should not happen. The EventListener is just a permanent connection to the Master socket.
cello86 commentedon Feb 19, 2026
@oliwer I used the version 3.2.8 with haproxy started in master worker mode:
but i noticed the error during startup and all runtime APIs fail:
Marcello
oliwer commentedon Feb 19, 2026
@cello86 This means dataplaneapi was not able to determine which version of HAProxy is running. It's the first thing it tries to do at startup when connecting to the master socket. When that fails, nothing using the socket will work.
cello86 commentedon Feb 19, 2026
@oliwer I configured the socket:
I tested it via socat:
I can't find the solution for this issue. I also noticed that if I update the configuration via API the file haproxy.cfg changes but the reload command doesn't be executed.
Marcello
oliwer commentedon Feb 19, 2026
I think I found what's wrong: you've run haproxy with
-Wbut did not specify the master socket address with-S. So dataplaneapi is talking to you stats socket thinking it's a master socket.I think you want to run:
haproxy -W -S /data/external/haproxy/run/master.sock -db -f /etc/haproxy/haproxy.cfgand use that address to configure themaster_runtimeoption in dataplaneapi.yml.oliwer commentedon Feb 19, 2026
This chapter is useful: https://docs.haproxy.org/3.3/management.html#9.4
ema-pe commentedon Apr 2, 2026
Hi, from the source code it seems that only supports UNIX sockets and not TCP4/TCP6, right?
oliwer commentedon Apr 2, 2026
That is correct and it is by design. UNIX socket only.
ema-pe commentedon Apr 2, 2026
Ok, thank you. I noticed it because
stats socketsupports tcp sockets.