Jira (PDB-4838) PuppetDB status endpoint errors when it cannot connect to postgres

9 views
Skip to first unread message

Austin Blatt (Jira)

unread,
Jul 30, 2020, 3:18:04 PM7/30/20
to puppe...@googlegroups.com
Austin Blatt created an issue
 
PuppetDB / Bug PDB-4838
PuppetDB status endpoint errors when it cannot connect to postgres
Issue Type: Bug Bug
Assignee: Unassigned
Created: 2020/07/30 12:17 PM
Priority: Normal Normal
Reporter: Austin Blatt

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

{
  "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"
}

When postgresql is not running we would expect

{
  "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"
}

but what is actually returned is

{
  "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"
}

Once PuppetDB can connect to postgres again the status endpoint will return the expected response.

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo

Austin Blatt (Jira)

unread,
Jul 30, 2020, 3:19:02 PM7/30/20
to puppe...@googlegroups.com

Austin Blatt (Jira)

unread,
Jul 30, 2020, 3:19:03 PM7/30/20
to puppe...@googlegroups.com
Austin Blatt updated an issue
Change By: Austin Blatt
Affects Version/s: PDB 6.11.2
Affects Version/s: PDB 6.11.1
Affects Version/s: PDB 6.11.0

Austin Blatt (Jira)

unread,
Jul 30, 2020, 3:20:04 PM7/30/20
to puppe...@googlegroups.com
Austin Blatt updated an issue
Change By: Austin Blatt
Release Notes: Bug Fix
Release Notes Summary: PuppetDB's status endpoint would throw an error when it could not connect to postgresql.
Team: HA
Reply all
Reply to author
Forward
0 new messages