Jira (PDB-5061) Empty password causes schema exception for migrator-password

31 views
Skip to first unread message

Austin Blatt (Jira)

unread,
Mar 12, 2021, 2:53:03 PM3/12/21
to puppe...@googlegroups.com
Austin Blatt created an issue
 
PuppetDB / Bug PDB-5061
Empty password causes schema exception for migrator-password
Issue Type: Bug Bug
Assignee: Unassigned
Created: 2021/03/12 11:52 AM
Priority: Normal Normal
Reporter: Austin Blatt

clojure.lang.ExceptionInfo: Value does not match schema: {:migrator-password (not (instance? java.lang.String nil))}
        at schema.core$validator$fn__6137.invoke(core.clj:155)
        at schema.core$validate.invokeStatic(core.clj:164)
        at schema.core$validate.invoke(core.clj:159)
        at puppetlabs.puppetdb.config$configure_read_db.invokeStatic(config.clj:460)
        at puppetlabs.puppetdb.config$configure_read_db.invoke(config.clj:442)
        at puppetlabs.puppetdb.config$configure_dbs.invokeStatic(config.clj:467)
        at puppetlabs.puppetdb.config$configure_dbs.invoke(config.clj:462)
        at puppetlabs.puppetdb.config$convert_config.invokeStatic(config.clj:525)
        at puppetlabs.puppetdb.config$convert_config.invoke(config.clj:521)
        at puppetlabs.puppetdb.config$process_config_BANG_.invokeStatic(config.clj:683)
        at puppetlabs.puppetdb.config$process_config_BANG_.invoke(config.clj:679)

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

Austin Blatt (Jira)

unread,
Mar 12, 2021, 3:07:02 PM3/12/21
to puppe...@googlegroups.com
Austin Blatt updated an issue
Change By: Austin Blatt
{code}

clojure.lang.ExceptionInfo: Value does not match schema: {:migrator-password (not (instance? java.lang.String nil))}
        at schema.core$validator$fn__6137.invoke(core.clj:155)
        at schema.core$validate.invokeStatic(core.clj:164)
        at schema.core$validate.invoke(core.clj:159)
        at puppetlabs.puppetdb.config$configure_read_db.invokeStatic(config.clj:460)
        at puppetlabs.puppetdb.config$configure_read_db.invoke(config.clj:442)
        at puppetlabs.puppetdb.config$configure_dbs.invokeStatic(config.clj:467)
        at puppetlabs.puppetdb.config$configure_dbs.invoke(config.clj:462)
        at puppetlabs.puppetdb.config$convert_config.invokeStatic(config.clj:525)
        at puppetlabs.puppetdb.config$convert_config.invoke(config.clj:521)
        at puppetlabs.puppetdb.config$process_config_BANG_.invokeStatic(config.clj:683)
        at puppetlabs.puppetdb.config$process_config_BANG_.invoke(config.clj:679)
{code}

This is not broken in PE because of a convoluted set of issues. Firstly, we appear to only be using our schema validation on the read-database section and not the database section. Secondly PE always writes a {{read-database.ini}} file, which prevents the read database from getting defaulted to the database section which contains {{:migrator-password nil}}

Austin Blatt (Jira)

unread,
Mar 12, 2021, 3:12:02 PM3/12/21
to puppe...@googlegroups.com


