Troubleshooting the API execution error #112
Comments
|
This means that checking the the transaction file syntax has failed. Check what you have set up for your See what's wrong with the config and try running Also try running it as the same user that is running the dataplaneapi. |
|
Thank you for the quick response. I tried to use the same failed config with haproxy binary and it ran successfully. I tried to run the dataplaneapi with trace logging but didn't get much output when the error happened. Not sure what could be the issue.. |
|
Can you paste here how you run your dataplaneapi? What CLI options do you use there? |
|
Processes I see running root 7702 1 0 Jun21 ? 00:00:00 sudo ./dataplaneapi --port 5555 -b /usr/sbin/haproxy -c /etc/haproxy/haproxy.cfg -d 5 -r systemctl restart haproxy -s systemctl restart haproxy -u datapla root 7703 7702 0 Jun21 ? 00:00:20 ./dataplaneapi --port 5555 -b /usr/sbin/haproxy -c /etc/haproxy/haproxy.cfg -d 5 -r systemctl restart haproxy -s systemctl restart haproxy -u dataplaneapi CLI I used to run the DataplaneAPI sudo ./dataplaneapi --port 5555 -b /usr/sbin/haproxy -c /etc/haproxy/haproxy.cfg -d 5 -r "systemctl restart haproxy" -s "systemctl restart haproxy" -u dataplaneapi -t /tmp/haproxy --userlist api & |
|
And when you try to execute:
What is the output? |
|
I am actually using systemd to run haproxy and the service config file is below ec2-user@ip-10-0-0-214 ~]$ cat /etc/systemd/system/haproxy.service |
|
It seems your haproxy is located at Try running dataplaneapi with |
|
Made the change root 10495 10275 0 14:57 pts/2 00:00:00 sudo ./dataplaneapi --port 5555 -b /usr/local/sbin/haproxy -c /etc/haproxy/haproxy.cfg -d 5 -r systemctl restart haproxy -s systemctl restart haproxy -u dataplaneapi -t /tmp/haproxy --userlist api root 10496 10495 0 14:57 pts/2 00:00:01 ./dataplaneapi --port 5555 -b /usr/local/sbin/haproxy -c /etc/haproxy/haproxy.cfg -d 5 -r systemctl restart haproxy -s systemctl restart haproxy -u dataplaneapi -t /tmp/haproxy --userlist api Same steps of adding a server to backend and getting the same error [ec2-user@ip-10-0-0-214 ~]$ curl -X POST --user admin:admin -H "Content-Type: application/json" http://localhost:5555/v2/services/haproxy/transactions?version=1 [ec2-user@ip-10-0-0-214 ~]$ curl -X POST --user admin:admin -H "Content-Type: application/json" -d '{"name": "server3", "address": "10.0.0.41", "port": 80, "check": "enabled", "maxconn": 30, "weight": 80}' "http://localhost:5555/v2/services/haproxy/configuration/servers?backend=app&transaction_id=f3a8b275-c435-428d-a17e-b7441d8effbb" [ec2-user@ip-10-0-0-214 ~]$ curl -X PUT --user admin:admin -H "Content-Type: application/json" "http://localhost:5555/v2/services/haproxy/transactions/f3a8b275-c435-428d-a17e-b7441d8effbb" |
|
I used 2.0.0 and it worked. 2.0.3 seems to have a bug .. even the logging doesn't work.. HAProxy Data Plane API v2.0.0 448d36e Build from: git@github.com:haproxytech/dataplaneapi.git |
|
We had the same issue. With 2.0.3 every transaction commit now fails. Rolling back to 2.0.2 solves it for us. |
|
related to #119 |
|
What is your haproxy version? It seems that older versions of haproxy report results of -c differently. Please check #119 for more details. |
|
Sorry for the delay. |
Trying to add a server to the backend, with the following steps. Not sure why the transaction fails.
Got a new Transaction
curl -X POST --user admin:admin -H "Content-Type: application/json" http://localhost:5555/v2/services/haproxy/transactions?version=1
{"_version":1,"id":"57768891-56ea-436b-b85e-f7450dd616c8","status":"in_progress"}
Adding a new backend server to the existing backend
curl -X POST --user admin:admin -H "Content-Type: application/json" -d '{"name": "server2", "address": "10.0.0.40", "port": 80, "check": "enabled", "maxconn": 30, "weight": 80}' "http://localhost:5555/v2/services/haproxy/configuration/servers?backend=app&transaction_id=57768891-56ea-436b-b85e-f7450dd616c8"
{"address":"10.0.0.40","check":"enabled","maxconn":30,"name":"server2","port":80,"proxy-v2-options":null,"weight":80}
Committing the transaction
curl -X PUT --user admin:admin -H "Content-Type: application/json" "http://localhost:5555/v2/services/haproxy/transactions/57768891-56ea-436b-b85e-f7450dd616c8"
Getting an Error
{"code":400,"message":"14:** ERR transactionId=57768891-56ea-436b-b85e-f7450dd616c8 "}
Am I missing any needed steps ? How can I troubleshoot the error
The text was updated successfully, but these errors were encountered: