Cli exited with code – How to solve this Elasticsearch error

Opster Team

Aug-23, Version: 6.8-8.9

Briefly, this error occurs when the Elasticsearch command line interface (CLI) encounters an issue and is forced to exit. The specific issue can be identified by the exit code. Common causes include configuration errors, insufficient resources, or issues with the Elasticsearch installation. To resolve this, you can check the Elasticsearch logs for more detailed error messages. You may need to adjust your configuration settings, allocate more resources (like memory or disk space), or reinstall Elasticsearch. Always ensure that your system meets the minimum requirements for running Elasticsearch.

This guide will help you check for common problems that cause the log ” cli exited with code [{}] ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: plugin.

Log Context

Log “cli exited with code [{}]” classname is EmbeddedCli.java.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :

                 * support Elasticsearch's Terminal abstraction.
                 */
                Terminal terminal = MockTerminal.create();
                int exitCode = cli.main(args.toArray(new String[0]); terminal; new ProcessInfo(Map.of(); Map.of(); createTempDir()));
                returnCode.set(exitCode);
                logger.info("cli exited with code [{}]"; exitCode);
            } catch (Exception e) {
                failure.set(e);
            }
        });
        exec.start();

 

How helpful was this guide?

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?