Issue
This article addresses common errors encountered when importing apps into Fusion using cURL or UI-based app import methods. The solutions focus on resolving errors related to outdated configurations, schema settings, and SolrCore failures. The steps are categorised into two main scenarios.
Diagnosis
Import error due to core creation failure and configuration issues
Error:
When attempting to import an app using the following cURL command:
curl -u username:password -H "Content-Type:multipart/form-data" -X POST \
-F "importData=@C:/Users/gn2/Downloads/Filename.zip" \
-F "variableValues=@C:/Users/gn2/Downloads/secrets.json" \
https://<FusionURL>/api/objects/import?importPolicy=overwrite
The following UI error is encountered:
"importErrors" : [ "System error while creating Collection flash_cap_app_query_rewrite :
An error occurred : Underlying core creation failed while creating collection:
flash_cap_app_query_rewrite (400) Trace: null" ]
Solr Logs indicate
Caused by: org.apache.solr.common.SolrException: Plugin init failure for [schema.xml] fieldType "text_ngram": Plugin init failure for [schema.xml] analyzer/filter: Error instantiating class: 'org.apache.lucene.analysis.ngram.NGramFilterFactory
Caused by: java.lang.IllegalArgumentException: Unknown parameters: {keepShortTerm=true}
at org.apache.lucene.analysis.ngram.NGramFilterFactory.<init>(NGramFilterFactory.java:56) ~[?:?]
at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:?]
at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) ~[?:?]
at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) ~[?:?]
at java.lang.reflect.Constructor.newInstanceWithCaller(Unknown Source) ~[?:?]
at java.lang.reflect.Constructor.newInstance(Unknown Source) ~[?:?]
Cause
The issue occurs due to a deprecated parameter, "keepShortTerm=true", in the app’s schema configuration. This parameter was previously used in the NGramFilterFactory
fieldType to handle text analysis but was deprecated in Fusion 5.8.0 and later versions (based on Fusion-Solr 9.1.1).
In newer versions, Lucene introduced a fix through LUCENE-9259, where the "keepShortTerm" option in NGramFilterFactory was replaced by the more appropriate "preserveOriginal" option. As a result, using the outdated "keepShortTerm" in schema files now leads to core creation failures.
Reference:
Lucene Issue: LUCENE-9259
Resolution
1. Modify managed schema:
-
Remove keepShortTerm=true from the query_rewrite and query_rewrite_staging collections.
-
Export the app and retry the import process.
-
Even after removing keepShortTerm=true from the query_rewrite and query_rewrite_staging collections, the app import still fails try modifying Zookeeper configs.
2. Examine and modify Zookeeper configurations:
- In Fusion 5 Open a shell in a Zookeeper pod this requires instance access:
kubectl exec -it <zookeeper-pod-name> -- /bin/bash
- Connect to Zookeeper CLI:
bin/zkCli.sh
- List the configuration sets in Zookeeper:
ls /configs
- Look for the configuration set associated with the failing collection (e.g., flash_anz_app_query_rewrite).
- Inspect the configuration files within the set:
ls /configs/flash_anz_app_query_rewrite
- Retrieve and view the specific configuration file to confirm if the keepShortTerm setting is present:
get /configs/flash_anz_app_query_rewrite/solrconfig.xml
- Remove the outdated managed-schema.xml file from Zookeeper where keepShortTerm=true is present.
3. Re-import the App:
After confirming that outdated schema settings have been removed and cleaning the Zookeeper configuration, re-import the app. The import should now succeed.
By following these steps, the import errors related to outdated configurations and core creation failure should be resolved.
Comments
0 comments
Article is closed for comments.