Reputation: 61
I have a java program running on windows that:
Everything works fine on my machine but when I send it to the company's servers farm for tests, step 5 (add field) fails.
The error Solr Server returns is:
2021-12-07 19:58:00.183 ERROR (qtp966739377-20) [ x:my_core] o.a.s.s.ManagedIndexSchema Error persisting managed schema C:\views\clones\clone2\0\Qrelease\3rd\Solr\server\solr\my_core\conf\managed-schema => java.io.FileNotFoundException: C:\views\clones\clone2\0\Qrelease\3rd\Solr\server\solr\my_core\conf\managed-schema (Access is denied)
The error the client returns is:
org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteExecutionException: Error from server at http://localhost:55183/solr/find_it_core: error processing commands: {responseHeader={status=400,QTime=60},error={metadata={error-class=org.apache.solr.api.ApiBag$ExceptionWithErrObject,root-error-class=org.apache.solr.api.ApiBag$ExceptionWithErrObject},details=[Unable to persist managed schema. Error persisting managed schema C:\views\clones\clone2\0\Qrelease\3rd\Solr\server\solr\my_core\conf\managed-schema],msg=error processing commands,code=400}}
Any ideas why I'm able to make changes to the scheme on my computer but not on a remote one?
Upvotes: 3
Views: 1605
Reputation: 95
I had the same problem but fixed it. Here were the details of my problem:
I also checked what @HectorCorrea suggested, but solr is running as the solr user, who also owns the managed-schema file. BTW the field was being created before the error - I could see it in the managed-schema file and also see it when accessing the schema by the Rest API. If my solution does not help you, please try checking these.
In frustration I just restarted the solr service and tried again. Now both the PHP and the solrj implementations work. The interesting thing is that other errors that I had in the log file also disappeared when creating new cores and adding fields, which did not happen with PHP:
o.a.s.c.ConfigSetProperties Did not find ConfigSet properties, assuming default properties: => org.apache.solr.core.SolrResourceNotFoundException: Can't find resource 'configsetprops.json' in classpath or '/var/solr/data/my_core'
at org.apache.solr.core.SolrResourceLoader.openResource(SolrResourceLoader.java:402)
also
o.a.s.m.SolrMetricManager Error loading metrics reporter, plugin info: {type = reporter,name = default,class = org.apache.solr.metrics.reporters.SolrJmxReporter,attributes = {name=default, class=org.apache.solr.metrics.reporters.SolrJmxReporter},} => javax.management.RuntimeMBeanException: java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "accessClassInPackage.jdk.internal.reflect")
at java.management/com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.rethrow(DefaultMBeanServerInterceptor.java:829)
followed at last by
o.a.s.h.RequestHandlerBase org.apache.solr.api.ApiBag$ExceptionWithErrObject: error processing commands, errors: [Unable to persist managed schema. Unable to reload core [my_core]],
at org.apache.solr.handler.SchemaHandler.handleRequestBody(SchemaHandler.java:97)
To see if my experience matches with yours, you might see if you are getting similar errors in the logs.
Not clear to me why this worked, since nothing had changed in the .xml files for Solr. I will refrain from guessing about what might have caused this, but I will also mention that my solrj version is 8.11.0 on both test server and production, which does not match solr on either. Please try the restart and checking the other things that I mentioned above as well.
Upvotes: 0
Reputation: 26690
When you add a new field using Solr's HTTP API it results in the new field definition being added to the managed-schema
file.
It works on your machine because the file managed-schema
exists and you have write access to it.
The error on the server environment indicates that the file does not exist on the server, so I would first make sure that the core is created in the same was as you did in your local environment and make sure the file is indeed present.
I have also seen similar issues when the file does exist but the user that Solr runs under does not have write access to it.
Upvotes: 0