Closed mabilinab closed 3 months ago
Possible dupe of https://github.com/pelias/api/issues/1668
You're right. Thank you for the fast reply! The syntax should be:
"esclient": {
"apiVersion": "7.5",
"hosts": [
{
"host": "quickstart-es-http",
"port": 9200,
"protocol": "https",
"auth": "USER:PASSWORD"
}
]
},
But don't you think that this behavior is indicator of error in the code logic?
Another weird behavior
How come the pelias returning this error at the end of the message if it's not able to connect to the ES cluster.
unsupported elasticsearch version. try: >=7.4.2
You normally only get the ES API version if you can establish a connection with the cluster. Also, the error doesn't make any sense since my ES cluster is running on API version "8.15.0"
The elasticsearch client library we use is old and only supports up to v7, fortunately each version is backwards compatible one version so a v8 server will still work.
There is a ticket to upgrade the client library and (I believe) a PR but it's a fairly hairy change set so we've been holding off until it's strictly required by v9.
Nice clear bug report BTW :+1: I'll close this issue since it seems resolved, if you feel the docs can be updated then we'd be happy to accept a PR.
Describe the bug When ES cluster needs authentication credentials, Schema doesn't seem to be using the admin:password credentials of the ES cluster, despite having an "auth" section in pelias.json. Here's the error obtained when running
./bin/create_index
This means the schema pod is not sending requests to the ES cluster using auth credentials. I am using the "auth" section in the pelias.json to feed the auth credentials, but not sure if this section is taken into account by the code.
Steps to Reproduce
Install a ECK ES cluster (in k8) (it will automatically create a user 'elasticsearch' and password)
Create a pelias.json file that has the following section:
Create a schema pod mounting the pelias.json as configmap. Use a sleep command so that you can ssh into the pod and run the command manually to check the error (otherwise, you'll get crashloop)
SSH into the pod and run
./bin/create_index
. You'll get the error stated aboveAdditional context If you try to manually send a request inside the pod to the ES cluster using the credentials, it works fine, which means that the pod can contact the ES.
And if you remove the auth part from the curl, you get exactly the same error as the one returned by "./bin/create_index":
Another weird behavior How come the pelias returning this error at the end of the message if it's not able to connect to the ES cluster.
You normally only get the ES API version if you can establish a connection with the cluster. Also, the error doesn't make any sense since my ES cluster is running on API version "8.15.0"