Hi,
I've done a bit of searching for the internal bug report but was
unable to find a record of it. However, I know from personal
experience that this issue was identified many moons ago as an
Enterprise Chef vs Open Source difference (before the erchef goodness
for search came to Open Source). Unfortunately, it seems that
information never made its way over to the breaking changes page.
I've cc'd James, who can help get that page updated.
If I recall correctly, the consensus at the time was that not
supporting newlines was the desired behavior.
Cheers,
Steven
On Tue, Jul 29, 2014 at 3:09 PM, ">
< "> > wrote:
> Thanks for the reply Steven. The search started giving a 400 Bad Request in
> Chef 11. Specifically all I was getting on the client end was this:
>
> Net::HTTPServerException
> ------------------------
> 400 "Bad Request"
>
> Digging deeper, I was able to figure out the root cause of my problem. The
> issue is that my query had newline characters in it. So for instance, the
> query
>
> search(:node, "my_attribute:test AND (roles:first_role
> OR roles:second_role
> OR roles:third_role
> OR
> roles:fourth_role)")
>
> This will work just fine with Chef 10 but will fail with Chef 11 with the
> 400 error. Removing the newlines, I was able to get it working for both
> versions.
>
> Do you think this is a bug or an expected behavior? I wasn't able to find
> any documentation surrounding this here[1].
>
> [1] https://wiki.opscode.com/display/chef/Breaking+Changes+in+Chef+11
>
>
> On Tue, Jul 29, 2014 at 6:51 AM, Steven Danna < "> > wrote:
>>
>> Hi,
>>
>> > The problem is this used to work fine with Chef 10 but has started
>> > failing with Chef 11.
>>
>> When you say that the search started to fail, do you mean that you are
>> receiving an error message or that the search no longer returns the
>> expected results?
>>
>> Sincerely,
>>
>> Steven
>>
>> On Tue, Jul 29, 2014 at 7:13 AM, ">
>> < "> > wrote:
>> > Hello,
>> >
>> > We are trying to run a little complex search query in one of our recipes
>> > which looks something like:
>> >
>> > search(:node, "my_attribute:test AND (roles:first_role OR
>> > roles:second_role
>> > OR roles:third_role OR roles:fourth_role)")
>> >
>> > The idea being to retrieve all nodes which have a particular attribute
>> > set
>> > and has one of the given roles on its runlist. Is the above query the
>> > best
>> > way to write that? The problem is this used to work fine with Chef 10
>> > but
>> > has started failing with Chef 11.
>> >
>> > Any help will be greatly appreciated.
>> >
>> > Thanks,
>> >
>> > --
>> > Swarnim
>
>
>
>
> --
> Swarnim
Archive powered by MHonArc 2.6.16.