opendistro-for-elasticsearch / sql

🔍 Open Distro SQL Plugin
https://opendistro.github.io/for-elasticsearch/features/SQL%20Support.html
Apache License 2.0
622 stars 186 forks source link

ODBC Driver 1.13.0.0 Doesn't work with SQL Plugin version < 1.13.0.0 #1078

Closed penghuo closed 3 years ago

penghuo commented 3 years ago

Issue

When testing with PowerBI, test connection failed with the following error message.

es_communi[ESCommunication::LogMsg]793: 
es_communi[ESCommunication::LogMsg]793: The SQL plugin must be installed in order to use this driver. Response body: '[{"name":"e2a893819b3df1d9b9f449026af9f4e7","component":"aes_cross_cluster","version":"7.9.1"},{"name":"e2a893819b3df1d9b9f449026af9f4e7","component":"alerting","version":"x.x.x.x"},{"name":"e2a893819b3df1d9b9f449026af9f4e7","component":"analysis-icu","version":"7.9.1"},{"name":"e2a893819b3df1d9b9f449026af9f4e7","component":"analysis-ik","version":"7.9.1"},{"name":"e2a893819b3df1d9b9f449026af9f4e7","component":"analysis-kuromoji","version":"7.9.1"},{"name":"e2a893819b3df1d9b9f449026af9f4e7","component":"analysis-phonetic","version":"7.9.1"},{"name":"e2a893819b3df1d9b9f449026af9f4e7","component":"analysis-seunjeon","version":"x.x.x.x"},{"name":"e2a893819b3df1d9b9f449026af9f4e7","component":"analysis-smartcn","version":"7.9.1"},{"name":"e2a893819b3df1d9b9f449026af9f4e7","component":"analysis-stempel","version":"7.9.1"},{"name":"e2a893819b3df1d9b9f449026af9f4e7","component":"analysis-thaichub2","version":"7.9.1"},{"name":"e2a893819b3df1d9b9f449026af9f4e7","component":"analysis-ukrainian","version":"7.9.1"},{"name":"e2a893819b3df1d9b9f449026af9f4e7","component":"discovery-ec2","version":"7.9.1"},{"name":"e2a893819b3df1d9b9f449026af9f4e7","component":"elasticsearch-aes-iam","version":"1.0.0"},{"name":"e2a893819b3df1d9b9f449026af9f4e7","component":"elasticsearch-aes-remote-reindex","version":"1.0.0"},{"name":"e2a893819b3df1d9b9f449026af9f4e7","component":"elasticsearch-analysis-vietnamese","version":"7.9.1"},{"name":"e2a893819b3df1d9b9f449026af9f4e7","component":"elasticsearch-jetty","version":"2.2.0"},{"name":"e2a893819b3df1d9b9f449026af9f4e7","component":"ingest-attachment","version":"7.9.1"},{"name":"e2a893819b3df1d9b9f449026af9f4e7","component":"kraken","version":"unspecified"},{"name":"e2a893819b3df1d9b9f449026af9f4e7","component":"ltr","version":"1.5.1-es7.9.1"},{"name":"e2a893819b3df1d9b9f449026af9f4e7","component":"mapper-murmur3","version":"7.9.1"},{"name":"e2a893819b3df1d9b9f449026af9f4e7","component":"mapper-size","version":"7.9.1"},{"name":"e2a893819b3df1d9b9f449026af9f4e7","component":"opendistro-anomaly-detection","version":"x.x.x.x"},{"name":"e2a893819b3df1d9b9f449026af9f4e7","component":"opendistro-job-scheduler","version":"x.x.x.x"},{"name":"e2a893819b3df1d9b9f449026af9f4e7","component":"opendistro-knn","version":"x.x.x.x"},{"name":"e2a893819b3df1d9b9f449026af9f4e7","component":"opendistro-reports-scheduler","version":"x.x.x.x"},{"name":"e2a893819b3df1d9b9f449026af9f4e7","component":"opendistro_index_management","version":"x.x.x.x"},{"name":"e2a893819b3df1d9b9f449026af9f4e7","component":"opendistro_security","version":"x.x.x.x"},{"name":"e2a893819b3df1d9b9f449026af9f4e7","component":"opendistro_sql","version":"x.x.x.x"},{"name":"e2a893819b3df1d9b9f449026af9f4e7","component":"performance-analyzer","version":"7.9.1"},{"name":"e2a893819b3df1d9b9f449026af9f4e7","component":"repository-s3","version":"7.9.1"},{"name":"e2a893819b3df1d9b9f449026af9f4e7","component":"sifi-remediation-plugin","version":"7.9.1"}]'
es_communi[ESCommunication::LogMsg]793: Failed to establish connection to DB.

Root Cause

The reason is the ODBC 1.13 diver change the expected sql plugin name which is not compatible with SQL Plugin version < 1.13.0.0

dai-chen commented 3 years ago

Similarly, ODBC driver 1.12 is unable to connect to ODFE 1.13 cluster due to same naming issue.

dai-chen commented 3 years ago

If more naming changes in future, we need to evaluate if this check is necessary or can be done in other ways (fuzzy match plugin name, get plugin version by our own endpoint, or send SELECT 1 query etc)