-
-
Notifications
You must be signed in to change notification settings - Fork 281
ElasticSearch v 5 #316
Comments
Thank you for the offer! This must be a bug. I've just tested a local installation of A mistake I keep making with the elasticsearch connector is to forget to set the port number. Falcon should be smarter about this. Please, let me know if setting the port number fixes the issue for you. If it doesn't, could you provides us with a sample dataset to reproduce the issue? |
Nicolas, Thanks for the response |
I did some testing tonight and identified one of the problems. Because I have an NGINX infront of my Elastic Search cluster when I removed the port from the url in the following file: //Original
const url = `${host}:${port}/${relativeUrl}?format=json${queryStringParams}`;
//Updated
const url = `${host}/${relativeUrl}?format=json${queryStringParams}`; I am able to connect to my ElasticSearch cluster (behind NGINX) and view the list of indexes. However, now that I am able to see the indexes I am now getting a 400 error. I looked at the sample data used by Falcon (https://67a7441549120daa2dbeef8ac4f5bb2e.us-east-1.aws.found.io) and when I look at the following index (Test-Types) and type (Elastic-2.4-Types) I also get a 400 error. The error message says the following When I switch to the following index (Plotly_datasets) and type (Consumer_complaints) it seems to work fine Anyone able to reproduce the 400 error with ElasticSearch sample data? I am going to keep stepping through the code to see where the 400 error is coming from; however, any information would be greatly appreciated. |
If I were you, I'd use the command line instead to determine what the correct URL is. Falcon only uses 3 entrypoints in an elasticsearch server:
|
Yup that is exactly what I am doing. The issue that I am running into is that I am getting a response from curl and I am getting a response in the connect function (which does not seem to be a 400 error) within ElasticSearch.js; however, on the front end it is returning a 400 error. I think the error might be in the parse.js file and my next step is going to be to step through this file to see where the error is. If you have any ideas let me know; otherwise, I will keep you posted with my progress |
I have been testing the Elastic Search sample data and I have been getting some 400 errors. These errors are similar to the errors I am getting when I connect to my DB. I wanted to see if anyone else is able to produce the same errors: Sample Elastic Search DBURL: https://67a7441549120daa2dbeef8ac4f5bb2e.us-east-1.aws.found.io When I try the following indexes and types I get a 400 errorIndex: Test-Types Index: Live-Data Index: Sample-Data Index: Test-Scroll The following indexes work without any issueIndex: Plotly_datasets Is anyone else able to reproduce the same errors? Thanks |
I can't reproduce any of these errors. When you get the 400 error, could you open the dev console (View > Toggle Developer Tools) and see if there are any relevant error messages? |
I just installed a new Falcon Client (2.3.3-beta) on another laptop and I was able to successfully connect to the Sample Elastic Search client without any issues. I tested all the indexes and types and I was able to view the data. When I tried with my endpoint I was getting an error (see below). The first cause of the error is due to the port issue #317. Once this issue has been fixed it will allow me (and others) to connect to ES behind an Nginx server. On my dev laptop I had put in a fix which allowed my to connect to my Elastic Search cluster (I specified that if the port was not defined to not include this in URL). I was able to get the list of indexes and their types; however, I was still getting the weird 400 error. I was stepping through the code trying to trace through the error and I had a couple of questions for you:
//line 566 If you can shed any light on this it would be greatly appreciated. Error from Dev Console on Falcon Client: Uncaught TypeError: Cannot read property 'statusCode' of undefined
at OptionsDropdown.renderElasticsearchDocs (OptionsDropdown.react.js:113)
at OptionsDropdown.render (OptionsDropdown.react.js:139) |
@shannonlal Would you be able to check if setting the port to 80 works with your Nginx setup? |
I just checked and port 80 does not solve the problem. I am getting a 404 when I try to go to the following: https://company-nginx-server-elaticsearch-url:80/_all/_mappings?format=json I added the following into function request(relativeUrl, connection, {body, method, queryStringParams = ''}) {
const {host, port, username, password} = connection;
let url;
if( typeof port !== 'undefined' && port !== ''){
url = `${host}:${port}/${relativeUrl}?format=json${queryStringParams}`;
}else{
url = `${host}/${relativeUrl}?format=json${queryStringParams}`;
} When I leave port empty I am able to hit my Elastic Search server and get the list of indexes back. Your thoughts? I can merge this into a PR if you want |
@n-riesco. when I add the above code snippet I am able to connect to the Elastic Search server behind NGINX. I am able to see the indexes and documents. I am noticing some weird 500 and timeout errors that I am currently investigating. I am getting 400 or 500 errors even though when I look at the Debugger (through Electron) I can see that there have not been any network calls. I am looking into seeing if I can put together an updated query view so users can enter their own Elastic Search query (i.e. beyond just all index and document types). I should have something over the weekend. Let me know you if you need my help on something else |
@shannonlal Since the url is I'm trying to determine whether we can use 80 (for http) and One more, would you create a PR for this? |
No problem on PR. Just a question. Would you prefer to have a proxy flag? instead of ignoring the port? i.e. Have a proxy option (similar to SSL) on the Connection page. If this is enabled it will ignore the port. Or we can just not include port if it is not provided. Just let me know and I will put it together this weekend |
I don't have a strong opinion about this. I feel ignoring the port has more pros:
and fewer cons:
One question: would this PR fix all the issues you've seen with elastic search v5? |
This would fix one of the issues. There are two other issues I have seen with ElasticSearch:
|
@n-riesco One last note. For this ES port issue. Which branch should I merge this into ? |
This is an UI issue affecting all connectors (we have a few of those, e.g. #355). PR #343 is getting too big (I'm having second thoughts and I don't really want to touch the UI in this PR). I'm tempted to merge it as it is; or perhaps, after adding the dockerfile and the test specs for ES v6.
I think this can be done touching only the UI side. I'd rather have this implemented in a separate a PR.
Please, use master (at the moment, #343 doesn't touch |
@n-riesco I just submitted a small PR for this issue. I agree that we should keep this PR small. I have addressed the issue of it working behind NGINX. I think you are working on ElasticSearch v6. I can look at validation of the connection
Did you have some initial ideas on how you would like to fix this issue? I can take a stab at this. |
This was a misunderstanding on my side. The ES server we're using for testing works, even when the URL doesn't set the port number (i.e. the server is listening on both ports 443 and 9243). Maybe, in the future, when we deal with backwards-incompatible changes in ES v6+, we can request
|
@n-riesco I ran a couple of tests and wanted to run a couple of things by you to see if this makes sense. Our main objective inside the connect method (backend/persistent/datastores/ElasticSearch.js) is to ensure that the connection parameters work. This means inside the connect method, instead of /**
* Currently it will the get indices. Example:
* https://67a7441549120daa2dbeef8ac4f5bb2e.us-east-1.aws.found.io:9243/_cat/indicies
*/
export function connect(connection) {
console.log( 'Start Elastic Search Connect');
return request('_cat/indices/', connection, {method: 'GET'});
} We want something like /**
*https://67a7441549120daa2dbeef8ac4f5bb2e.us-east-1.aws.found.io:9243/?pretty
*/
export function connect(connection) {
console.log( 'Start Elastic Search Connect');
return request('?pretty', connection, {method: 'GET'});
} This should go off to the ES server and make sure that it is to get the "You know, For Search" tagline. This will also make sure that the port and url are configured correctly. I have tested on the plot.ly ES server and the my ES server behind an NGINX server. Is this the direction that you were thinking? If it is I could put in a small fix and test this and then send in a PR for this. Let me know your thoughts |
yes, it is (the reason also being that the entrypoint |
I recently started using Falcon SQL and we are interested in using it (with ChartBuilder) to query our ElasticSearch Cluster. We are using version 5.4 of ElasticSearch and I am running into a problem trying to connect to it with Falcon SQL Client. When I attempt to connect to the Sample ElasticSearch database (https://67a7441549120daa2dbeef8ac4f5bb2e.us-east-1.aws.found.io) I am able to connect and view the indexes; however, I am not able to with our production system. I noticed that test system (url provided above) is currently using ElasticSearch 2.4. Does anyone know if Falcon SQL Client can connect to ElasticSearch 5? As a side note we have been able to connect Grafana to our ElasticSearch cluster without any issues.
I have experience writing node code to ElasticSearch (primarily with https://www.npmjs.com/package/elasticsearch) and would be willing to create a new database connector. I have read through the steps to define a new connector in the following issue #261 and would be willing to give it try if people feel that this would be useful.
Any thoughts or comments?
Thanks
The text was updated successfully, but these errors were encountered: