Jira (PDB-3856) PQL specifying both type and title for class makes pql not find existing class

5 views
Skip to first unread message

David Hollinger (JIRA)

unread,
Feb 26, 2018, 4:36:04 PM2/26/18
to puppe...@googlegroups.com
David Hollinger created an issue
 
PuppetDB / Bug PDB-3856
PQL specifying both type and title for class makes pql not find existing class
Issue Type: Bug Bug
Affects Versions: PDB 5.2.0
Assignee: Unassigned
Created: 2018/02/26 1:35 PM
Priority: Normal Normal
Reporter: David Hollinger

I noticed today when attempting to do a PQL query against the PuppetDB REST API to gather a list of nodes with a specific class assigned to it, that I get an empty array in return.

When I execute:

$ curl -XGET http://localhost:8080/pdb/query/v4 --data-urlencode 'query=nodes[certname] { resources { title = "foo" } }'

I will get a list of nodes back that have ANY resources with title of "foo".

When I execute:

$ curl -XGET http://localhost:8080/pdb/query/v4 --data-urlencode 'query=resources { type = "Class" and certname = "node" }'

I'll get a list of resources of type class for that node.

But, If I try:

curl -XGET http://localhost:8080/pdb/query/v4 --data-urlencode 'query=nodes[certname] { resources { type = "Class" and title = "foo" } }'

I get an empty array back, when I should betting a list of nodes that have Class "foo" assigned to it.

This has also broken Choria's ability to execute certain playbooks as we rely on running jobs only on certain nodes containing specific classes.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.5.1#75006-sha1:7df2574)
Atlassian logo

Jeff Yarnell (JIRA)

unread,
Feb 28, 2018, 11:38:03 AM2/28/18
to puppe...@googlegroups.com

Jeff Yarnell (JIRA)

unread,
Feb 28, 2018, 5:54:03 PM2/28/18
to puppe...@googlegroups.com

Jeff Yarnell (JIRA)

unread,
Feb 28, 2018, 5:55:03 PM2/28/18
to puppe...@googlegroups.com
Jeff Yarnell updated an issue
Change By: Jeff Yarnell
Sprint: Hopper/Triage Data Platform 2018-03-28

David Hollinger (JIRA)

unread,
Mar 1, 2018, 1:29:04 PM3/1/18
to puppe...@googlegroups.com
David Hollinger commented on Bug PDB-3856
 
Re: PQL specifying both type and title for class makes pql not find existing class

For us, this ticket is a bit more high priority as I have noticed that a downgrade of PuppetDB is not possible due to the changes to how Facts are stored.

Kenn Hussey (JIRA)

unread,
Mar 6, 2018, 9:38:02 AM3/6/18
to puppe...@googlegroups.com
Kenn Hussey commented on Bug PDB-3856

Jeff Yarnell is this being fixed for PDB 5.2.1 as well (in which case that fix version should be assigned)? /cc Nirupama Mantha

This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Jeff Yarnell (JIRA)

unread,
Mar 7, 2018, 8:05:02 PM3/7/18
to puppe...@googlegroups.com

Jeff Yarnell (JIRA)

unread,
Mar 7, 2018, 8:06:03 PM3/7/18
to puppe...@googlegroups.com

Kenn Hussey (JIRA)

unread,
Mar 8, 2018, 9:57:03 AM3/8/18
to puppe...@googlegroups.com
Kenn Hussey updated an issue
 
Change By: Kenn Hussey
Fix Version/s: PDB 5.2.z
Fix Version/s: PDB 5.2.2

Jeff Yarnell (JIRA)

unread,
Mar 9, 2018, 6:24:03 PM3/9/18
to puppe...@googlegroups.com
Jeff Yarnell updated an issue
Change By: Jeff Yarnell
Sprint: Data Platform 2018- 03 04 - 28 11

Jeff Yarnell (JIRA)

unread,
Mar 14, 2018, 6:30:05 PM3/14/18
to puppe...@googlegroups.com

AJ Roetker (JIRA)

unread,
Mar 28, 2018, 5:11:03 PM3/28/18
to puppe...@googlegroups.com

Jeff Yarnell (JIRA)

unread,
Mar 28, 2018, 6:12:04 PM3/28/18
to puppe...@googlegroups.com

AJ Roetker (JIRA)

unread,
Mar 29, 2018, 5:53:04 PM3/29/18
to puppe...@googlegroups.com
AJ Roetker commented on Bug PDB-3856
 
Re: PQL specifying both type and title for class makes pql not find existing class

David Hollinger Do you have any more information regarding the specifics of what kinds of queries are failing with which resources? I've tried to reproduce this but have been unsuccessful. Is it possible for you to paste the example real inputs and outputs that are failing for you?

R.I.Pienaar (JIRA)

unread,
Mar 30, 2018, 10:42:04 AM3/30/18
to puppe...@googlegroups.com
R.I.Pienaar commented on Bug PDB-3856

PuppetDB 5.1.1:

$ rpm -q puppetdb
puppetdb-5.1.1-1.el7.noarch

$ puppet query 'nodes[certname] { resources { type = "Class" and title = "Puppetdb" } }'
[
  {
    "certname": "puppet.choria.example.net"
  }
]

Upgraded to 5.2.1 by setting puppetdb::globals::version to 5.2.1-1.el7:

$ rpm -q puppetdb
puppetdb-5.2.1-1.el7.noarch

Still works:

$ puppet query 'nodes[certname] { resources { type = "Class" and title = "Puppetdb" } }'
[
  {
    "certname": "puppet.choria.example.net"
  }
]

Note the class is capitalized, your foo is not, perhaps your real query was also not David Hollinger?

David Hollinger (JIRA)

unread,
Mar 30, 2018, 1:12:04 PM3/30/18
to puppe...@googlegroups.com

foo was not my real query, no.

It's entirely possible that it was my query, but I'll validate tonight.

R.I.Pienaar (JIRA)

unread,
Mar 30, 2018, 1:30:03 PM3/30/18
to puppe...@googlegroups.com

Kenn Hussey (JIRA)

unread,
Apr 9, 2018, 10:43:05 AM4/9/18
to puppe...@googlegroups.com

AJ Roetker (JIRA)

unread,
Apr 11, 2018, 3:16:02 PM4/11/18
to puppe...@googlegroups.com

Kenn Hussey (JIRA)

unread,
Apr 11, 2018, 3:18:02 PM4/11/18
to puppe...@googlegroups.com

Kenn Hussey (JIRA)

unread,
Apr 11, 2018, 3:19:03 PM4/11/18
to puppe...@googlegroups.com
Kenn Hussey updated an issue
Change By: Kenn Hussey
Fix Version/s: PDB 5.2.2
Fix Version/s: PDB 5.2.z

Nirupama Mantha (JIRA)

unread,
Apr 11, 2018, 5:46:04 PM4/11/18
to puppe...@googlegroups.com
Nirupama Mantha updated an issue
Change By: Nirupama Mantha
Sprint: Data Platform 2018-04-11 Hopper/Triage

Zachary Kent (Jira)

unread,
Mar 10, 2021, 3:33:04 PM3/10/21
to puppe...@googlegroups.com
Zachary Kent updated an issue
Change By: Zachary Kent
Sprint:
This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo

Zachary Kent (Jira)

unread,
Mar 10, 2021, 3:34:04 PM3/10/21
to puppe...@googlegroups.com

Morgan Rhodes (Jira)

unread,
Mar 11, 2021, 2:26:03 PM3/11/21
to puppe...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages