Issue
When connecting AppKit or TwigKit 4.11.0 to Fusion 5.9.15, search requests fail with a character set exception. This typically occurs after an upgrade to Fusion 5.9.x or when deploying into Kubernetes environments where response compression is enabled by default.
The following error is observed in the AppKit logs:
java.nio.charset.UnsupportedCharsetException: gzip
at org.apache.commons.io.Charsets.toCharset(Charsets.java:111)
at org.apache.solr.client.solrj.impl.HttpSolrClient.executeMethod(HttpSolrClient.java:586)
at twigkit.search.solr.SolrPlatform.search(SolrPlatform.java:141)Diagnosis
The AppKit
HttpSolrClient(based on an older version of SolrJ) sends anAccept-Encoding: gzipheader to Fusion.The Fusion
api-gatewayor the Kubernetes Ingress controller (Nginx) honors this header and compresses the response.The response is returned with a
Content-Encoding: gzipheader.The legacy SolrJ client incorrectly attempts to parse the string "gzip" as a character set (Charset) rather than a compression format, leading to the
UnsupportedCharsetException.
Environment
Fusion: 5.9.x
AppKit/TwigKit: 4.11.0
Solr: 9.x
Infrastructure: Kubernetes (AKS, EKS, GKE) with Nginx Ingress Controller
Cause
The issue is caused by a compatibility gap between older SolrJ clients used in AppKit and modern Kubernetes Ingress configurations. While the client requests compression, it lacks the logic to properly handle the resulting GZIP-encoded stream, mistakenly passing the encoding type to the character set validator.
Resolution
To resolve this, you must disable GZIP compression at the Ingress level specifically for the Fusion api-gateway service. This ensures that the response sent back to AppKit remains uncompressed.
Disable Compression via Ingress Annotation
Locate the configuration for the
api-gatewayIngress in your Fusion deployment repository (typically found inglobal-values.yamlor a specific service override file).Add the following annotation to the
api-gatewayIngress metadata:
nginx.ingress.kubernetes.io/enable-compression: "false"Apply the changes using Helm:
helm upgrade <release-name> lucidworks/fusion -f my-values.yamlVerify the change by checking the Ingress resource in Kubernetes:
kubectl get ingress <release-name>-api-gateway -o yaml
This configuration selectively disables compression for the API Gateway route while maintaining default compression settings for other Fusion services.