Hi It seems this is still not fixed. Here is my repro:
1. Download and unpack solr-9.4.0.tgz 2. Unzip the attached logs.zip into server/solr/ to create a new core. It contains a trivial managed-schema with an uuid field: <fieldType name="uuid" class="solr.UUIDField"/> <field name="eventId" type="uuid"/> 3. Start solr with `bin/solr -f` 4. Hit it with curl: `curl -v -H 'Content-Type: application/json' --data-binary '{"id": "1", "eventId": "d8fa5301-4f7b-4c14-aa0e-b891e20f16f5"}' http://127.0.0.1:8983/solr/logs/update/json/docs?commit=true` `curl -v http://127.0.0.1:8983/solr/logs/query?q=*:*` The resulting json contains an unquoted uuid: "eventId":d8fa5301-4f7b-4c14-aa0e-b891e20f16f5 This also reproduces with solr-9.5.0-jenkins712.tgz (2023-12-20). Attached logs.zip as a gist in case the attachment doesn't work: https://gist.github.com/mbakhoff/8ea958715190b614a5a4fa438e8971e5 Regards Märt On 2023/12/02 21:39:18 Mikhail Khludnev 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 >
<<attachment: logs.zip>>