We use 6.6.3 and I was trying to update my security.json (in solr home, non-zookeeper) using:
The first time this is called, the security.json is written AND reloaded in memory correctly. The output json then contains at the end:
However, subsequent calls using the same command, no matter the users specifed, always output the same meta version, 0.
The result is that the the security.json file is correctly updated, but the RuleBasedAuthorizationPlugin is never reloaded in memory, so the new settings never take effect.
The version never increases, so this condition in org.apache.solr.core.CoreContainer.initializeAuthorizationPlugin always returns and memory plugin reload is skipped:
The core of the issue is somewhere in org.apache.solr.handler.admin.SecurityConfHandler.doEdit:
In my case, getSecurityConfig(true) delegates to org.apache.solr.handler.admin.SecurityConfHandlerLocal.getSecurityConfig(boolean)
But the instance variable SecurityConfig.version is never set to anything other than -1; it is not read back from security.json in other words the data map, such that
always puts a value of 0 for the version, leading to the aforementioned memory reload skip.
There does not seem to be any code calling SecurityConfig.setVersion anywhere or any of SecurityConfig's methods updating the version variable.
The only code that does call it is in the SecurityConfHandlerZk for zookeeper, but we are not using zookeeper.
Ultimately, I can't seem to use the set-user-role command because of this. I hope this is just a duplicate. Thanks