camptocamp / prometheus-puppetdb-exporter

Prometheus Exporter for PuppetDB
Apache License 2.0
16 stars 13 forks source link

Failed to get nodes, invalid char ? #4

Closed trondk closed 4 years ago

trondk commented 4 years ago

[root@appdkscvm018 tmp]# ./p_x -u https://puppet:8081 --ca-file=/etc/puppetlabs/puppet/ssl/certs/ca.pem --cert-file=/etc/puppetlabs/puppet/ssl/certs/$(hostname -f).pem --key-file=/etc/puppetlabs/puppet/ssl/private_keys/$(hostname -f).pem --verbose INFO[0000] PuppetDB Metrics Exporter <<< filled in by build >>> build date: <<< filled in by build >>> sha1: <<< filled in by build >>> Go: go1.13.6 DEBU[0000] Enabling debug output INFO[0000] Providing metrics at 0.0.0.0:9121/metrics ERRO[0000] failed to get nodes: failed to get nodes: failed to unmarshal: invalid character '<' looking for beginning of value ERRO[0005] failed to get nodes: failed to get nodes: failed to unmarshal: invalid character '<' looking for beginning of value

bastelfreak commented 4 years ago

Hi, I've the same issue:

# /opt/prometheus-puppetdb-exporter-0.1.0.linux-amd64/prometheus-puppetdb-exporter --puppetdb-url http://127.0.0.1:8080 --listen-address 127.0.0.1:9635
INFO[0000] PuppetDB Metrics Exporter 0.1.0    build date: 2020-06-08    sha1: 0d446f138fdd10ea8d024219f4ea7e5ccac03542    Go: go1.12.4 
INFO[0000] Providing metrics at 127.0.0.1:9635/metrics  
ERRO[0000] failed to get nodes: failed to get nodes: failed to unmarshal: invalid character '<' looking for beginning of value 
ERRO[0005] failed to get nodes: failed to get nodes: failed to unmarshal: invalid character '<' looking for beginning of value 
^C
raphink commented 4 years ago

See my answer in https://github.com/camptocamp/prometheus-puppetdb-exporter/issues/3#issuecomment-638651328

raphink commented 4 years ago

Improved expected value by adding a default in https://github.com/camptocamp/prometheus-puppetdb-exporter/pull/6