This does sound like a bug ;-(.   

> On Mar 21, 2022, at 12:27 PM, Steffen Moldenhauer 
> <s.moldenha...@intershop.de.INVALID> wrote:
> 
> Hi,
> 
> Solr 8.11.1
> When I use the Schema API to change the schema in a config set the UPLOAD of 
> a file to this config set does not work anymore.
> It seems the Schema API changes the metadata that is stored at the config set 
> node.
> There is a '{trusted=false}' / '{trusted=true} or an empty "no utf8 Content" 
> but after the Schema API call it is  replaced by a single 0 byte. As a result 
> the following upload of a file with Configset API throws a json parse error.
> Shouldn't the node keep the no content/trusted info?
> 
> Regards
> Steffen
> 
> Steps to reproduce and full stacktrace below:
> Run solr cloud example:  solr -e cloud -p 8984
> Create Config set from _default: 
> http://localhost:8984/solr/admin/configs?action=CREATE&name=test&baseName=_default
> Create Collection with Config set 'test': 
> http://localhost:8984/solr/admin/collections?action=CREATE&name=test&collection.configName=test&numShards=1
> 
> add field with Schema API call:
> curl -X POST -H 'Content-Type: application/json' -i 
> http://localhost:8984/solr/test/schema --data '{
>  "add-field":{
>     "name":"my-field",
>     "type":"string",
>     "stored":true }
> }'
> 
> Create a file test.json and try to upload it:
> curl -X POST --header "Content-Type:application/json" --data-binary 
> @test.json 
> "http://localhost:8983/solr/admin/configs?action=UPLOAD&name=test&filePath=test.json&wt=xml&omitHeader=true";
> 
> Response:
> <?xml version="1.0" encoding="UTF-8"?>
> <response>
> 
> <lst name="error">
>  <str name="msg">JSON Parse Error: char=#0;,position=0 AFTER='#0;' 
> BEFORE=''</str>
>  <str name="trace">org.noggit.JSONParser$ParseException: JSON Parse Error: 
> char=#0;,position=0 AFTER='#0;' BEFORE=''
>        at org.noggit.JSONParser.err(JSONParser.java:452)
>        at 
> org.noggit.JSONParser.handleNonDoubleQuoteString(JSONParser.java:819)
>        at org.noggit.JSONParser.next(JSONParser.java:1026)
>        at org.noggit.JSONParser.nextEvent(JSONParser.java:1073)
>        at org.noggit.ObjectBuilder.&lt;init&gt;(ObjectBuilder.java:84)
>        at org.apache.solr.common.util.Utils.lambda$static$1(Utils.java:356)
>        at org.apache.solr.common.util.Utils.fromJSON(Utils.java:319)
>        at org.apache.solr.common.util.Utils.fromJSON(Utils.java:305)
>        at 
> org.apache.solr.handler.admin.ConfigSetsHandler.isCurrentlyTrusted(ConfigSetsHandler.java:328)
>        at 
> org.apache.solr.handler.admin.ConfigSetsHandler.ensureOverwritingUntrustedConfigSet(ConfigSetsHandler.java:308)
>        at 
> org.apache.solr.handler.admin.ConfigSetsHandler.createBaseZnode(ConfigSetsHandler.java:269)
>        at 
> org.apache.solr.handler.admin.ConfigSetsHandler.handleConfigUploadRequest(ConfigSetsHandler.java:205)
>        at 
> org.apache.solr.handler.admin.ConfigSetsHandler.handleRequestBody(ConfigSetsHandler.java:113)
>        at 
> org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:216)
>        at 
> org.apache.solr.servlet.HttpSolrCall.handleAdmin(HttpSolrCall.java:836)
>        at 
> org.apache.solr.servlet.HttpSolrCall.handleAdminRequest(HttpSolrCall.java:800)
>        at org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:545)
>        at 
> org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:427)
>        at 
> org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:357)
>        at 
> org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:201)
>        at 
> org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601)
>        at 
> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:548)
>        at 
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
>        at 
> org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:600)
>        at 
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
>        at 
> org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235)
>        at 
> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1624)
>        at 
> org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
>        at 
> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1434)
>        at 
> org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)
>        at 
> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:501)
>        at 
> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1594)
>        at 
> org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
>        at 
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1349)
>        at 
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
>        at 
> org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:191)
>        at 
> org.eclipse.jetty.server.handler.InetAccessHandler.handle(InetAccessHandler.java:177)
>        at 
> org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:146)
>        at 
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
>        at 
> org.eclipse.jetty.rewrite.handler.RewriteHandler.handle(RewriteHandler.java:322)
>        at 
> org.eclipse.jetty.server.handler.gzip.GzipHandler.handle(GzipHandler.java:763)
>        at 
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
>        at org.eclipse.jetty.server.Server.handle(Server.java:516)
>        at 
> org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:400)
>        at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:645)
>        at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:392)
>        at 
> org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277)
>        at 
> org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
>        at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
>        at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104)
>        at 
> org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338)
>        at 
> org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315)
>        at 
> org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173)
>        at 
> org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)
>        at 
> org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:409)
>        at 
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883)
>        at 
> org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034)
>        at java.lang.Thread.run(Thread.java:748)
> </str>
>  <int name="code">500</int>
> </lst>
> </response>

_______________________
Eric Pugh | Founder & CEO | OpenSource Connections, LLC | 434.466.1467 | 
http://www.opensourceconnections.com <http://www.opensourceconnections.com/> | 
My Free/Busy <http://tinyurl.com/eric-cal>  
Co-Author: Apache Solr Enterprise Search Server, 3rd Ed 
<https://www.packtpub.com/big-data-and-business-intelligence/apache-solr-enterprise-search-server-third-edition-raw>
    
This e-mail and all contents, including attachments, is considered to be 
Company Confidential unless explicitly stated otherwise, regardless of whether 
attachments are marked as such.

Reply via email to