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

Azure Data Warehouse through MS SQL (ODBC) runner doesn't work on a default docker image #4356

Closed
spacentropy opened this issue Nov 14, 2019 · 2 comments · Fixed by #4676
Closed

Comments

@spacentropy
Copy link
Contributor

spacentropy commented Nov 14, 2019

Issue Summary

Default docker image has neither pyodbc nor Microsoft ODBC Driver installed, so you can't query Azure Data Warehouse with default docker image, even if you enable pyodbc.

Steps to Reproduce

  1. Have Redash running in docker
  2. Enable mssql_odbc query runner through env: REDASH_ADDITIONAL_QUERY_RUNNERS: "redash.query_runner.mssql_odbc"
  3. It doesn't get registered:
    [2019-11-13 13:29:19,823][PID:10][DEBUG][redash.query_runner] Microsoft SQL Server (ODBC) query runner enabled but not supported, not registering. Either disable or install missing dependencies.
  4. I found out why:
    a) pyodbc==4.0.27 pypi package is missing in requirements_all_ds.txt
    b) Even if you put it in requirements_all_ds.txt , it can't be downloaded & built by pip because you don't have g++ unixodbc-dev package installed
    c) Even if you get g++ unixodbc-dev, you still need Microsoft ODBC Driver installed: msodbcsql17
  5. this line in Dockerfile fixes packages, you also have to add pyodbc to requirements_all_ds.txt:
RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - && curl https://packages.microsoft.com/config/debian/10/prod.list > /etc/apt/sources.list.d/mssql-release.list && apt-get update && ACCEPT_EULA=Y apt-get install -y msodbcsql17 g++ unixodbc-dev

So I see the main problem as:

  • You can't query Azure SQL/Data Warehouse straight out of the box

Is it even possible to package all these dependencies into standard Redash docker image and make it work without apt-get and pyodbc troubles? That means accepting Microsoft's EULA, and some native dependencies, e.g. pyodbc builds itself from source. I haven't measured image size increase but apt-get writes After this operation, 15.8 MB of additional disk space will be used

The license terms for this product can be downloaded from
https://aka.ms/odbc131eula and found in
/usr/share/doc/msodbcsql/LICENSE.TXT . By entering 'YES',
you indicate that you accept the license terms.

The runner itself(#1906) works. I just had to spend 30 minutes to make it run in docker.

Technical details:

  • Redash Version: 8

Thanks for the awesome v8 release!

@spacentropy spacentropy changed the title Azure SQL/Data Warehouse through MS SQL (ODBC) runner doesn't work on a default docker image Azure Data Warehouse through MS SQL (ODBC) runner doesn't work on a default docker image Nov 14, 2019
@arikfr
Copy link
Member

arikfr commented Nov 14, 2019

The EULA seems reasonable and the size increasing as well. We can even offset it by dropping FreeTDS and pymssql from our default packages -- this supposed to cover the same databases and be even better supported, right?

@spacentropy
Copy link
Contributor Author

I fear this could break compatibility? There were two datasources, now there would be one - existing queries will fail.
Or we can do it in v9? I can make PR to master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants