[
https://issues.apache.org/jira/browse/SOLR-16755?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17713783#comment-17713783
]
Chris M. Hostetter commented on SOLR-16755:
-------------------------------------------
Ah ... ok, here's the culprit...
{noformat}
- run_tool run_example -e $EXAMPLE -d "$SOLR_SERVER_DIR" -urlScheme
$SOLR_URL_SCHEME $PASS_TO_RUN_EXAMPLE
+ run_tool run_example -e "$EXAMPLE" -d "$SOLR_SERVER_DIR" -urlScheme
"$SOLR_URL_SCHEME" "$PASS_TO_RUN_EXAMPLE"
{noformat}
The quoting of {{"$PASS_TO_RUN_EXAMPLE"}} is what's screwing us. Here's what
the args look like when {{SolrCLI}} is invoked if you run
{{./solr/packaging/build/dev/bin/solr -e cloud -noprompt}} ...
{noformat}
$ cat /proc/$(pgrep -f SolrCLI)/cmdline | xargs -0 printf '%q\n'
/opt/jdk/17/latest//bin/java
'-Dsolr.install.dir=/home/hossman/lucene/solr/solr/packaging/build/dev'
'-Dlog4j.configurationFile=/home/hossman/lucene/solr/solr/packaging/build/dev/server/resources/log4j2-console.xml'
-classpath
'/home/hossman/lucene/solr/solr/packaging/build/dev/server/solr-webapp/webapp/WEB-INF/lib/*:/home/hossman/lucene/solr/solr/packaging/build/dev/server/lib/ext/*:/home/hossman/lucene/solr/solr/packaging/build/dev/server/lib/*'
org.apache.solr.util.SolrCLI
run_example
-e
cloud
-d
/home/hossman/lucene/solr/solr/packaging/build/dev/server
-urlScheme
http
' -noprompt'
{noformat}
...note the whitespace in the last line.
Or to see the problem more clearly, try to add other args that use
{{PASS_TO_RUN_EXAMPLE}} like: {{./solr/packaging/build/dev/bin/solr -e cloud
-noprompt -memory 2g}} ...
{noformat}
$ cat /proc/$(pgrep -f SolrCLI)/cmdline | xargs -0 printf '%q\n'
/opt/jdk/17/latest//bin/java
'-Dsolr.install.dir=/home/hossman/lucene/solr/solr/packaging/build/dev'
'-Dlog4j.configurationFile=/home/hossman/lucene/solr/solr/packaging/build/dev/server/resources/log4j2-console.xml'
-classpath
'/home/hossman/lucene/solr/solr/packaging/build/dev/server/solr-webapp/webapp/WEB-INF/lib/*:/home/hossman/lucene/solr/solr/packaging/build/dev/server/lib/ext/*:/home/hossman/lucene/solr/solr/packaging/build/dev/server/lib/*'
org.apache.solr.util.SolrCLI
run_example
-e
cloud
-d
/home/hossman/lucene/solr/solr/packaging/build/dev/server
-urlScheme
http
' -noprompt -m 2g'
{noformat}
----
So what' the right fix here?
* change {{PASS_TO_RUN_EXAMPLE}} to an array and fix all of it's contents to
not include any extra whitespace?
* remove the quoting when using {{"$PASS_TO_RUN_EXAMPLE"}} ?
* some other shell best practice i'm not aware of?
> bin/solr's '-noprompt' option no longer works for examples
> -----------------------------------------------------------
>
> Key: SOLR-16755
> URL: https://issues.apache.org/jira/browse/SOLR-16755
> Project: Solr
> Issue Type: Bug
> Security Level: Public(Default Security Level. Issues are Public)
> Affects Versions: 9.2
> Reporter: Chris M. Hostetter
> Priority: Major
>
> I recently noticed that on the main branch {{bin/solr -e cloud -noprompt}} no
> longer respected the {{-noprompt}} option (forcing me to hit enter a bunch of
> times to accept the defaults)
> I cheked and confirmed it also failed on {{branch_9x}} but worked on
> {{branch_9_1}}
> I couldn't think of an easy way to automate a {{git bisect run}} to look for
> this, but fortunately there weren't too many commits to manually runn {{git
> bisect}} against and find a smoking gun...
> {noformat}
> 71ad41a9a4ce6020f130fc05fcc0095e28e41d0a is the first bad commit
> commit 71ad41a9a4ce6020f130fc05fcc0095e28e41d0a
> Author: Jan Høydahl <[email protected]>
> Date: Fri Jan 6 20:06:36 2023 +0100
> SOLR-9509 Fix problems reported by shellcheck (#1225)
> :040000 040000 5765d3f70c58e94f99693313bdc8d6d86684d024
> 6b9e3dc42416216a0a1d2d0b9cb2cd736daf4de3 M solr
> {noformat}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]