-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Data Plane API is killed by SIGTERM in openshift #329
Comments
Hi, can you paste the output of: |
that's it $ cat /data/haproxy/etc/dataplaneapi.yaml
config_version: 2
name: craftcms-hap-debug
mode: single
status: ""
dataplaneapi:
advertised:
api_address: ""
api_port: 0
haproxy:
reload:
reload_strategy: custom |
Maybe there is another issue and the message above hides the original problem. Which, I think, is called from here. |
Hi @git001, thanks for your input, but the bug is in the dataplaneapi code, it picks up the master socket location from a env variable set by the HAProxy: https://github.com/haproxytech/dataplaneapi/blob/master/configure_data_plane.go#L121 and it doesn't properly sanitize the socket location (doesn't remove |
@mjuraga thanks for the tip. I will try to fix it with a PR |
I have now fixed the ...
// Override options with env variables
if os.Getenv("HAPROXY_MWORKER") == "1" {
mWorker = true
masterRuntime := os.Getenv("HAPROXY_MASTER_CLI")
if misc.IsUnixSocketAddr(masterRuntime) {
fmt.Printf("before Replace masterRuntime :%v:\n", masterRuntime)
if strings.HasPrefix(masterRuntime, "unix@") {
haproxyOptions.MasterRuntime = strings.Replace(masterRuntime, "unix@", "", 1)
if strings.Contains(haproxyOptions.MasterRuntime, "sockpair@") {
semikolon := strings.Index(haproxyOptions.MasterRuntime, ";")
haproxyOptions.MasterRuntime = haproxyOptions.MasterRuntime[:semikolon]
}
}
fmt.Printf("after Replace masterRuntime :%v:\n", haproxyOptions.MasterRuntime)
}
}
... From the output below is shown that the
The problem with the haproxy -f /data/haproxy/etc/haproxy.cfg -db -W -S /data/haproxy/run/master-socket
[NOTICE] (9) : New program 'api' (11) forked
[NOTICE] (9) : New worker (12) forked
[NOTICE] (9) : Loading success.
[WARNING] (12) : 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] (12) : 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] (12) : 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-03T11:26:23Z" level=info msg="HAProxy Data Plane API .dev.dirty"
time="2024-04-03T11:26:23Z" level=info msg="Reload strategy: custom"
time="2024-04-03T11:26:23Z" level=info msg="Build from: "
time="2024-04-03T11:26:23Z" level=info msg="Build date: 2024-04-03T11:23:50Z"
before Replace masterRuntime :unix@/data/haproxy/run/master-socket;sockpair@7:
after Replace masterRuntime :/data/haproxy/run/master-socket:
Command Successfully Executed
srwxr-xr-x. 1 1000950000 root 0 Apr 3 11:26 /data/haproxy/run/master-socket
ms :{/data/haproxy/run/master-socket 1}: masterSocket :/data/haproxy/run/master-socket: mapsDir :{/data/haproxy/maps}:
[NOTICE] (9) : haproxy version is 2.9.6-9eafce5
[NOTICE] (9) : path to executable is /usr/local/sbin/haproxy
[ALERT] (9) : Current program 'api' (11) exited with code 1 (Exit)
[ALERT] (9) : exit-on-failure: killing every processes with SIGTERM
[ALERT] (9) : Current worker (12) exited with code 143 (Terminated)
[WARNING] (9) : All workers exited. Exiting... (1) As mentioned in #329 (comment) could it be that the socket call in client-native be another issue? |
With commit haproxy/haproxy@8a02257 was the `sockpair@` added to the master socket. fix: haproxytech#329
For test could you try running dpapi standalone, without running from the program section. |
Any chance to merge the PR #330 ? |
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
ls
before 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@7
which of course does not exist.Important
When is the
;sockpair@7
added 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.
The text was updated successfully, but these errors were encountered: