[PDB-2624] query fails when colons exist in title name /resources/<TYPE>/<TITLE> Created: 2016/04/14  Updated: 2017/03/15  Resolved: 2016/04/21

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

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

Template:
Story Points: 1

 Description   

This query use to work in PuppetDB 3.x

  1. curl 'http://localhost:8080/pdb/query/v4/resources/Class/Yum::Base'; echo
    Not Found

However a title without colons works just fine

  1. curl -s 'http://localhost:8080/pdb/query/v4/resources/Class/Yum' | wc -c
    69047

As you can see passing in a query flag returns valid results

  1. curl -s -G 'http://localhost:8080/pdb/query/v4/resources/Class' --data-urlencode 'query=["=", "title", "Yum::Base"]' | wc -c
    86429


 Comments   
Comment by Dylan Cochran [ 2016/04/21 ]

This also seems to affect resource type names as well:

[root@esgpuppetca1 sites-enabled]>curl -G http://localhost:8080/pdb/query/v4/resources/Jhulib::App_server
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>
<title>Error 500 </title>
</head>
<body>
<h2>HTTP ERROR: 500</h2>
<p>Problem accessing /pdb/query/v4/resources/Jhulib::App_server. Reason:
<pre> java.net.URISyntaxException: Expected scheme name at index 0: ::App_server</pre></p>
<hr /><i><small>Powered by Jetty://</small></i>
</body>
</html>

Generated at Thu Jun 20 02:54:20 PDT 2019 using JIRA 7.7.1#77002-sha1:e75ca93d5574d9409c0630b81c894d9065296414.