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

cubejs-elasticsearch-driver not compatible with v7.x #3520

Open
gabri94 opened this issue Oct 7, 2021 · 12 comments
Open

cubejs-elasticsearch-driver not compatible with v7.x #3520

gabri94 opened this issue Oct 7, 2021 · 12 comments
Labels
driver:elasticsearch Issues relating to the ElasticSearch driver help wanted Community contributions are welcome.

Comments

@gabri94
Copy link

gabri94 commented Oct 7, 2021

Describe the bug
The backend package works with elasticsearch up to v6.8. With v7.x it causes the following error:

ResponseError: illegal_argument_exception
    at onBody (/cube/node_modules/@elastic/elasticsearch/lib/Transport.js:337:23)
    at IncomingMessage.onEnd (/cube/node_modules/@elastic/elasticsearch/lib/Transport.js:264:11)
    at IncomingMessage.emit (events.js:326:22)
    at endReadableNT (_stream_readable.js:1241:12)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)

I've tested this behaviour both with elastic.io and a local vanilla elasticsearch v7.15 image.
On the other hand, the library works correctly with elasticsearch v.6.8.18

To Reproduce
Steps to reproduce the behavior:

  • Deploy elasticsearch v7.15 using docker.
  • Try to connect cube.js by following the instructions on the wiki
  • Open the cube.js schema and see the error.

Expected behavior
The lib should work with the latest version of elasticsearch

@hassankhan hassankhan added driver:elasticsearch Issues relating to the ElasticSearch driver help wanted Community contributions are welcome. labels Oct 7, 2021
@github-actions
Copy link

github-actions bot commented Oct 7, 2021

If you are interested in working on this issue, please leave a comment below and we will be happy to assign the issue to you.
If this is the first time you are contributing a Pull Request to Cube.js, please check our contribution guidelines.
You can also post any questions while contributing in the #contributors channel in the Cube.js Slack.

@gabri94
Copy link
Author

gabri94 commented Oct 7, 2021

By further investigating it looks like at line 134 tries to cal getMapping on the index '.geoip_databases', which causes the exception.

https://github.com/cube-js/cube.js/blob/565465a02328875340d63046245637a3544ce2f1/packages/cubejs-elasticsearch-driver/driver/ElasticSearchDriver.js#L134

In version 6.8 this caused an error, but the || {} was sufficient to make it work. In v 7.15 this causes the illegal_argument_exception errror.

@gabri94
Copy link
Author

gabri94 commented Oct 7, 2021

I came up with this fix
gabri94@42dd257

If you think it's ok, I will open a PR

@paveltiunov
Copy link
Member

Hey @gabri94 ! PR would be very much appreciated!

@stueccles
Copy link

Any chance of getting this merged in? @gabri94 fix seems to work with Elastic Cloud which is running on 7.16

@paveltiunov
Copy link
Member

@stueccles @gabri94 We just need a PR here.

@AlbanCrepel
Copy link

Any update on the PR @gabri94 ?

@gabri94
Copy link
Author

gabri94 commented Mar 25, 2022

The fix is only partially working, so It doesn't make sense to merge it.

@nassima-creator
Copy link

issue still persist (trying with ElasticSearch 7.15)

@shivam145
Copy link

shivam145 commented Jun 23, 2022

i had made changes as present in @gabri94 's PR and also added a small tweak in one of the line as shown below and it worked for me in version 7.14.1

const props = mappings.body[index].mappings.properties || {};
@nassima-creator please can you try to connect to elastic 7.15 with the mentioned changes

paularmand added a commit to paularmand/cube.js that referenced this issue Jul 29, 2022
See cube-js#3520 for more information on these changes
paularmand added a commit to paularmand/cube.js that referenced this issue Jul 29, 2022
@madurangaRA
Copy link

any updates on this?

@tewnut
Copy link

tewnut commented Mar 7, 2023

I have similar issue on latest elasticsearch: 8.6.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
driver:elasticsearch Issues relating to the ElasticSearch driver help wanted Community contributions are welcome.
Projects
None yet
Development

No branches or pull requests

9 participants