Description
I've found an issue while using the method ZkConfigManager.copyConfigDir(String fromConfig, String toConfig) from SolrJ 7.2.1.
The error message is:
Invalid path string "/configs//configs/myconfig" caused by empty node name specified
The problem is the method with two parameters changes the fromConfig and toConfig parameters, adding "/configs/", before calling the overloading method with 3 parameters, that adds "/configs/" again in both parameters.
Guess it's a bit confusing to explain, but it's easier when looking at the code. Here's the methods implementations :
public void copyConfigDir(String fromConfig, String toConfig) throws IOException { copyConfigDir(CONFIGS_ZKNODE + "/" + fromConfig, CONFIGS_ZKNODE + "/" + toConfig, null); } public void copyConfigDir(String fromConfig, String toConfig, Set<String> copiedToZkPaths) throws IOException { copyConfigDirFromZk(CONFIGS_ZKNODE + "/" + fromConfig, CONFIGS_ZKNODE + "/" + toConfig, copiedToZkPaths); }
The solution is just remove the 'CONFIGS_ZKNODE + "/"' in the former method.
The workaround is calling directly the latter method.