-
Notifications
You must be signed in to change notification settings - Fork 564
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
Unable to connect with UnixODBC and Cloudera Impala Driver in pyodbc 5.0.1 #1313
Comments
Can you reproduce the issue from the command line? For example
|
Yes, from the command line I get exactly the same error. I'm working with Python 3.10.11.
I tried with both versions, and on 4.0.39 it's working on console.
On windows, with version 5.0.1 it's working fine, so the problem might be related with linux somehow.
|
Okay, so let's try and determine what pyodbc 5.0.1 is doing differently from 4.0.39. Create a little test script # pyodbc_test.py
import pyodbc
print(pyodbc.version)
conn = pyodbc.connect("DSN=Hadoop Catalyst LDAP", autocommit=True) verify that pyodbc 4.0.39 is installed, then run this from the command prompt
Upgrade pyodbc to 5.0.1 and then run
Attach (drag and drop) those .txt files into a reply here and we can see if anything looks different. |
I've ran into similar problem in my environment, connect in 4.x works and after upgrading to 5.x I get the error "('IM002', '[IM002] [unixODBC][Driver Manager]Data source name not found, and no default driver specified (0) (SQLDriverConnect)')". I've ran the straces @gordthompson requested |
Could you try an ODBC trace instead? |
From the straces I see your /etc/odbcinst.ini appears to be empty, which doesn't make sense - that's where the driver should be listed. |
My /etc/odbcinst.ini is indeed empty but the 4.x version doesn't mind. How do I run ODBC trace? Tried setting trace options in odbc.ini under [ODBC] but the log file is nowhere to be found. The tracing under my DSN_name was already set as is. my odbc.ini file looks like this:
|
The
block goes in odbcinst.ini. Putting it in odbc.ini has no effect under unixODBC. |
Thanks here is the logfile, 1st 5.x version connect and then 4.x. I've replaced my real DSN with "my_dsn", the lengths are correct in trace.
|
That behaviour looks just the same as described here except that SQLGetDiagRecW returns an actual error instead of SQL_NO_DATA. TL;DR - pyodbc_4 doesn't freak out if SQLDriverConnectW returns an error, but pyodbc_5 does. |
Hello everyone, first of all thanks for the hard work, I've been using this library for so long and it's awesome.
Since the last update to pyodbc version 5, the connection with UnixODBC and the Cloudera Impala driver has stopped working. I am making the connection directly with DSN, configuring /etc/odbc.ini.
I've tried with latest v4, and it's working as expected, but with the new release I'm getting the following error:
InterfaceError: ('IM002', '[IM002] [unixODBC][Driver Manager]Data source name not found, and no default driver specified (0) (SQLDriverConnect)')
This is my odbc.ini file:
And this is how I'm configuring the connection:
I've tried also to remove white spaces on DSN name, but the error persists.
Thanks!
The text was updated successfully, but these errors were encountered: