elasticsearch-plugin.bat script returns exit code 0 during errors in ES 5.6 #64441
Labels
>bug
:Core/Infra/Plugins
Plugin API and infrastructure
Team:Core/Infra
Meta label for core/infra team
Elasticsearch version (
bin/elasticsearch --version
): 5.6.10Plugins installed: custom/user-defined plugins
JVM version (
java -version
): 1.8.0_265OS version (
uname -a
if on a Unix-like system): Windows Server 2019Description of the problem including expected versus actual behavior:
I am installing a custom plugin for ES 5.6.10 by wrapping elasticsearch-plugin.bat command in a .NET Process object with and plugin name as arguments.
This process returns exit code 0 before the plugin installation completes which creates problems when the plugin installation fails. This could be due to the below line in elasticsearch-plugin.bat not returning %%ERRORLEVEL%% during exit.
%JAVA% %ES_JAVA_OPTS% !path_props! -cp "%ES_HOME%/lib/*;" "org.elasticsearch.plugins.PluginCli" !args!
Ideally, the plugin batch script should return a non-zero exit-code if a plugin fails installation.
Steps to reproduce:
Please include a minimal but complete recreation of the problem,
including (e.g.) index creation, mappings, settings, query etc. The easier
you make for us to reproduce it, the more likely that somebody will take the
time to look at it.
a. local plugin file name and command as argument. Sample argument string -> --install file:///c:/customplugins/mycustom-plugin1.zip
b. fileName should be path to elasticsearch-plugin.bat Sample ->c:\elasticsearch\bin\elasticsearch-plugin.bat
c. UseShellExecute = false
d. RedirectStandardError = true
e. RedirectStandardOutput = true
f. Verb = "runas"
Provide logs (if relevant):
NOTE: The exception is thrown after the "STOP' log and the exitCode returned in "0" even though an exception occurred.
The text was updated successfully, but these errors were encountered: