Jira (PDB-5002) Array match queries stopped working in version 7

0 views
Skip to first unread message

R.I.Pienaar (Jira)

unread,
Jan 22, 2021, 3:56:04 PM1/22/21
to puppe...@googlegroups.com
R.I.Pienaar created an issue
 
PuppetDB / New Feature PDB-5002
Array match queries stopped working in version 7
Issue Type: New Feature New Feature
Assignee: Unassigned
Created: 2021/01/22 12:55 PM
Priority: Normal Normal
Reporter: R.I.Pienaar

In puppetdb-6.11.2-1.el7.noarch queries such as here will match within the fact facts.mcollective.server.collectives the value "mcollective":

nodes[certname, deactivated] {  (certname in inventory[certname] {    facts.mcollective.server.collectives.match("\d+") = "mcollective"  })}

In puppetdb 7 this match is not supported anymore and now cause exceptions like:

 

Caused by: org.postgresql.util.PSQLException: ERROR: syntax error at or near ")"
Position: 1205
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2532)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2267)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:312)
at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:448)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:369)
at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:153)
at org.postgresql.jdbc.PgPreparedStatement.executeQuery(PgPreparedStatement.java:103)
at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeQuery(ProxyPreparedStatement.java:52)
at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeQuery(HikariProxyPreparedStatement.java)
at puppetlabs.puppetdb.jdbc$call_with_array_converted_query_rows$fn__24748.invoke(jdbc.clj:320)
at clojure.java.jdbc$db_transaction_STAR_.invokeStatic(jdbc.clj:814)
at clojure.java.jdbc$db_transaction_STAR_.invoke(jdbc.clj:741)
at puppetlabs.puppetdb.jdbc$call_with_array_converted_query_rows.invokeStatic(jdbc.clj:312)
at puppetlabs.puppetdb.jdbc$call_with_array_converted_query_rows.invoke(jdbc.clj:295)
at puppetlabs.puppetdb.jdbc$call_with_array_converted_query_rows.invokeStatic(jdbc.clj:308)
at puppetlabs.puppetdb.jdbc$call_with_array_converted_query_rows.invoke(jdbc.clj:295)
at puppetlabs.puppetdb.query_eng$body_stream$fn_31251$fn31254$fn_31255.invoke(query_eng.clj:339)
at clojure.java.jdbc$db_transaction_STAR_.invokeStatic(jdbc.clj:771)
at clojure.java.jdbc$db_transaction_STAR_.invoke(jdbc.clj:741)
at puppetlabs.puppetdb.query_eng$body_stream$fn_31251$fn_31254.invoke(query_eng.clj:321)
at puppetlabs.puppetdb.query_eng$body_stream$fn__31251.invoke(query_eng.clj:318)
at puppetlabs.puppetdb.query_eng$generated_stream$fn__31225.invoke(query_eng.clj:275)
at ring.util.io$piped_input_stream$fn__190.invoke(io.clj:28)
at clojure.core$binding_conveyor_fn$fn__5754.invoke(core.clj:2030)
at clojure.lang.AFn.call(AFn.java:18)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)

 

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

R.I.Pienaar (Jira)

unread,
Jan 22, 2021, 4:05:04 PM1/22/21
to puppe...@googlegroups.com
R.I.Pienaar commented on New Feature PDB-5002
 
Re: Array match queries stopped working in version 7

The mcollective.server.collectives fact has -["mcollective", "mt_collective"] - so the .match('\d') did a search over the array for the value on the right. I can't now find docs for this feature anymore, but its something for sure we supported when PQL shipped

Zachary Kent (Jira)

unread,
Jan 27, 2021, 2:21:04 PM1/27/21
to puppe...@googlegroups.com
Zachary Kent updated an issue
 
Change By: Zachary Kent
Sprint: HA 2021-02-10

Zachary Kent (Jira)

unread,
Jan 27, 2021, 2:24:03 PM1/27/21
to puppe...@googlegroups.com

Zachary Kent (Jira)

unread,
Feb 10, 2021, 2:28:02 PM2/10/21
to puppe...@googlegroups.com

Zachary Kent (Jira)

unread,
Feb 10, 2021, 2:28:03 PM2/10/21
to puppe...@googlegroups.com
Zachary Kent updated an issue
Change By: Zachary Kent
Sprint: HA 2020-02-24

Zachary Kent (Jira)

unread,
Feb 24, 2021, 2:22:01 PM2/24/21
to puppe...@googlegroups.com
Zachary Kent updated an issue
Change By: Zachary Kent
Sprint: HA 2020-02-24 , HA 2020-03-10

Zachary Kent (Jira)

unread,
Feb 24, 2021, 2:23:02 PM2/24/21
to puppe...@googlegroups.com

Zachary Kent (Jira)

unread,
Mar 10, 2021, 2:23:03 PM3/10/21
to puppe...@googlegroups.com
Zachary Kent updated an issue
Change By: Zachary Kent
Sprint: HA 2020-02-24, HA 2020-03-10 , HA 2020-03-24

Zachary Kent (Jira)

unread,
Mar 10, 2021, 2:30:04 PM3/10/21
to puppe...@googlegroups.com
Zachary Kent updated an issue
Change By: Zachary Kent
Sprint: HA 2020-02-24, HA 2020-03-10 HAHA/Grooming , HA 2020-03- 24 10

Zachary Kent (Jira)

unread,
Mar 17, 2021, 3:06:05 PM3/17/21
to puppe...@googlegroups.com

Romain Tartière

unread,
Mar 18, 2021, 2:17:05 PM3/18/21
to puppe...@googlegroups.com
Romain Tartière commented on New Feature PDB-5002
 
Re: Array match queries stopped working in version 7

It looks like this problem is solved: running Puppet 7.5.0 and PuppetDB 7.2.0 I do not see the issue anymore:

% puppet query 'inventory[certname] { facts.mcollective.server.collectives.match("\d+") = "mcollective" }' | jq '.[] | .certname' | wc -l
45

Using choria(1) (which bundle this query in a larger one) I have consistent result:

% choria find --dm choria -F form_factor=Server | wc -l
41
{{% choria find --dm choria -F form_factor!=Server | wc -l }}
4

 

R.I.Pienaar (Jira)

unread,
Mar 19, 2021, 7:39:05 AM3/19/21
to puppe...@googlegroups.com
R.I.Pienaar commented on New Feature PDB-5002

Yes, confirm, 7.2.0 fixes this.

Eric Thompson (Jira)

unread,
Mar 24, 2021, 2:24:03 PM3/24/21
to puppe...@googlegroups.com
Eric Thompson updated an issue
 
Change By: Eric Thompson
Sprint: HA 2020-02-24, HAHA/Grooming, HA 2020-03-10 , HA 2020-04-07

Eric Thompson (Jira)

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

Rob Browning (Jira)

unread,
Mar 30, 2021, 11:51:02 AM3/30/21
to puppe...@googlegroups.com
Rob Browning commented on New Feature PDB-5002
 
Re: Array match queries stopped working in version 7

R.I.Pienaar - do you happen to know what version(s) you were running when you originally encountered the error?

 

Rob Browning (Jira)

unread,
Mar 30, 2021, 11:52:03 AM3/30/21
to puppe...@googlegroups.com
Rob Browning updated an issue
 
PuppetDB / Bug PDB-5002
Change By: Rob Browning
Issue Type: New Feature Bug

R.I.Pienaar (Jira)

unread,
Mar 30, 2021, 11:54:01 AM3/30/21
to puppe...@googlegroups.com
R.I.Pienaar commented on Bug PDB-5002
 
Re: Array match queries stopped working in version 7

Rob Browning arg, my bad I should have noted that. But was latest on the date and I know I tried it a few times since all ones in 7 prior to latest had it, sorry about the bad bug report.

Rob Browning (Jira)

unread,
Mar 31, 2021, 12:06:06 PM3/31/21
to puppe...@googlegroups.com

Rob Browning (Jira)

unread,
Apr 5, 2021, 12:15:04 PM4/5/21
to puppe...@googlegroups.com
Rob Browning commented on Bug PDB-5002
 
Re: Array match queries stopped working in version 7

No worries.  I scanned the code changes between 7.0.2 and 7.1.0 (I think the relevant range, given the dates), and didn't see anything that I'd think likely to be relevant.  I also tested 7.0.1 a bit, and didn't see any trouble.  So I think I'll close this for now, with the expectation that we'll re-open it if the problem reappears.

This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages