Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 0.10.4, 11.0.0, 11.0.4-server
-
Fix Version/s: 11.0.6-server
-
Component/s: Chef Server, Knife
-
Labels:None
Description
If you create an attribute such as mount:/foo, you are unable to search for it with knife without the star '*' wildcard.
Repro steps:
1. Create a node attribute with the name mount, and put /foo in it
2. Try searching for the node by the attribute. I tried a few different ways, only using the '*' wildcard worked:
$ knife search node "mount:*foo"
1 items found
$ knife search node "mount:?foo"
ERROR: knife search failed: invalid search query: 'mount:?foo'
$ knife search node "mount:/foo"
ERROR: knife search failed: invalid search query: 'mount:/foo'
$ knife search node "mount:\/foo"
ERROR: knife search failed: invalid search query: 'mount:\/foo'
Related ticket: http://help.opscode.com/discussions/questions/746-how-to-search-for-mount
I've run into this issue as well. It turns out to be related to the query parsing that is done in the Chef API server prior to sending to Solr. As a result, tt effects all Chef search usage – via knife search as well as search(). Reading the Solr docs as well as the Chef docs I have come to the following conclusions:
I've successfully patched my own chef server to support '/' as a valid character. I am mulling over what is needed to submit this as a pull-request for the chef project.