You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@solr.apache.org by Mikhail Khludnev <mk...@apache.org> on 2023/12/01 06:53:35 UTC

Re: Invalid JSON response with UUID field

It might have the same root cause like
https://issues.apache.org/jira/browse/SOLR-10653?filter=-3 Could you share
more details about your env setup: is it "SolrCloud"? is it /get or /select
? etc.

On Fri, Dec 1, 2023 at 12:05 AM Andrew Hankinson
<an...@rism.digital> wrote:

> Hi,
>
> I have a schema with a UUID field type configured as a unique key.
>
> <field name="id" type="uuid" indexed="true" stored="true" required="true"
> multiValued="false" />
>
> I recently upgraded my Solr installation to 9.3 (from 7.6) and my
> application stopped working. It turns out that Solr has stopped encoding
> UUIDs as strings in the JSON response writer.
>
> Whereas before I would get:
>
> "id":"76af09e3-db43-4e7e-a46f-9bf03e343db9",
>
> Now I get:
>
> "id":1b5230fb-a15d-4aea-8720-8e0a1c6e47ae,
>
> Of course, UUIDs are not a valid JSON data type, so this looks like a bug
> to me?
>
> -Andrew



-- 
Sincerely yours
Mikhail Khludnev

Re: Invalid JSON response with UUID field

Posted by Mikhail Khludnev <mk...@apache.org>.
Andrew,
Could you please check the build snapshot from
https://ci-builds.apache.org/job/Solr/job/Solr-Artifacts-9x/ to verify if
https://issues.apache.org/jira/browse/SOLR-10653 fixes the json issue as
well.
Thank you.

On Fri, Dec 1, 2023 at 12:28 PM Mikhail Khludnev <mk...@apache.org> wrote:

> Andrew, do you got the same problem if UUID is not a primary, but just a
> regular field?
>
> blind guess mode on:
> I suppose this bug resides a log ago
> https://issues.apache.org/jira/browse/SOLR-10653
> But I guess it was hidden by old text json writer, until
> https://issues.apache.org/jira/browse/SOLR-16691
> Earlier, I might recommend to bring up the old json response writer (it
> still resides in our codebase!), but it looks like we can't configure
> response writers via solrconfig anymore - there are no usages for
> SolrCore#registerResponseWriter.
> It seems due to https://issues.apache.org/jira/browse/SOLR-7073 ain't
> sure why we dropped this configurability (aha - no country for
> non-SolrCloud!).
> But perhaps you may use Config API for register old json response writer
> "solr.JSONResponseWriter" and check whether it can output uuid as a valid
> json string
> And I guess to use Config API you need to bring up SolrCloud with
> Zookeeper embedded.
> Sorry, too much hassle in this thread.
>
>
> On Fri, Dec 1, 2023 at 10:17 AM Andrew Hankinson
> <an...@rism.digital> wrote:
>
>> No SolrCloud, complete wipe and reindex of the data, select handler.
>>
>> > On 1 Dec 2023, at 07:54, Mikhail Khludnev <mk...@apache.org> wrote:
>> >
>> > It might have the same root cause like
>> > https://issues.apache.org/jira/browse/SOLR-10653?filter=-3 Could you
>> share
>> > more details about your env setup: is it "SolrCloud"? is it /get or
>> /select
>> > ? etc.
>> >
>> >> On Fri, Dec 1, 2023 at 12:05 AM Andrew Hankinson
>> >> <an...@rism.digital> wrote:
>> >>
>> >> Hi,
>> >>
>> >> I have a schema with a UUID field type configured as a unique key.
>> >>
>> >> <field name="id" type="uuid" indexed="true" stored="true"
>> required="true"
>> >> multiValued="false" />
>> >>
>> >> I recently upgraded my Solr installation to 9.3 (from 7.6) and my
>> >> application stopped working. It turns out that Solr has stopped
>> encoding
>> >> UUIDs as strings in the JSON response writer.
>> >>
>> >> Whereas before I would get:
>> >>
>> >> "id":"76af09e3-db43-4e7e-a46f-9bf03e343db9",
>> >>
>> >> Now I get:
>> >>
>> >> "id":1b5230fb-a15d-4aea-8720-8e0a1c6e47ae,
>> >>
>> >> Of course, UUIDs are not a valid JSON data type, so this looks like a
>> bug
>> >> to me?
>> >>
>> >> -Andrew
>> >
>> >
>> >
>> > --
>> > Sincerely yours
>> > Mikhail Khludnev
>>
>
>
> --
> Sincerely yours
> Mikhail Khludnev
>


-- 
Sincerely yours
Mikhail Khludnev

Re: Invalid JSON response with UUID field

Posted by Mikhail Khludnev <mk...@apache.org>.
like this
Caused by: org.noggit.JSONParser$ParseException: Expected key,value
separator ':': char=,,position=371 AFTER='title_1"],
"uuid":1f9b1f5d-a23a-4a6d-a113-4cf0f230f741,' BEFORE='
"_version_":1784207232593821696,'
at org.noggit.JSONParser.err(JSONParser.java:447)

On Sun, Dec 3, 2023 at 12:39 AM Mikhail Khludnev <mk...@apache.org> wrote:

> Right. I'm able to reproduce it on 9.4 with non-cloud json request.
> Anrew,
> It should work in forthcoming 9.5
>
> On Fri, Dec 1, 2023 at 12:28 PM Mikhail Khludnev <mk...@apache.org> wrote:
>
>> Andrew, do you got the same problem if UUID is not a primary, but just a
>> regular field?
>>
>> blind guess mode on:
>> I suppose this bug resides a log ago
>> https://issues.apache.org/jira/browse/SOLR-10653
>> But I guess it was hidden by old text json writer, until
>> https://issues.apache.org/jira/browse/SOLR-16691
>> Earlier, I might recommend to bring up the old json response writer (it
>> still resides in our codebase!), but it looks like we can't configure
>> response writers via solrconfig anymore - there are no usages for
>> SolrCore#registerResponseWriter.
>> It seems due to https://issues.apache.org/jira/browse/SOLR-7073 ain't
>> sure why we dropped this configurability (aha - no country for
>> non-SolrCloud!).
>> But perhaps you may use Config API for register old json response writer
>> "solr.JSONResponseWriter" and check whether it can output uuid as a
>> valid json string
>> And I guess to use Config API you need to bring up SolrCloud with
>> Zookeeper embedded.
>> Sorry, too much hassle in this thread.
>>
>>
>> On Fri, Dec 1, 2023 at 10:17 AM Andrew Hankinson
>> <an...@rism.digital> wrote:
>>
>>> No SolrCloud, complete wipe and reindex of the data, select handler.
>>>
>>> > On 1 Dec 2023, at 07:54, Mikhail Khludnev <mk...@apache.org> wrote:
>>> >
>>> > It might have the same root cause like
>>> > https://issues.apache.org/jira/browse/SOLR-10653?filter=-3 Could you
>>> share
>>> > more details about your env setup: is it "SolrCloud"? is it /get or
>>> /select
>>> > ? etc.
>>> >
>>> >> On Fri, Dec 1, 2023 at 12:05 AM Andrew Hankinson
>>> >> <an...@rism.digital> wrote:
>>> >>
>>> >> Hi,
>>> >>
>>> >> I have a schema with a UUID field type configured as a unique key.
>>> >>
>>> >> <field name="id" type="uuid" indexed="true" stored="true"
>>> required="true"
>>> >> multiValued="false" />
>>> >>
>>> >> I recently upgraded my Solr installation to 9.3 (from 7.6) and my
>>> >> application stopped working. It turns out that Solr has stopped
>>> encoding
>>> >> UUIDs as strings in the JSON response writer.
>>> >>
>>> >> Whereas before I would get:
>>> >>
>>> >> "id":"76af09e3-db43-4e7e-a46f-9bf03e343db9",
>>> >>
>>> >> Now I get:
>>> >>
>>> >> "id":1b5230fb-a15d-4aea-8720-8e0a1c6e47ae,
>>> >>
>>> >> Of course, UUIDs are not a valid JSON data type, so this looks like a
>>> bug
>>> >> to me?
>>> >>
>>> >> -Andrew
>>> >
>>> >
>>> >
>>> > --
>>> > Sincerely yours
>>> > Mikhail Khludnev
>>>
>>
>>
>> --
>> Sincerely yours
>> Mikhail Khludnev
>>
>
>
> --
> Sincerely yours
> Mikhail Khludnev
>


