Skip to content

Instantly share code, notes, and snippets.

(ns com.puppetlabs.puppetdb.test.http.facts
(:require [com.puppetlabs.puppetdb.scf.storage :as scf-store]
[com.puppetlabs.http :as pl-http]
[cheshire.core :as json]
[com.puppetlabs.puppetdb.test.http.facts :as facts])
(:use clojure.test
ring.mock.request
[com.puppetlabs.puppetdb.fixtures]
[com.puppetlabs.puppetdb.examples]
[clj-time.core :only [now]]
(ns giordano.pdb
(:require [clj-http.client :as client]))
(defn cm [host port]
{:host host
:port port
:cm (clj-http.conn-mgr/make-reusable-conn-manager {:timeout 2 :threads 4})})
(defn query [cm url]
(let [host (:host cm)
root@puppetdb1:~/Development/puppet# git bisect good
6ff0a10366e6ffed14ad310f16bbe9369c659e6a is the first bad commit
commit 6ff0a10366e6ffed14ad310f16bbe9369c659e6a
Author: Andrew Parker <[email protected]>
Date: Mon Nov 4 17:32:57 2013 -0800
(#23081) Ensure that errors from insync? create proper events
:040000 040000 0a96710ec5fb5240b78abc9328fb72f068fea089 3c4d4157afa8ee718d8bfacb5cd6bd28bc8f4a89 M lib
root@puppetdb1:~# puppet agent -t
Info: Retrieving plugin
Info: Loading facts in /etc/puppet/modules/stdlib/lib/facter/root_home.rb
Info: Loading facts in /etc/puppet/modules/stdlib/lib/facter/puppet_vardir.rb
Info: Loading facts in /etc/puppet/modules/stdlib/lib/facter/pe_version.rb
Info: Loading facts in /etc/puppet/modules/stdlib/lib/facter/facter_dot_d.rb
Info: Loading facts in /etc/puppet/modules/concat/lib/facter/concat_basedir.rb
Info: Loading facts in /etc/puppet/modules/firewall/lib/facter/ip6tables_version.rb
Info: Loading facts in /etc/puppet/modules/firewall/lib/facter/iptables_version.rb
Info: Loading facts in /etc/puppet/modules/firewall/lib/facter/iptables_persistent_version.rb
{
"containment-path": [
"Stage[main]",
"Puppet::Agent",
"Package[hiera]"
],
"file": "/etc/puppet/environments/production/modules/puppet/manifests/agent.pp",
"line": 25,
"message": "change from held to 1.1.2-1puppetlabs1 failed: Could not update: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold --force-yes install hiera=1.1.2-1puppetlabs1' returned 100: Reading package lists...\nBuilding dependency tree...\nReading state information...\nhiera is already the newest version.\n0 upgraded, 0 newly
installed, 0 to remove and 0 not upgraded.\n1 not fully installed or removed.\nAfter this operation, 0 B of additional disk space will be used.\nSetting up mcollective (2.4.0-1puppetlabs1) ...\nStarting daemon: mcollective\n\u001b[33mwarn\u001b[0m 2014/01/26 19:12:17: config.rb:117:in `loadconfig' Use of deprecated 'topicprefix' option. This option is ignored
2014-01-27 16:04:49,043 ERROR [puppetdb.command] [f4cd9be6-ed17-474d-b442-b7be2b7bed8e] [store report] Retrying after attempt 7, due to: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "constraint_resource_events_unique"
Detail: Key (report, resource_type, resource_title, property)=(adbd8f614ce619e3958db129e4b4ae463a9e01ef, File, /dev/shm/pg, owner) already exists.
{
"certname": "lon3-analyticscassandra-b7.lon3.spotify.net",
"configuration-version": "bf58d5c83dc0e8735527984366cc9a4aed3c4a09",
"end-time": "2014-01-21T18:01:08.629608000+00:00",
"puppet-version": "3.4.2",
"report-format": 4,
"resource-events": [
{
"containment-path": [
"Stage[main]",
2014-01-27 15:37:57,022 DEBUG [puppetdb.command] [29a8ce67-6a76-4c56-b345-12030cdc124e] [store report] Retrying after attempt 3, due to: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "reports_pkey"
Detail: Key (hash)=(ddaee81c1386e312973663c397f8f09dde16703e) already exists.
org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "reports_pkey"
Detail: Key (hash)=(ddaee81c1386e312973663c397f8f09dde16703e) already exists.
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2157)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1886)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:555)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:417)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(Abstr
# cat /etc/puppet/routes.yaml
---
master:
facts:
terminus: puppetdb
cache: yaml
root@puppetdb1:/usr/lib/ruby/vendor_ruby/puppet/indirector/facts# puppet agent -t
Info: Retrieving plugin
Info: Loading facts in /etc/puppet/modules/stdlib/lib/facter/root_home.rb
Info: Loading facts in /etc/puppet/modules/stdlib/lib/facter/puppet_vardir.rb
Info: Loading facts in /etc/puppet/modules/stdlib/lib/facter/pe_version.rb
Info: Loading facts in /etc/puppet/modules/stdlib/lib/facter/facter_dot_d.rb
Info: Loading facts in /etc/puppet/modules/concat/lib/facter/concat_basedir.rb
Info: Loading facts in /etc/puppet/modules/firewall/lib/facter/ip6tables_version.rb
Info: Loading facts in /etc/puppet/modules/firewall/lib/facter/iptables_version.rb
Info: Loading facts in /etc/puppet/modules/firewall/lib/facter/iptables_persistent_version.rb