When PuppetDB cannot connect to PostgreSQL, and a user queries {{/status/v1/services/puppetdb-status}} the status check throws an error instead of reporting that it cannot connect.
When PostgreSQL is running, and PuppetDB can connect, you should get a response like {code} { "service_version": "6.11.2", "service_status_version": 1, "detail_level": "info", "state": "running", "status": { "maintenance_mode?": false, "queue_depth": 0, "read_db_up?": true, "write_db_up?": true, "write_dbs_up?": true, "write_db": { "default": { "up?": true } } }, "active_alerts": [], "service_name": "puppetdb-status" } {code}
When postgresql is not running we would _expect_ {code} { "service_version": "6.11.2", "service_status_version": 1, "detail_level": "info", "state": "error", "status": { "maintenance_mode?": false, "queue_depth": 0, "read_db_up?": false, "write_db_up?": false, "write_dbs_up?": false, "write_db": { "default": { "up?": false } } }, "active_alerts": [], "service_name": "puppetdb-status" } {code}
but what is _actually_ returned is {code} { "service_version": "6.11.2", "service_status_version": 1, "detail_level": "info", "state": "unknown", "status": "Status check for puppetdb-status threw an exception: clojure.lang.ExceptionInfo: Output of status-details does not match schema: \n\n\t \u001b[0;33m {:write_db_up? (not (instance? java.lang.Boolean nil))} \u001b[0m \n\n {:type :schema.core/error, :schema {:maintenance_mode? java.lang.Boolean, :queue_depth (maybe Int), :read_db_up? java.lang.Boolean, :write_db_up? java.lang.Boolean, :write_dbs_up? java.lang.Boolean, :write_db {java.lang.String {:up? java.lang.Boolean}}}, :value {:maintenance_mode? false, :queue_depth 0, :read_db_up? false, :write_db_up? nil, :write_dbs_up? false, :write_db {\"default\" {:up? false}}}, :error {:write_db_up? (not (instance? java.lang.Boolean nil))}}", "active_alerts": [], "service_name": "puppetdb-status" } {code}
Once PuppetDB can connect to postgres again the status endpoint will return the expected response. |
|
|