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

閲覧: 0 回
最初の未読メッセージにスキップ

R.I.Pienaar (Jira)

未読、
2021/01/22 15:56:042021/01/22
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)

未読、
2021/01/22 16:05:042021/01/22
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)

未読、
2021/01/27 14:21:042021/01/27
To: puppe...@googlegroups.com
Zachary Kent updated an issue
 
Change By: Zachary Kent
Sprint: HA 2021-02-10

Zachary Kent (Jira)

未読、
2021/01/27 14:24:032021/01/27
To: puppe...@googlegroups.com

Zachary Kent (Jira)

未読、
2021/02/10 14:28:022021/02/10
To: puppe...@googlegroups.com

Zachary Kent (Jira)

未読、
2021/02/10 14:28:032021/02/10
To: puppe...@googlegroups.com
Zachary Kent updated an issue
Change By: Zachary Kent
Sprint: HA 2020-02-24

Zachary Kent (Jira)

未読、
2021/02/24 14:22:012021/02/24
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)

未読、
2021/02/24 14:23:022021/02/24
To: puppe...@googlegroups.com

Zachary Kent (Jira)

未読、
2021/03/10 14:23:032021/03/10
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)

未読、
2021/03/10 14:30:042021/03/10
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)

未読、
2021/03/17 15:06:052021/03/17
To: puppe...@googlegroups.com

Romain Tartière

未読、
2021/03/18 14:17:052021/03/18
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)

未読、
2021/03/19 7:39:052021/03/19
To: puppe...@googlegroups.com
R.I.Pienaar commented on New Feature PDB-5002

Yes, confirm, 7.2.0 fixes this.

Eric Thompson (Jira)

未読、
2021/03/24 14:24:032021/03/24
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)

未読、
2021/03/24 14:24:032021/03/24
To: puppe...@googlegroups.com

Rob Browning (Jira)

未読、
2021/03/30 11:51:022021/03/30
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)

未読、
2021/03/30 11:52:032021/03/30
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)

未読、
2021/03/30 11:54:012021/03/30
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)

未読、
2021/03/31 12:06:062021/03/31
To: puppe...@googlegroups.com

Rob Browning (Jira)

未読、
2021/04/05 12:15:042021/04/05
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
全員に返信
投稿者に返信
転送
新着メール 0 件