janhoy commented on issue #720:
URL: https://github.com/apache/solr-operator/issues/720#issuecomment-2523377989

   I tagged it as a bug, feel free to work on a Pull Request trying to fix the 
issue.
   
   I did a quick test of the first command line on a 9.7 docker:
   
   ```bash
   ZK_SECURITY_JSON=$(/opt/solr/server/scripts/cloud-scripts/zkcli.sh -zkhost 
localhost:9983 -cmd get /security.json || echo 'failed-to-get-security.json');
   ```
   
   I have an empty security.json file, so I'd expect the variable to be `{}`, 
but instead it is
   
   ```
   WARNING: The zkcli.sh script has been deprecated in favour of the bin/solr 
equivalent commands. {}
   ```
   
   When we deprecated the script in v9.7 we added an `echo` at line 3 printing 
the deprecation warning. But it prints to stdout, meaning that it will be part 
of the response always, breaking all scripts that rely on `-cmd get`. So in any 
case that script should be fixed for 9.8 @epugh by prefixing the echo line with 
`>&2`, i.e. `>&2 echo "WARNING:..."`.
   
   This will fix the case where we have a security.json file which is empty 
`{}` from next solr version. But it won't fix the case where the file does not 
exist in ZK. In that case the same script would still return the string 
"failed-to-get-security.json" which is longer than 2 chars, causing the same 
effect, i.e. not uploading security.json since we believe the existing file 
exists and is non-empty. The fix for this will be in operator to return empty 
JSON object if file not found, triggering the upload: `|| echo '{}'`.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to