In my debugging I was using {{cond->}} to prevent the defaulting to {{nil}}
{code}
(cond-> (contains? config :password) (update :migrator-password #(or % (:password config))))
{code}

Austin Blatt (Jira)

unread,
Mar 12, 2021, 3:14:02 PM3/12/21
to puppe...@googlegroups.com
Austin Blatt updated an issue
Change By: Austin Blatt
Acceptance Criteria: - When password is unset, migrator-password is not defaulted to nil
- Schema validation happens on all database config sections, not just read-database
- Config test that password-less database configs are valid
Release Notes: Bug Fix

Austin Blatt (Jira)

unread,
Mar 12, 2021, 3:21:03 PM3/12/21
to puppe...@googlegroups.com
Austin Blatt updated an issue
{code}
clojure.lang.ExceptionInfo: Value does not match schema: {:migrator-password (not (instance? java.lang.String nil))}
        at schema.core$validator$fn__6137.invoke(core.clj:155)
        at schema.core$validate.invokeStatic(core.clj:164)
        at schema.core$validate.invoke(core.clj:159)
        at puppetlabs.puppetdb.config$configure_read_db.invokeStatic(config.clj:460)
        at puppetlabs.puppetdb.config$configure_read_db.invoke(config.clj:442)
        at puppetlabs.puppetdb.config$configure_dbs.invokeStatic(config.clj:467)
        at puppetlabs.puppetdb.config$configure_dbs.invoke(config.clj:462)
        at puppetlabs.puppetdb.config$convert_config.invokeStatic(config.clj:525)
        at puppetlabs.puppetdb.config$convert_config.invoke(config.clj:521)
        at puppetlabs.puppetdb.config$process_config_BANG_.invokeStatic(config.clj:683)
        at puppetlabs.puppetdb.config$process_config_BANG_.invoke(config.clj:679)
{code}

This is not broken in PE because of a convoluted set of issues. Firstly, we appear to only be using our schema validation on the read-database section and not the database section. Secondly PE always writes a {{read-database.ini}} file, which prevents the read database from getting defaulted to the database section which contains {{:migrator-password nil}}

In my debugging I was using {{cond->}} to prevent the defaulting to {{nil}}
{code}
( -> config
    (update :migrator-username #(or % (:user config)))
    (
cond-> (contains? config :password) (update :migrator-password #(or % (:password config)))) ))
{code}

Austin Blatt (Jira)

unread,
Mar 24, 2021, 12:38:03 PM3/24/21
to puppe...@googlegroups.com

Bogdan Irimie (Jira)

unread,
Apr 5, 2021, 11:37:03 AM4/5/21
to puppe...@googlegroups.com
Bogdan Irimie updated an issue
Change By: Bogdan Irimie
Team: HA Ghost
This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97)
Atlassian logo

Bogdan Irimie (Jira)

unread,
May 19, 2021, 3:58:01 AM5/19/21
to puppe...@googlegroups.com

Bogdan Irimie (Jira)

unread,
May 19, 2021, 3:59:04 AM5/19/21
to puppe...@googlegroups.com
Bogdan Irimie updated an issue
Change By: Bogdan Irimie
Sprint: HAHA/Grooming ghost-2.06.2021

Sebastian Miclea (Jira)

unread,
May 20, 2021, 2:53:01 AM5/20/21
to puppe...@googlegroups.com

Bogdan Irimie (Jira)

unread,
Jun 2, 2021, 3:30:02 AM6/2/21
to puppe...@googlegroups.com
Bogdan Irimie updated an issue
Change By: Bogdan Irimie
Sprint: ghost-2.06.2021 , ready for triage 3

Bogdan Irimie (Jira)

unread,
Jun 9, 2021, 7:10:03 AM6/9/21
to puppe...@googlegroups.com
Bogdan Irimie updated an issue
Change By: Bogdan Irimie
Labels: requires_haha_review tsr-pdb-backlog

Bogdan Irimie (Jira)

unread,
Jun 16, 2021, 3:17:03 AM6/16/21
to puppe...@googlegroups.com
Bogdan Irimie updated an issue
Change By: Bogdan Irimie
Sprint: ghost-2.06.2021, ghost-16.06.2021 , ready for triage 3

Bogdan Irimie (Jira)

unread,
Jun 30, 2021, 3:35:01 AM6/30/21
to puppe...@googlegroups.com
Bogdan Irimie updated an issue
Change By: Bogdan Irimie
Sprint: ghost-2.06.2021, ghost-16.06.2021, ghost-30.06.2021 , ready for triage 3

Rob Browning (Jira)

unread,
Jul 12, 2021, 7:59:02 PM7/12/21
to puppe...@googlegroups.com
Rob Browning updated an issue
Change By: Rob Browning
Fix Version/s: PDB 6.18.0
Fix Version/s: PDB 7.5.0
Reply all
Reply to author
Forward
0 new messages