Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect source in elasticsearch-sql-cli #47803

Closed
alpar-t opened this issue Oct 9, 2019 · 5 comments · Fixed by #52613
Closed

Incorrect source in elasticsearch-sql-cli #47803

alpar-t opened this issue Oct 9, 2019 · 5 comments · Fixed by #52613
Labels
:Analytics/SQL SQL querying :Delivery/Build Build or test infrastructure Team:Delivery Meta label for Delivery team

Comments

@alpar-t
Copy link
Contributor

alpar-t commented Oct 9, 2019

One can't start the tool from any working directory.

Here's a reproduction

# create a test cluster
./gradlew run
cd distribution/build/testclusters/runTask-0
ES_CONFIG_PATH=$PWD/config ./distro/8.0.0-DEFAULT/bin/elasticsearch-sql-cli
# Fails with : ./distro/8.0.0-DEFAULT/bin/elasticsearch-sql-cli: line 9: ./distro/8.0.0-DEFAULT/bin/x-pack-env: No such file or directory
cd distro/8.0.0-DEFAULT
ES_CONFIG_PATH=$PWD/../../config ./bin/elasticsearch-sql-cli
# works

The reason for this is that source "dirname "$0""/elasticsearch-env changes the working directory to $ES_HOME so I think the second source should just be

source ./bin/x-pack-env

Would be nice to add some packaging tests to qa/os to make sure the tool can be called from different places.

@alpar-t alpar-t added the :Analytics/SQL SQL querying label Oct 9, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search (:Search/SQL)

@q2dg
Copy link

q2dg commented Dec 28, 2019

If it's called inside "home" folder (that is, if it was installed from deb/rpm packages, when called inside "/usr/share/elasticsearch" folder), it works by just writing ./bin/elasticsearch-sql-cli

@annirathore
Copy link

I am getting below error during run ./bin/elasticsearch-sql-cli

WARNING: sun.reflect.Reflection.getCallerClass is not supported. This will impact performance.
ERROR: Cannot communicate with the server http://localhost:9200/. This version of CLI only works with Elasticsearch version v7.5.1 [3ae9ac9]

@bpintea
Copy link
Contributor

bpintea commented Jan 29, 2020

ERROR: Cannot communicate with the server http://localhost:9200/. This version of CLI only works with Elasticsearch version v7.5.1 [3ae9ac9]

@annirathore you will find usage help on the discussion forum: discuss.elastic.co.

@bpintea bpintea added the :Delivery/Build Build or test infrastructure label Jan 29, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (:Core/Infra/Build)

rjernst added a commit to rjernst/elasticsearch that referenced this issue Feb 21, 2020
The sql-cli script sources x-pack-env, but it does so assuming the
current directory is ES_HOME. This commit alters the source command to
use ES_HOME which is available after running elasticsearch-env.

closes elastic#47803
rjernst added a commit that referenced this issue Feb 24, 2020
The sql-cli script sources x-pack-env, but it does so assuming the
current directory is ES_HOME. This commit alters the source command to
use ES_HOME which is available after running elasticsearch-env.

closes #47803
rjernst added a commit that referenced this issue Feb 24, 2020
The sql-cli script sources x-pack-env, but it does so assuming the
current directory is ES_HOME. This commit alters the source command to
use ES_HOME which is available after running elasticsearch-env.

closes #47803
@mark-vieira mark-vieira added the Team:Delivery Meta label for Delivery team label Nov 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Analytics/SQL SQL querying :Delivery/Build Build or test infrastructure Team:Delivery Meta label for Delivery team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants