Closed witchbutter closed 4 years ago
I seems to have the same problem, is it a puppetdb version issue ?
Does the PuppetDB produce any useful logs?
==> puppetdb-access.log <== 10.1.79.34 - - [04/Jun/2020:07:39:43 +0200] "GET /v4/nodes?query=%5B%22or%22%2C+%5B%22%3D%22%2C+%5B%22node%22%2C+%22active%22%5D%2C+false%5D%2C+%5B%22%3D%22%2C+%5B%22node%22%2C+%22active%22%5D%2C+true%5D%5D HTTP/1.1" 404 240 "-" "Go-http-client/1.1" 0 10.1.79.34 - - [04/Jun/2020:07:39:48 +0200] "GET /v4/nodes?query=%5B%22or%22%2C+%5B%22%3D%22%2C+%5B%22node%22%2C+%22active%22%5D%2C+false%5D%2C+%5B%22%3D%22%2C+%5B%22node%22%2C+%22active%22%5D%2C+true%5D%5D HTTP/1.1" 404 240 "-" "Go-http-client/1.1" 0
so no not really.....
Well at least we can tell it's a 404, not a 403 or 500, so that helps already.
What are you passing as the PuppetDB URL?
It needs to finish with /pdb/query
, e.g. https://puppetdb:8081/pdb/query
.
Granted, the README is not very clear on that.
I see the same error in the access log:
172.17.0.3 - - [04/Jun/2020:15:53:07 +0000] "GET /v4/nodes?query=%5B%22or%22%2C+%5B%22%3D%22%2C+%5B%22node%22%2C+%22active%22%5D%2C+false%5D%2C+%5B%22%3D%22%2C+%5B%22node%22%2C+%22active%22%5D%2C+true%5D%5D HTTP/1.1" 404 240 "-" "Go-http-client/1.1" 0
There are no entries in puppetdb.log
The suggested addition of /pdb/query
works for me.
I am actually running it in docker on the master:
docker::run{ 'puppetdb-exporter':
image => 'camptocamp/prometheus-puppetdb-exporter',
ports => [ '9121:9121' ],
volumes => [ '/etc/puppetlabs/puppetdb/ssl:/etc/puppetlabs/puppetdb/ssl' ],
memory_limit => '512m',
env => [
"PUPPETDB_URL=https://${trusted['certname']}:8081/pdb/query",
'PUPPETDB_CA_FILE=/etc/puppetlabs/puppetdb/ssl/ca.pem',
'PUPPETDB_KEY_FILE=/etc/puppetlabs/puppetdb/ssl/private.pem',
'PUPPETDB_CERT_FILE=/etc/puppetlabs/puppetdb/ssl/public.pem',
'PUPPETDB_SSL_SKIP_VERIFY=true',
'PUPPETDB_SCRAPE_INTERVAL=60s'
],
restart_service => true,
}
I see the successful accesses:
172.17.0.3 - - [04/Jun/2020:16:03:57 +0000] "GET /pdb/query/v4/reports/5eabe499266aae467c0a35b0236077a50387db4b/metrics HTTP/1.1" 200 2798 "-" "Go-http-client/1.1" 6
And curl of the endpoint now shows data.
I set this up on a running master that has at least 65 nodes reporting to it all times but all I get is this as output:
I do not really understand what this error means. The master has postgres and puppetdb running locally, but I set it up to hit the https endpoint in jetty.ini. There is nothing in the way the config is written that suggests I could use a different connection than this. I also am not clear what cert would be used other than the certs specified in jetty.ini. I think I've eliminated ssl as an issue by using
PUPPETDB_SSL_SKIP_VERIFY=true
Versions: