Jira (PDB-5466) All-numeric password in database.ini is parsed as integer, not string

0 views
Skip to first unread message

Chris Roddy (Jira)

unread,
Mar 10, 2022, 2:25:01 PM3/10/22
to puppe...@googlegroups.com
Chris Roddy updated an issue
 
PuppetDB / Bug PDB-5466
All-numeric password in database.ini is parsed as integer, not string
Change By: Chris Roddy
If database.ini contains an all-numeric password, e.g. 'password = 123456', the value is parsed as being an integer rather than a string, producing a confusing error in puppetdb.log:

{{
{} clojure.lang.ExceptionInfo: Value does not match schema: \ {:password (not (instance? java.lang.String 123456)) { }}} }

When I set password to a value containing a letter, even when that password is wrong for my installation (e.g. I am using the default certificate authentication), the service starts fine.

I discovered this on PDB 6.17.0, included with PE 2019.
9 8 .4. I am not sure what versions it affects.
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.20.2#820002-sha1:829506d)
Atlassian logo

Chris Roddy (Jira)

unread,
Mar 10, 2022, 2:25:02 PM3/10/22
to puppe...@googlegroups.com
Chris Roddy created an issue
Issue Type: Bug Bug
Assignee: Unassigned
Created: 2022/03/10 11:24 AM
Priority: Normal Normal
Reporter: Chris Roddy

If database.ini contains an all-numeric password, e.g. 'password = 123456', the value is parsed as being an integer rather than a string, producing a confusing error in puppetdb.log:

clojure.lang.ExceptionInfo: Value does not match schema: {:password (not (instance? java.lang.String 123456))}

When I set password to a value containing a letter, even when that password is wrong for my installation (e.g. I am using the default certificate authentication), the service starts fine.

I discovered this on PDB 6.17.0, included with PE 2019.9.4. I am not sure what versions it affects.

Chris Roddy (Jira)

unread,
Mar 10, 2022, 2:28:02 PM3/10/22
to puppe...@googlegroups.com
Chris Roddy updated an issue
Change By: Chris Roddy
If database.ini contains an all-numeric password, e.g. 'password = 123456', the value is parsed as being an integer rather than a string, producing the service will not start, and it produces a confusing error in puppetdb.log:


{{{}clojure.lang.ExceptionInfo: Value does not match schema: {:password (not (instance? java.lang.String 123456)){}}}}

When I set password to a value containing a letter, even when that password is wrong for my installation (e.g. I am using the default certificate authentication), the service starts fine.

I discovered this on PDB 6.17.0, included with PE 2019.8.4. I am not sure what versions it affects.

Stel Abrego (Jira)

unread,
Mar 10, 2022, 6:22:03 PM3/10/22
to puppe...@googlegroups.com
Stel Abrego commented on Bug PDB-5466
 
Re: All-numeric password in database.ini is parsed as integer, not string

Hi there Chris. Thanks for reporting this issue. We should definitely be coercing that to a string. I already have a fix put together.

Stel Abrego (Jira)

unread,
Mar 10, 2022, 6:28:01 PM3/10/22
to puppe...@googlegroups.com
Stel Abrego commented on Bug PDB-5466

If you don't mind, could you post the full error message?

Stel Abrego (Jira)

unread,
Mar 10, 2022, 6:49:01 PM3/10/22
to puppe...@googlegroups.com

David McTavish (Jira)

unread,
Mar 11, 2022, 10:31:01 AM3/11/22
to puppe...@googlegroups.com

David McTavish (Jira)

unread,
Mar 11, 2022, 10:31:02 AM3/11/22
to puppe...@googlegroups.com

Chris Roddy (Jira)

unread,
Mar 11, 2022, 11:54:03 AM3/11/22
to puppe...@googlegroups.com
Chris Roddy commented on Bug PDB-5466
 
Re: All-numeric password in database.ini is parsed as integer, not string

2022-03-10T19:15:42.482Z ERROR [p.t.internal] Error during service init!!!


clojure.lang.ExceptionInfo: Value does not match schema: {:password (not (instance? java.lang.String 123456))}

    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$warn_and_validate.invokeStatic(config.clj:50)
    at puppetlabs.puppetdb.config$warn_and_validate.invoke(config.clj:45)
    at puppetlabs.puppetdb.config$validate_and_default_incoming_config.invokeStatic(config.clj:286)
    at puppetlabs.puppetdb.config$validate_and_default_incoming_config.invoke(config.clj:283)
    at puppetlabs.puppetdb.config$fix_up_db_settings.invokeStatic(config.clj:419)
    at puppetlabs.puppetdb.config$fix_up_db_settings.invoke(config.clj:414)
    at puppetlabs.puppetdb.config$configure_dbs$fn__24178.invoke(config.clj:461)
    at clojure.core$update.invokeStatic(core.clj:6196)
    at clojure.core$update.invoke(core.clj:6188)
    at puppetlabs.puppetdb.config$configure_dbs.invokeStatic(config.clj:461)
    at puppetlabs.puppetdb.config$configure_dbs.invoke(config.clj:451)
    at puppetlabs.puppetdb.config$convert_config.invokeStatic(config.clj:514)
    at puppetlabs.puppetdb.config$convert_config.invoke(config.clj:510)
    at puppetlabs.puppetdb.config$process_config_BANG_.invokeStatic(config.clj:672)
    at puppetlabs.puppetdb.config$process_config_BANG_.invoke(config.clj:668)
    at puppetlabs.pe_puppetdb_extensions.config$process_config_for_sync.invokeStatic(config.clj:148)
    at puppetlabs.pe_puppetdb_extensions.config$process_config_for_sync.invoke(config.clj:144)
    at puppetlabs.puppetdb.config$init_config_service.invokeStatic(config.clj:705)
    at puppetlabs.puppetdb.config$init_config_service.invoke(config.clj:703)
    at puppetlabs.puppetdb.config$create_defaulted_config_service$reify_24405$service_fnk21933auto_positional$reify24414$fn_24415.invoke(config.clj:734)
    at puppetlabs.puppetdb.utils$call_unless_shutting_down.invokeStatic(utils.clj:386)
    at puppetlabs.puppetdb.utils$call_unless_shutting_down.invoke(utils.clj:383)
    at puppetlabs.puppetdb.config$create_defaulted_config_service$reify_24405$service_fnk21933auto_positional$reify_24414.init(config.clj:732)
    at puppetlabs.trapperkeeper.services$eval21731$fn_21732$G21719_21735.invoke(services.clj:9)
    at puppetlabs.trapperkeeper.services$eval21731$fn_21732$G21718_21739.invoke(services.clj:9)
    at puppetlabs.trapperkeeper.internal$eval22315$run_lifecycle_fn_BANG__22322$fn_22323.invoke(internal.clj:196)
    at puppetlabs.trapperkeeper.internal$eval22315$run_lifecycle_fn_BANG___22322.invoke(internal.clj:179)
    at puppetlabs.trapperkeeper.internal$eval22344$run_lifecycle_fns_22349$fn_22350.invoke(internal.clj:229)
    at puppetlabs.trapperkeeper.internal$eval22344$run_lifecycle_fns__22349.invoke(internal.clj:206)
    at puppetlabs.trapperkeeper.internal$eval22969$build_app_STAR__22978$fn$reify_22990.init(internal.clj:602)
    at puppetlabs.trapperkeeper.internal$eval23017$boot_services_for_app_STAR_STAR_23024$fn23025$fn_23027.invoke(internal.clj:630)
    at puppetlabs.trapperkeeper.internal$eval23017$boot_services_for_app_STAR_STAR_23024$fn_23025.invoke(internal.clj:629)
    at puppetlabs.trapperkeeper.internal$eval23017$boot_services_for_app_STAR_STAR__23024.invoke(internal.clj:623)
    at clojure.core$partial$fn__5841.invoke(core.clj:2630)
    at puppetlabs.trapperkeeper.internal$eval22389$initialize_lifecycle_worker_22400$fn22401$fn22551$state_machine14443auto__22576$fn_22579.invoke(internal.clj:249)
    at puppetlabs.trapperkeeper.internal$eval22389$initialize_lifecycle_worker_22400$fn22401$fn22551$state_machine14443auto___22576.invoke(internal.clj:249)
    at clojure.core.async.impl.ioc_macros$run_state_machine.invokeStatic(ioc_macros.clj:973)
    at clojure.core.async.impl.ioc_macros$run_state_machine.invoke(ioc_macros.clj:972)
    at clojure.core.async.impl.ioc_macros$run_state_machine_wrapped.invokeStatic(ioc_macros.clj:977)
    at clojure.core.async.impl.ioc_macros$run_state_machine_wrapped.invoke(ioc_macros.clj:975)
    at clojure.core.async$ioc_alts_BANG_$fn__14672.invoke(async.clj:384)
    at clojure.core.async$do_alts$fn_14604$fn_14607.invoke(async.clj:253)
    at clojure.core.async.impl.channels.ManyToManyChannel$fn_8330$fn_8331.invoke(channels.clj:95)
    at clojure.lang.AFn.run(AFn.java:22)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:829)
2022-03-10T19:15:42.488Z INFO  [p.t.internal] Beginning shutdown sequence
2022-03-10T19:15:42.498Z INFO  [p.p.c.services] Shutdown request received; puppetdb exiting.

David McTavish (Jira)

unread,
Mar 31, 2022, 4:32:01 PM3/31/22
to puppe...@googlegroups.com

Stel Abrego (Jira)

unread,
Apr 13, 2022, 4:38:01 PM4/13/22
to puppe...@googlegroups.com
Stel Abrego commented on Bug PDB-5466
 
Re: All-numeric password in database.ini is parsed as integer, not string

We have decided not to merge this patch into PuppetDB because there may be some cases where the string equivalent of an integer could have different literal characters. The workaround is to put double quotes around your password if it just numbers.

Reply all
Reply to author
Forward
0 new messages