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

Connecting to netezza throws error but able to connect using isql #51

Open
jayMcoder opened this issue Jan 17, 2019 · 6 comments
Open

Comments

@jayMcoder
Copy link

jayMcoder commented Jan 17, 2019

{ [Error: [unixODBC]敓癲牥愠摮漯⁲潰瑲愠瑴楲畢整⁳牡⁥浥瑰y] errors: [ { message: '[unixODBC]敓癲牥愠摮漯⁲潰瑲愠瑴楲畢整⁳牡⁥浥瑰y', state: '奈〰0' } ], error: '[node-odbc] SQL_ERROR', message: '[unixODBC]敓癲牥愠摮漯⁲潰瑲愠瑴楲畢整⁳牡⁥浥瑰y', state: '奈〰0' }

One of the stack overflow answer
You have two issues. Firstly, you have an encoding mismatch between the connection and your program. The string "敓癲牥愠摮漯⁲潰瑲愠瑴楲畢整⁳牡⁥浥瑰y" decoded from UTF-16 to UTF-8 is "Server and/or port attributes are empty" -- which leads us nicely into your second issue.

I am unable to figure what could be the issue here.
I followed suggestions on different forums regarding ODBC Netezza SQL driver options.
Setting UnicodeTranslationOption = utf16 and DriverManagerEncoding = UTF16, but did not help.
Netezza connection string used driver=NetezzaSQL;servername=netezza;port=5480;database=DEV;username=uname;password=pass

@jayMcoder
Copy link
Author

jayMcoder commented Jan 17, 2019

Note:
I am able to connect to netezza using isql and nzodbcsql with the driver config

[NetezzaSQL]
Description     = ODBC for Netezza
Driver          = /usr/local/nz/lib64/libnzodbc.so
Setup           = /usr/local/nz/lib64/libnzodbc.so
APILevel        = 1
DriverManagerEncoding = UTF-16
UnicodeTranslationOption = utf16
CharacterTranslationOption = all
DebugLogging    = true
LogPath         = /tmp
PreFetch        = 256
Socket          = 16384

@v4x8182
Copy link

v4x8182 commented Jan 17, 2019

I too am seeing these encoding / connection issues with the 64 bit Netezza Driver v7.2.1.3 (libnzodbc.so) on RHEL 7. I have tried several encoding options and IANAAppCodePage settings of 4 and 106.

I do get an expected error response that does not have any encoding issue when pointing to the 32 bit ODBC driver.

@jayMcoder
Copy link
Author

@v4x8182
I removed unixODBC 64bit driver and installed 32 bit driver. But having the same encoding issue with node-odbc in nodejs application. If you could send the details what packages you modified to install 32 bit unixODBC driver. What I understood from the last line is you are still getting error message but its in English when using 32 bit unixODBC driver, am I right?

@v4x8182
Copy link

v4x8182 commented Jan 21, 2019

@jayMcoder you are correct. Both 32 and 64 bit versions of the Netezza driver were in the package I received. 32 bit version is in the bin and lib directories and 64 bit in the bin64 and lib64 directories. Since node is 64 bit it should point to the 64 bit libraries; however when I set "driver", in the ini file, to the 32 bit file it returns a readable (properly encoded) error of File not found. I am experiencing the exact same issue as you for 64 bit.

@jayMcoder
Copy link
Author

@v4x8182 Are you trying to use /lib/libnzodbc.so file for the 32 bit version. If so ldd will show if this file has all the dependency met. Usually "File not found" error can mislead what the actual error was, I found this out when I was investigating the netezza connection issue.
"ldd libnzodbc.so" shows this is not an executable file
"ldd libnzsqlodbc3.so" shows there are missing dependency. Only way to resolve dependency for 32 bit version is set LD_LIBRARY_PATH to lib64 (I know which is not the right way, but I am unable to find missing dependency for 32 bit version in lib folder)

@ghost
Copy link

ghost commented Mar 5, 2020

@jayMcoder I know this is an old thread; but I've found myself with the same exact problem as you. Did you ever find a solution to the encoding issue? Strange UTF-16 character error message trying to connect from .net Core 3.1 System.Data.Odbc within an ubuntu linux container.

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

No branches or pull requests

2 participants