getredash / redash

Make Your Company Data Driven. Connect to any data source, easily visualize, dashboard and share your data.
http://redash.io/
BSD 2-Clause "Simplified" License
26.16k stars 4.36k forks source link

The "dnspython" module must be installed to use mongodb+srv:// URIs #2603

Closed leorochael closed 5 years ago

leorochael commented 6 years ago

Issue Summary

When attempting to test a connection to a MongoDB data source using a mongodb+srv:// URL, the following message is displayed:

The "dnspython" module must be installed to use mongodb+srv:// URIs

This message probably comes straight from pymongo, and I'm guessing that simply adding dnspython to requirements_all_ds.txt will be enough.

Or even better, inside requirements_all_ds.txt, simply replace this line:

pymongo==3.6.1

With this line:

pymongo[tls,srv]==3.6.1

The complete set of pymongo extras, as of 3.6.1, would be something like:

pymongo[tls,srv,gssapi]==3.6.1

As of pymongo 3.7.0b1, it will be

pymongo[tls,srv,gssapi,snappy]>=3.7.0b1

Steps to Reproduce

  1. Create a new MongoDB Datasource
  2. Type in a mongodb+srv:// url, like the ones shown in the free tier of MongoDB Atlas
  3. See the error message:

    The "dnspython" module must be installed to use mongodb+srv:// URIs

Technical details:

RichardLitt commented 6 years ago

Thanks @leorochael. This sounds like it might be a setup issue; have you asked about this bug on the forum?

arikfr commented 6 years ago

@leorochael thank you for the detailed report. If there are no complications due to installing the extra dependencies, I don't mind updating requirements_all_ds.txt to include the pymongo extras. Did you try this setup already?

leorochael commented 6 years ago

@arikfr I have run the pip command below (found on the Docker build) on my Ubuntu 17.10 machine, and found the same warnings with or without the extras:

dql 0.5.24 has requirement pyparsing==2.1.4, but you'll have pyparsing 2.2.0 which is incompatible.
pymapd 0.3.2 has requirement thrift==0.10.0, but you'll have thrift 0.11.0 which is incompatible.
boto3 1.7.41 has requirement botocore<1.11.0,>=1.10.41, but you'll have botocore 1.10.2 which is incompatible.
influxdb 2.7.1 has requirement six==1.9.0, but you'll have six 1.10.0 which is incompatible.
memsql 2.16.0 has requirement python-dateutil==2.2, but you'll have python-dateutil 2.4.2 which is incompatible.

I have tried dancing around these requirements (bumping some, pinning back others, installing requirements_all_ds.txt before requirements.txt) and managed to shut up some of them, but these remained because they conflict directly with versions pinned in requirements.txt and I feel I shouldn't try to downgrade the pins of neither six nor python-dateutil in requirements.txt:

influxdb 2.7.1 has requirement six==1.9.0, but you'll have six 1.10.0 which is incompatible.
memsql 2.17.0 has requirement python-dateutil==2.2, but you'll have python-dateutil 2.4.2 which is incompatible.

I don't think these libraries should have these sorts of hard pins on minor releases, but oh well...

I have not actually tried running redash with these changes yet, but I don't foresee major problems. Still, some of the pinned versions on requirements*.txt are old and could use some upgrading.

So, if you want, I can make a PR for just adding the pymongo extras, or one that also fix all but these two warnings with a minimum amount of changes to requirements*.txt.

@RichardLitt: I found no reference to mongodb+srv on the forum on a quick search.

aelsantex commented 6 years ago

Hi! Similar problem for Oracle. I've tried to install cx_Oracle but i receive these errors:

root@wlfsgrcoll:/opt/instantclient_12_1# pip install cx_Oracle
Requirement already satisfied: cx_Oracle in /usr/local/lib/python2.7/dist-packages (6.4.1)
influxdb 2.7.1 has requirement six==1.9.0, but you'll have six 1.10.0 which is incompatible.
memsql 2.17.0 has requirement python-dateutil==2.2, but you'll have python-dateutil 2.4.2 which is incompatible.
root@wlfsgrcoll:/opt/instantclient_12_1#
leorochael commented 6 years ago

@aelsantex, those are warnings, not errors. cx_Oracle is installed.

kchaitanyach commented 6 years ago

Thanks mate. Had the issue and upgraded my PyMongo package with srv.