You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Due to the fact that the trace output of the dataplaneapi binary was not very helpful have I added this lines to the code which creates the output below.
log.Warningf("Error setting up runtime client with master socket: %s : %s", masterSocket, err.Error())
}
my "patch"
# client-native/cn.go:96
} else {
// if nbproc is not set, use master socket with 1 processout, myerr:=exec.Command("ls", "-la", "/data/haproxy/run/master-socket").Output()
ifmyerr!=nil {
fmt.Printf("%s", myerr)
}
fmt.Println("Command Successfully Executed")
output:=string(out[:])
fmt.Println(output)
ms:=runtime_options.MasterSocket(masterSocket, 1)
runtimeClient, err=runtime_api.New(ctx, mapsDir, ms)
iferr==nil {
returnruntimeClient
}
log.Warningf("Error setting up runtime client with master socket (1): %s : %s", masterSocket, err.Error())
}
That's the output when I run the HAProxy with the dataplane api
alex@CPC-aleks-RW2GP on 02/04/2024 at 22:49:17_UTC /mnt/c/local_data/git-repos/craftcms_k8s$ oc -n craftcms logs craftcms-hap-b87b89874-ppssv
[NOTICE] (1) : New program 'api' (8) forked
[NOTICE] (1) : New worker (9) forked
[NOTICE] (1) : Loading success.
[WARNING] (9) : fcgi-servers/craftcms1 changed its IP from (none) to 10.129.2.11 by kube-dns/dns1.
fcgi-servers/craftcms1 changed its IP from (none) to 10.129.2.11 by kube-dns/dns1.
[WARNING] (9) : Server fcgi-servers/craftcms1 ('craftcms-php.craftcms.svc.cluster.local') is UP/READY (resolves again).
Server fcgi-servers/craftcms1 ('craftcms-php.craftcms.svc.cluster.local') is UP/READY (resolves again).
[WARNING] (9) : Server fcgi-servers/craftcms1 administratively READY thanks to valid DNS answer.
Server fcgi-servers/craftcms1 administratively READY thanks to valid DNS answer.
configuration file /data/haproxy/etc/dataplaneapi.yaml does not exists, creating one
time="2024-04-02T22:49:16Z" level=info msg="Build from: "
time="2024-04-02T22:49:16Z" level=info msg="HAProxy Data Plane API .dev.dirty"
time="2024-04-02T22:49:16Z" level=info msg="Build date: 2024-04-02T22:45:03Z"
time="2024-04-02T22:49:16Z" level=info msg="Reload strategy: custom"
Command Successfully Executed
srwxr-xr-x. 1 1000940000 root 0 Apr 2 22:49 /data/haproxy/run/master-socket
time="2024-04-02T22:49:16Z" level=warning msg="Error setting up runtime client with master socket (1): /data/haproxy/run/master-socket;sockpair@7 : dial unix /data/haproxy/run/master-socket;sockpair@7: connect: no such file or directory"
[NOTICE] (1) : haproxy version is 2.9.6-9eafce5
[NOTICE] (1) : path to executable is /usr/local/sbin/haproxy
[ALERT] (1) : Current program 'api' (8) exited with code 1 (Exit)
[ALERT] (1) : exit-on-failure: killing every processes with SIGTERM
[ALERT] (1) : Current worker (9) exited with code 143 (Terminated)
[WARNING] (1) : All workers exited. Exiting... (1)
My observations
This line confuses me
time="2024-04-02T22:49:16Z" level=warning \
msg="Error setting up runtime client with master socket (1): \
/data/haproxy/run/master-socket;sockpair@7 : \
dial unix /data/haproxy/run/master-socket;sockpair@7: \
connect: no such file or directory"
because the ls before the command runtime_api.New(...) shows that the socket is there.
and I can execute the help command on the master socket
alex@CPC-aleks-RW2GP on 02/04/2024 at 23:11:02_UTC /mnt/c/local_data/git-repos/craftcms_k8s$ oc -n craftcms rsh --shell /bin/bash craftcms-hap-b87b89874-ddxs8
groups: cannot find name for group ID 1000940000
1000940000@craftcms-hap-b87b89874-ddxs8:/$ echo"help"|socat /data/haproxy/run/master-socket -
The following commands are valid at this level:
@!<pid>: send a command to the <pid> process
@<relative pid>: send a command to the <relative pid> process
@master : send a command to the master process
hard-reload : achieve a hard-reload (-st) of haproxy
operator : lower the level of the current CLI session to operator
reload : achieve a soft-reload (-sf) of haproxy
show cli level : display the level of the current CLI session
show cli sockets : dump list of cli sockets
show proc : show processes status
show startup-logs : report logs emitted during HAProxy startup
show version : show version of the current process
user : lower the level of the current CLI session to user
help [<command>] : list matching or all commands
prompt [timed] : toggle interactive mode with prompt
quit : disconnect
My assumption is that dataplaneapi tries to connect to /data/haproxy/run/master-socket;sockpair@7 which of course does not exist.
Important
When is the ;sockpair@7 added to the master-socket?
Introduction
I try to run haproxy in front of craftcms and want to use the Data Plane API for management.
Data Plane API infos
This is the dataplane api version.
Due to the fact that the trace output of the dataplaneapi binary was not very helpful have I added this lines to the code which creates the output below.
original code
dataplaneapi/client-native/cn.go
Lines 95 to 103 in 14ab8aa
my "patch"
That's the output when I run the HAProxy with the dataplane api
My observations
This line confuses me
because the
lsbefore the commandruntime_api.New(...)shows that the socket is there.and I can execute the help command on the master socket
My assumption is that dataplaneapi tries to connect to
/data/haproxy/run/master-socket;sockpair@7which of course does not exist.Important
When is the
;sockpair@7added to the master-socket?haproxy infos
haproxy run
This is how the haproxy is started.
haproxy config
Output of haproxy -vv
Dockerfile
That's the Dockerfile of the image.