[PDB-2892] Nested implicit subqueries fail unless trivial Created: 2016/07/19  Updated: 2017/03/15  Resolved: 2016/07/27

Status: Closed
Project: PuppetDB
Component/s: None
Affects Version/s: None
Fix Version/s: PDB 4.2.0

Type: Bug Priority: Normal
Reporter: Lexa Whitehurst Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template:

 Description   

Basically, if you have nested subqueries, if the query for the middle one is anything other than just a wrapper around the deepest one, PDB fails saying "No implicit relationship for entity 'foo'". This seems to be true for any valid relationship. This happens when submitting both an AST query or a PQL query. Examples:

[rw@pe-mom2-test ~]$ curl -sXGET localhost:8080/pdb/query/v4 -d 'query=nodes { certname = "bar" and resources { type = "Foo" } }'
[]
 
[rw@pe-mom2-test ~]$ curl -sXGET localhost:8080/pdb/query/v4 -d 'query=facts [value] { name = "fqdn" and nodes { resources { type = "Foo" } } }'
[]
 
[rw@pe-mom2-test ~]$ curl -sXGET localhost:8080/pdb/query/v4 -d 'query=facts { name = "fqdn" and nodes { certname = "bar" and resources { type = "Foo" } } }'
No implicit relationship for entity 'resources'
 
[rw@pe-mom2-test ~]$ curl -sXGET localhost:8080/pdb/query/v4 -d 'query=["from", "facts", ["and", ["=", "name", "fqdn"], ["subquery", "nodes", ["subquery", "resources", ["=", "type", "Foo"]]]]]'
[]
 
[rw@pe-mom2-test ~]$ curl -sXGET localhost:8080/pdb/query/v4 -d 'query=["from", "facts", ["and", ["=", "name", "fqdn"], ["subquery", "nodes", ["and", ["=", "certname", "bar"], ["subquery", "resources", ["=", "type", "Foo"]]]]]]'
No implicit relationship for entity 'resources'
 
# this one is kind of weird
[rw@pe-mom2-test ~]$ curl -sXGET localhost:8080/pdb/query/v4 -d 'query=["from", "facts", ["and", ["=", "name", "fqdn"], ["subquery", "nodes", ["and", ["subquery", "facts", ["=", "name", "foo"]]]]]]'
No implicit relationship for entity 'facts'
 
[rw@pe-mom2-test ~]$ curl -sXGET localhost:8080/pdb/query/v4 -d 'query=reports { environments { resources { type = "Foo" } } }'
[]
 
[rw@pe-mom2-test ~]$ curl -sXGET localhost:8080/pdb/query/v4 -d 'query=reports { environments { name = "bar" and resources { type = "Foo" } } }'
No implicit relationship for entity 'resources'
 
[rw@pe-mom2-test ~]curl -sXGET localhost:8080/pdb/query/v4 -d 'query=facts { name = "foo" and nodes { facts { name = "bar" } } }'
[]
 
[rw@pe-mom2-test ~]$ curl -sXGET localhost:8080/pdb/query/v4 -d 'query=facts { name = "foo" and nodes { certname = "baz" and facts { name = "bar" } } }'
No implicit relationship for entity 'facts'



 Comments   
Comment by Ryan Senior [ 2016/08/08 ]

Released with 4.2.0

Generated at Wed Nov 13 16:50:56 PST 2019 using JIRA 7.7.1#77002-sha1:e75ca93d5574d9409c0630b81c894d9065296414.