-- 
Sincerely yours
Mikhail Khludnev

Re: Invalid JSON response with UUID field

Posted by Mikhail Khludnev <mk...@apache.org>.
Right. I'm able to reproduce it on 9.4 with non-cloud json request.
Anrew,
It should work in forthcoming 9.5

On Fri, Dec 1, 2023 at 12:28 PM Mikhail Khludnev <mk...@apache.org> wrote:

> Andrew, do you got the same problem if UUID is not a primary, but just a
> regular field?
>
> blind guess mode on:
> I suppose this bug resides a log ago
> https://issues.apache.org/jira/browse/SOLR-10653
> But I guess it was hidden by old text json writer, until
> https://issues.apache.org/jira/browse/SOLR-16691
> Earlier, I might recommend to bring up the old json response writer (it
> still resides in our codebase!), but it looks like we can't configure
> response writers via solrconfig anymore - there are no usages for
> SolrCore#registerResponseWriter.
> It seems due to https://issues.apache.org/jira/browse/SOLR-7073 ain't
> sure why we dropped this configurability (aha - no country for
> non-SolrCloud!).
> But perhaps you may use Config API for register old json response writer
> "solr.JSONResponseWriter" and check whether it can output uuid as a valid
> json string
> And I guess to use Config API you need to bring up SolrCloud with
> Zookeeper embedded.
> Sorry, too much hassle in this thread.
>
>
> On Fri, Dec 1, 2023 at 10:17 AM Andrew Hankinson
> <an...@rism.digital> wrote:
>
>> No SolrCloud, complete wipe and reindex of the data, select handler.
>>
>> > On 1 Dec 2023, at 07:54, Mikhail Khludnev <mk...@apache.org> wrote:
>> >
>> > It might have the same root cause like
>> > https://issues.apache.org/jira/browse/SOLR-10653?filter=-3 Could you
>> share
>> > more details about your env setup: is it "SolrCloud"? is it /get or
>> /select
>> > ? etc.
>> >
>> >> On Fri, Dec 1, 2023 at 12:05 AM Andrew Hankinson
>> >> <an...@rism.digital> wrote:
>> >>
>> >> Hi,
>> >>
>> >> I have a schema with a UUID field type configured as a unique key.
>> >>
>> >> <field name="id" type="uuid" indexed="true" stored="true"
>> required="true"
>> >> multiValued="false" />
>> >>
>> >> I recently upgraded my Solr installation to 9.3 (from 7.6) and my
>> >> application stopped working. It turns out that Solr has stopped
>> encoding
>> >> UUIDs as strings in the JSON response writer.
>> >>
>> >> Whereas before I would get:
>> >>
>> >> "id":"76af09e3-db43-4e7e-a46f-9bf03e343db9",
>> >>
>> >> Now I get:
>> >>
>> >> "id":1b5230fb-a15d-4aea-8720-8e0a1c6e47ae,
>> >>
>> >> Of course, UUIDs are not a valid JSON data type, so this looks like a
>> bug
>> >> to me?
>> >>
>> >> -Andrew
>> >
>> >
>> >
>> > --
>> > Sincerely yours
>> > Mikhail Khludnev
>>
>
>
> --
> Sincerely yours
> Mikhail Khludnev
>


-- 
Sincerely yours
Mikhail Khludnev

Re: Invalid JSON response with UUID field

Posted by Mikhail Khludnev <mk...@apache.org>.
Andrew, do you got the same problem if UUID is not a primary, but just a
regular field?

