This is an automated email from the ASF dual-hosted git repository.

dsmiley pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/solr.git


The following commit(s) were added to refs/heads/main by this push:
     new 2f2b21be654 SOLR-18520: Package Uninstall should work in absence of 
clusterprops.json (#5052)
2f2b21be654 is described below

commit 2f2b21be654f10534f1e1f995acd104470dba677
Author: Jalaz Kumar <[email protected]>
AuthorDate: Thu Oct 8 21:01:13 2026 +0530

    SOLR-18520: Package Uninstall should work in absence of clusterprops.json 
(#5052)
---
 changelog/unreleased/SOLR-18520-uninstall-bug.yml           |  9 +++++++++
 .../java/org/apache/solr/packagemanager/PackageManager.java | 13 +++++++------
 2 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/changelog/unreleased/SOLR-18520-uninstall-bug.yml 
b/changelog/unreleased/SOLR-18520-uninstall-bug.yml
new file mode 100644
index 00000000000..6e66dcb25cb
--- /dev/null
+++ b/changelog/unreleased/SOLR-18520-uninstall-bug.yml
@@ -0,0 +1,9 @@
+title:
+  Package Uninstall should work in absence of clusterprops.json file
+type: fixed
+authors:
+  - name: Jalaz Kumar
+    nick: jaykay12
+links:
+  - name: SOLR-18520
+    url: https://issues.apache.org/jira/browse/SOLR-18520
diff --git 
a/solr/core/src/java/org/apache/solr/packagemanager/PackageManager.java 
b/solr/core/src/java/org/apache/solr/packagemanager/PackageManager.java
index b8c38274f8d..e344f8ec35d 100644
--- a/solr/core/src/java/org/apache/solr/packagemanager/PackageManager.java
+++ b/solr/core/src/java/org/apache/solr/packagemanager/PackageManager.java
@@ -42,6 +42,7 @@ import org.apache.solr.cli.CLIUtils;
 import org.apache.solr.cli.SolrCLI;
 import org.apache.solr.cli.ToolRuntime;
 import org.apache.solr.client.api.util.SolrVersion;
+import org.apache.solr.client.solrj.RemoteSolrException;
 import org.apache.solr.client.solrj.SolrClient;
 import org.apache.solr.client.solrj.SolrRequest;
 import org.apache.solr.client.solrj.SolrServerException;
@@ -154,7 +155,7 @@ public class PackageManager implements Closeable {
     del.pkg = packageName;
 
     V2Request req =
-        new V2Request.Builder(PackageUtils.PACKAGE_PATH)
+        new V2Request.Builder("/cluster/package")
             .forceV2(true)
             .withMethod(SolrRequest.METHOD.POST)
             .withPayload(Map.of("delete", del))
@@ -278,18 +279,18 @@ public class PackageManager implements Closeable {
     Map<String, String> packageVersions = new HashMap<>();
     // map of package name to multiple values of pluginMeta(Map<String, 
String>)
     Map<String, Set<PluginMeta>> packagePlugins = new HashMap<>();
-    Object pluginsValue;
+    Object pluginsValue = null;
     try {
       NamedList<Object> response =
           solrClient.request(
               new GenericV2SolrRequest(SolrRequest.METHOD.GET, 
PackageUtils.CLUSTERPROPS_PATH));
       Integer statusCode = (Integer) response._get(List.of("responseHeader", 
"status"), null);
-      if (statusCode == null || statusCode == ErrorCode.NOT_FOUND.code) {
-        // Cluster props doesn't exist, that means there are no cluster level 
plugins installed.
-        pluginsValue = null;
-      } else {
+      if (statusCode != null && statusCode != ErrorCode.NOT_FOUND.code) {
+        // Cluster props exists, that means there are cluster level plugins 
installed.
         pluginsValue = response.get(ContainerPluginsApi.PLUGIN);
       }
+    } catch (RemoteSolrException ex) {
+      log.debug("Unable to fetch clusterprops for package plugins", ex);
     } catch (SolrServerException | IOException ex) {
       throw new SolrException(ErrorCode.SERVER_ERROR, ex);
     }

Reply via email to