Jira (PDB-4836) Return false not nil for write_db_up? status

8 views
Skip to first unread message

Rob Browning (Jira)

unread,
Jul 29, 2020, 3:51:04 PM7/29/20
to puppe...@googlegroups.com
Rob Browning created an issue
 
PuppetDB / Bug PDB-4836
Return false not nil for write_db_up? status
Issue Type: Bug Bug
Affects Versions: PDB 6.10.2
Assignee: Unassigned
Created: 2020/07/29 12:50 PM
Fix Versions: PDB 6.11.3
Priority: Normal Normal
Reporter: Rob Browning
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo

Rob Browning (Jira)

unread,
Jul 29, 2020, 3:52:04 PM7/29/20
to puppe...@googlegroups.com
Rob Browning assigned an issue to Rob Browning
Change By: Rob Browning
Assignee: Rob Browning

Austin Blatt (Jira)

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

Austin Blatt (Jira)

unread,
Jul 30, 2020, 3:25:03 PM7/30/20
to puppe...@googlegroups.com
Austin Blatt updated an issue
Change By: Austin Blatt
Release Notes Summary: Previously (since 6. 10 11 . 2 0 ) the status endpoint might return `null` value when it should have returned `false` for `write_db_up?`.

Austin Blatt (Jira)

unread,
Jul 30, 2020, 3:30:04 PM7/30/20
to puppe...@googlegroups.com
Austin Blatt updated an issue
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.
Reply all
Reply to author
Forward
0 new messages