Closed elfranne closed 7 months ago
The tool is not sending properly serialized json.
The proper curl command would look like
curl 'http://localhost:8080/pdb/query/v4/reports' \
-H 'Content-Type:application/json' \
-d '{"query":["and",["=","latest_report?","true"],["=","certname","puppet01.example.com"]]}'
and you can reproduce the error you are seeing by adding an additional layer of quotation marks in curl
curl 'http://localhost:8080/pdb/query/v4/reports' \
-H 'Content-Type:application/json' \
-d '"{\"query\":[\"and\",[\"=\",\"latest_report?\",\"true\"],[\"=\",\"certname\",\"puppet01.example.com\"]]}"'
@austb thanks !
I have been trying to query the PuppetDB with a Golang binary (Sensu monitoring) but the PuppetDB is not very happy about it and gives a error 500 back:
Puppetdb version: 7.15.0 Puppet version 7.27.0 Ubuntu 20.04 kernel 5.4.0-169
Sources of the Golang binary: https://github.com/elfranne/http-checks/tree/master/cmd/http-json https://github.com/elfranne/http-checks/releases
Command used:
output:
PuppetDB log:
Doing a curl request does not trigger this.