dataplaneapi: Error Code 400, Message Code 14 On Transaction Commit

Provided Dataplane API Example Fails

I am trying to build a transactional interface to the api… I’m in a dev mode. I am following this documentation. I’m trying to follow a portion of the example exactly, (the portion that adds a frontend).

Lack of Documentation on Code 400, Message 14

I’m seeing an error when I commit my transaction, depsite the fact that the posts to create a frontend and add a bind succeed. On the final commit I get a code 400, message 14. I am trying to figure out why

Here, in debugger, we see 4 underlined interactions with the API. The first 3 are fine: Start Transaction, Create Frontend (202), Add Bind (202), Commit Transaction (400)

image

Repeatable with Example Code Provided on DATAPLANEAPI Documentation Page

I’ve also included a snippet of code in comment below, that shows how to replicate this with the dataplaneapi documented example.

This problem seems perfectly repeatable. I’ve developed a simple script as follows:

I start by exporting trans_id (in the following start a transaction - assuming version 1) curl -X POST -H "Content-Type: application/json" --user dataplaneapi:abc123 "http://127.0.0.1:5555/v2/services/haproxy/transactions?version=1"

export trans_id=CHANGEME
export pw=CHANGEME
curl -H "Content-Type: application/json" --user dataplaneapi:$pw "http://127.0.0.1:5555/v2/services/haproxy/configuration/backends?transaction_id=$trans_id" -d '{"name": "test_backend", "mode":"http", "balance": {"algorithm":"roundrobin"}, "httpchk": {"method": "HEAD", "uri": "/", "version": "HTTP/1.1"}}' -X POST

curl -H "Content-Type: application/json" --user dataplaneapi:$pw "http://127.0.0.1:5555/v2/services/haproxy/configuration/servers?backend=test_backend&transaction_id=$trans_id" -d '{"name": "server1", "address": "127.0.0.1", "port": 8080, "check": "enabled", "maxconn": 30, "weight": 100}' -X POST

curl -H "Content-Type: application/json" --user dataplaneapi:$pw "http://127.0.0.1:5555/v2/services/haproxy/configuration/frontends?transaction_id=$trans_id" -d '{"name": "test_frontend", "mode": "http", "default_backend": "test_backend", "maxconn": 2000}' -X POST

curl -H "Content-Type: application/json" --user dataplaneapi:$pw "http://127.0.0.1:5555/v2/services/haproxy/configuration/binds?frontend=test_frontend&transaction_id=$trans_id" -d '{"name": "http", "address": "*", "port": 80}' -X POST

curl -X PUT -H "Content-Type: application/json" --user dataplaneapi:$pw "http://127.0.0.1:5555/v2/services/haproxy/transactions/$trans_id"

When I try to commit my transactions, I get the following response. {“code”:400,“message”:"14: ERR transactionId=774… "}

Despite the fact that the transactonid was valid and in progress.

I’ve been digging through the dataplaneapi codebase to try to isolate this problem: so far to no avail.

Looking online for clues

This issue seems related. It references the same kind of cryptic message “14 ERR…”. However my posts work, the only thing that doesnt work is my commit. Also I just checked my command line, and I am pointing to a proper haproxy binary.

image

DataPlaneAPI Version

I am using version 2.0.3 image

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 26 (1 by maintainers)

Most upvoted comments

@bernielomax I started a new issue for the incompatibility: #297

Hi @oktalz @mjuraga I’d very much appreciate if you could take a look at this issue. If you can provide guidance, I’d be glad to dig a bit to help isolate this.