blind guess mode on:
I suppose this bug resides a log ago
https://issues.apache.org/jira/browse/SOLR-10653
But I guess it was hidden by old text json writer, until
https://issues.apache.org/jira/browse/SOLR-16691
Earlier, I might recommend to bring up the old json response writer (it
still resides in our codebase!), but it looks like we can't configure
response writers via solrconfig anymore - there are no usages for
SolrCore#registerResponseWriter.
It seems due to https://issues.apache.org/jira/browse/SOLR-7073 ain't sure
why we dropped this configurability (aha - no country for non-SolrCloud!).
But perhaps you may use Config API for register old json response writer
"solr.JSONResponseWriter" and check whether it can output uuid as a valid
json string
And I guess to use Config API you need to bring up SolrCloud with Zookeeper
embedded.
Sorry, too much hassle in this thread.


On Fri, Dec 1, 2023 at 10:17 AM Andrew Hankinson
<an...@rism.digital> wrote:

> No SolrCloud, complete wipe and reindex of the data, select handler.
>
> > On 1 Dec 2023, at 07:54, Mikhail Khludnev <mk...@apache.org> wrote:
> >
> > It might have the same root cause like
> > https://issues.apache.org/jira/browse/SOLR-10653?filter=-3 Could you
> share
> > more details about your env setup: is it "SolrCloud"? is it /get or
> /select
> > ? etc.
> >
> >> On Fri, Dec 1, 2023 at 12:05 AM Andrew Hankinson
> >> <an...@rism.digital> wrote:
> >>
> >> Hi,
> >>
> >> I have a schema with a UUID field type configured as a unique key.
> >>
> >> <field name="id" type="uuid" indexed="true" stored="true"
> required="true"
> >> multiValued="false" />
> >>
> >> I recently upgraded my Solr installation to 9.3 (from 7.6) and my
> >> application stopped working. It turns out that Solr has stopped encoding
> >> UUIDs as strings in the JSON response writer.
> >>
> >> Whereas before I would get:
> >>
> >> "id":"76af09e3-db43-4e7e-a46f-9bf03e343db9",
> >>
> >> Now I get:
> >>
> >> "id":1b5230fb-a15d-4aea-8720-8e0a1c6e47ae,
> >>
> >> Of course, UUIDs are not a valid JSON data type, so this looks like a
> bug
> >> to me?
> >>
> >> -Andrew
> >
> >
> >
> > --
> > Sincerely yours
> > Mikhail Khludnev
>


-- 
Sincerely yours
Mikhail Khludnev

Re: Invalid JSON response with UUID field

Posted by Andrew Hankinson <an...@rism.digital>.
No SolrCloud, complete wipe and reindex of the data, select handler.

> On 1 Dec 2023, at 07:54, Mikhail Khludnev <mk...@apache.org> wrote:
> 
> It might have the same root cause like
> https://issues.apache.org/jira/browse/SOLR-10653?filter=-3 Could you share
> more details about your env setup: is it "SolrCloud"? is it /get or /select
> ? etc.
> 
>> On Fri, Dec 1, 2023 at 12:05 AM Andrew Hankinson
>> <an...@rism.digital> wrote:
>> 
>> Hi,
>> 
>> I have a schema with a UUID field type configured as a unique key.
>> 
>> <field name="id" type="uuid" indexed="true" stored="true" required="true"
>> multiValued="false" />
>> 
>> I recently upgraded my Solr installation to 9.3 (from 7.6) and my
>> application stopped working. It turns out that Solr has stopped encoding
>> UUIDs as strings in the JSON response writer.
>> 
>> Whereas before I would get:
>> 
>> "id":"76af09e3-db43-4e7e-a46f-9bf03e343db9",
>> 
>> Now I get:
>> 
>> "id":1b5230fb-a15d-4aea-8720-8e0a1c6e47ae,
>> 
>> Of course, UUIDs are not a valid JSON data type, so this looks like a bug
>> to me?
>> 
>> -Andrew
> 
> 
> 
> --
> Sincerely yours
> Mikhail Khludnev