Paul Blanchaert created SOLR-16877:
--------------------------------------

             Summary: solr backup via collections api fails with NPE when 
config contains an empty zookeeper node
                 Key: SOLR-16877
                 URL: https://issues.apache.org/jira/browse/SOLR-16877
             Project: Solr
          Issue Type: Bug
      Security Level: Public (Default Security Level. Issues are Public)
          Components: Backup/Restore
    Affects Versions: 9.2.1
            Reporter: Paul Blanchaert


The root cause for the backup to fail is an empty node in zookeeper (E.g. the 
querqy request handler in solr creates an empty .data node when starting up).

To reproduce the issue, create a new (empty) node in zk (via zkCli.sh session 
and "create" command) under a configset of your collection and back up this 
collection via the collections API with action=BACKUP command.

The reason is that the byte array provided to java.io.OutputStream.write is 
null in the case of an empty zookeeper node.

Error:
2023-07-07 12:33:52.121 DEBUG (OverseerThreadFactory-17-thread-3) 
[c:gettingstarted_20230707] o.a.s.c.b.BackupManager *Writing file 
querqy/rewriters/.data*
2023-07-07 12:33:52.123 ERROR (OverseerThreadFactory-17-thread-3) 
[c:gettingstarted_20230707] o.a.s.c.a.c.OverseerCollectionMessageHandler 
Collection: gettingstarted_20230707 operation: backup failed => 
java.lang.NullPointerException: Cannot read the array length because 
"<parameter1>" is null
at java.base/java.io.OutputStream.write(Unknown Source)
java.lang.NullPointerException: Cannot read the array length because 
"<parameter1>" is null
at java.io.OutputStream.write(Unknown Source) ~[?:?]
at 
org.apache.solr.core.backup.BackupManager.downloadConfigToRepo(BackupManager.java:349)
 ~[?:?]
at 
org.apache.solr.core.backup.BackupManager.downloadConfigDir(BackupManager.java:276)
 ~[?:?]
at org.apache.solr.cloud.api.collections.BackupCmd.call(BackupCmd.java:149) 
~[?:?]
at 
org.apache.solr.cloud.api.collections.OverseerCollectionMessageHandler.processMessage(OverseerCollectionMessageHandler.java:126)
 ~[?:?]
at 
org.apache.solr.cloud.OverseerTaskProcessor$Runner.run(OverseerTaskProcessor.java:566)
 ~[?:?]
at 
org.apache.solr.common.util.ExecutorUtil$MDCAwareThreadPoolExecutor.lambda$execute$0(ExecutorUtil.java:289)
 ~[?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) ~[?:?]
at java.lang.Thread.run(Unknown Source) [?:?]

 

Note:
 * when you create an empty file (with touch) and copy it in zookeeper (with 
"solr zk cp"), the backup doesn't raise the error (and backup succeeds).
 * when you create an empty node in zookeeper (via zkCli.sh session and 
"create" command), the backup raises the same error.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to