Unable to locate SQLGetPrivateProfileString function

Dear people,

 

When I try a: 

 

 

library(vRODBC)
connect <- odbcConnect("VerticaDSN")

 

I get the following error:

 

 

Warning messages:
1: In odbcDriverConnect("DSN=VerticaDSN") :
[vRODBC] ERROR: state HY000, code 11560, message [unixODBC][Vertica][ODBC] (11560) Unable to locate SQLGetPrivateProfileString function.
2: In odbcDriverConnect("DSN=VerticaDSN") : ODBC connection failed

 

Now I've searched everywhere on the internet for solutions as well as the docs provided by HPE, but never do I find a solution that works for me.

 

Now I know that it's related to the two .ini files you need to create, so first I'll show those:

 

/etc/odbc.ini

 

 

[ODBC Data Sources]
VerticaDSN = "Vertica"

[VerticaDSN]
Description = DSN for Vertica
Driver = /opt/hp/odbc/lib64/libverticaodbc.so
Database = VMart
Servername = localhost
UserName = dbadmin
Password = <omitted>
Port = 5433
ConnSettings =
Locale = en_US

[Driver]
DriverManagerEncoding = UTF-16
ODBCInstLib = /usr/lib/x86_64-linux-gnu/libodbcinst.so
ErrorMessagesPath = /opt/vertica/lib64
LogLevel = 0
LogPath = /tmp

 

/etc/vertica.ini

 

 

[Driver]
DriverManagerEncoding = UTF-16
ODBCInstLib = /usr/lib/x86_64-linux-gnu/libodbcinst.so
ErrorMessagesPath = /opt/vertica/lib64
LogLevel = 0
LogPath = /tmp

 

Both the system variables for $VERTICAINI and $ODBCINI are set and also in the .bashrc, as well as the Renviron has been set to:

 

VERTICAINI=/etc/verticaini.ini
ODBCINI=/etc/odbc.ini

 

Secondly, the paths that need to resolve to an actual file are all correct, as in, the file is actually in the place as listed in both .ini's.

 

The path for ErrorMessages also leads to a folder containing an en-US folder with in the folder the file ODBCMessages.xml.

 

I honestly do not how to solve it. Anybody who can help me with this?

 

(I'm running Ubuntu 14.04 LTS)

Comments

  • SruthiASruthiA Administrator

    HI,

     

       Can you share me the output of 

     

    - ls -l /opt/vertica/lib64/libverticaodbc.sostrings /opt/vertica/lib64/libverticaodbc.so | grep SQLGetPrivateProfileStringls -l /usr/lib64/*odbc

     

    Can you check if there is another odbc.ini file in your system apart from the one present in /etc??

     

     

    Thank you,

     Sruthi

  • Hey, first of all thanks for the quick reply,

     

    the result of ls -l /opt/vertica/lib64/libverticaodbc.sostrings /opt/vertica/lib64/libverticaodbc.so | grep SQLGetPrivateProfileStringls -l /usr/lib64/*odbc is:

     

    grep: /usr/lib64/*odbc: No such file or directory
    ls: cannot access /opt/vertica/lib64/libverticaodbc.sostrings: No such file or directory

    I don't know if the trailing dash (-) is neccessary, but if so: here's the output with dash:

     

    grep: /usr/lib64/*odbc: No such file or directory
    -: command not found

    Then secondly, a locate for odbc.ini gives me:

     

    /etc/odbc.ini
    /etc/odbc.ini.dpkg-old
    /home/bbubuntuuser/.odbc.ini
    /home/bbubuntuuser/hp-distributedR-1.2.0/installer/lib/odbc/odbc.ini
    /home/bbubuntuuser/unixODBC-2.3.4/man/odbc.ini.5
    /usr/etc/odbc.ini
    /usr/share/man/man5/odbc.ini.5

    So yes, there's a lot of other odbc.ini's. Similarly for vertica.ini:

     

    /etc/vertica.ini
    /home/bbubuntuuser/hp-distributedR-1.2.0/installer/lib/odbc/centos-vertica.ini
    /home/bbubuntuuser/hp-distributedR-1.2.0/installer/lib/odbc/ubuntu-vertica.ini

    But that seems to be allright.

     

    Is this helpfull?

     

    Best regards,

    Fred

  • SruthiASruthiA Administrator

    Hi,

     

       Can you share me the content of /etc/odbc.ini

     

     

    Sruthi

  • The contents for odbc.ini are in the openingspost! :) (As well as the vertica.ini fyi)

     

    For your ease though:

     

    /etc/odbc.ini

     

     

    [ODBC Data Sources]
    VerticaDSN = "Vertica"

    [VerticaDSN]
    Description = DSN for Vertica
    Driver = /opt/hp/odbc/lib64/libverticaodbc.so
    Database = VMart
    Servername = localhost
    UserName = dbadmin
    Password = <omitted>
    Port = 5433
    ConnSettings =
    Locale = en_US

    [Driver]
    DriverManagerEncoding = UTF-16
    ODBCInstLib = /usr/lib/x86_64-linux-gnu/libodbcinst.so
    ErrorMessagesPath = /opt/vertica/lib64
    LogLevel = 0
    LogPath = /tmp

     

  • SruthiASruthiA Administrator

    Hi,

     

       Thanks for the file. What is the value of ODBCINI environment variable??

     

     

    Sruthi

  • They are as follows:

     

    echo $VERTICAINI
    /etc/vertica.ini

    echo $ODBCINI
    /etc/odbc.ini

    Many thanks in advance.

  • After some tweaking left and right I now got the following message in RStudio when trying to connect. (Same with isql btw)

     

    Warning messages:
    1: In odbcDriverConnect("DSN=VerticaDSN") :
    [vRODBC] ERROR: state 08001, code 10380, message [unixODBC][Vertica][ODBC] (10380) Unable to establish a connection with data source. Missing settings: {[Database] [ServerName]}
    2: In odbcDriverConnect("DSN=VerticaDSN") : ODBC connection failed

    Even though the database and servername are actually set (See the first post of this thread).

    I made the example database of VMart.

     

    If I change the DSN to something that doesn't exist in odbc.ini it throws me the error that it can't find the specified DSN, so at least it's reading the right ODBC.ini file.

  • SruthiASruthiA Administrator

    Hi,

     

          Could you please change DRIVER to opt/vertica/lib64/libverticaodbc.so in odbc.ini and try connecting to database?

     

     

    Thank you,

     Sruthi

  • I tried to and it lead to the following error:

     

    dbadmin@BBVertica-Master:~$ isql -v VerticaDSN
    [08001][unixODBC][Vertica][ODBC] (10380) Unable to establish a connection with data source. Missing settings: {[Database] [ServerName]}
    [ISQL]ERROR: Could not SQLConnect

    Similar error in RStudio.

     

    So sadly it had no result so far.

  • So, currently I have the following:

     

    /etc/odbc.ini

     

    [ODBC Data Sources]
    VerticaDSN = "Vertica"

    [VerticaDSN]
    Description = DSN for Vertica
    Driver = /opt/vertica/lib64/libverticaodbc.so
    Database = VMart
    Servername = localhost
    UserName = dbadmin
    Password =
    Port = 5433
    ConnSettings =
    Locale = en_US

    [Driver]
    DriverManagerEncoding = UTF-16
    ODBCInstLib = /usr/lib/x86_64-linux-gnu/libodbcinst.so
    ErrorMessagesPath = /opt/vertica/lib64
    LogLevel = 0
    LogPath = /tmp

    /etc/vertica.ini

     

    [Driver]
    DriverManagerEncoding = UTF-16
    ODBCInstLib = /usr/lib/x86_64-linux-gnu/libodbcinst.so
    ErrorMessagesPath = /opt/vertica/lib64
    LogLevel = 0
    LogPath = /tmp

     

    and the system variables are as follows:

     

    echo $VERTICAINI

    • /etc/vertica.ini

    echo $ODBCINI

    • /etc/odbc.ini

    echo $LD_LIBRARY_PATH

    • /opt/vertica/lib:/usr/lib:/usr/local/lib

    The database in my system is the example from the installation guide provided with Vertica.

     

    Also some locate's:

     

    locate odbc.ini

    /etc/odbc.ini
    /home/bbubuntuuser/hp-distributedR-1.2.0/installer/lib/odbc/odbc.ini
    /home/bbubuntuuser/unixODBC-2.3.4/man/odbc.ini.5
    /usr/share/man/man5/odbc.ini.5

    locate vertica.ini

    /etc/vertica.ini
    /home/bbubuntuuser/hp-distributedR-1.2.0/installer/lib/odbc/centos-vertica.ini
    /home/bbubuntuuser/hp-distributedR-1.2.0/installer/lib/odbc/ubuntu-vertica.ini

    locate libverticaodbc.so

    /opt/hp/odbc/lib64/libverticaodbc.so
    /opt/hp/odbc/lib64/libverticaodbc.so.7
    /opt/hp/odbc/lib64/libverticaodbc.so.7.1
    /opt/hp/odbc/lib64/libverticaodbc.so.7.1.2
    /opt/hp/odbc/lib64.bak/libverticaodbc.so
    /opt/hp/odbc/lib64.bak/libverticaodbc.so.7
    /opt/hp/odbc/lib64.bak/libverticaodbc.so.7.1
    /opt/hp/odbc/lib64.bak/libverticaodbc.so.7.1.2
    /opt/lib/libverticaodbc.so
    /opt/lib64/libverticaodbc.so
    /opt/opt/vertica/lib/libverticaodbc.so
    /opt/vertica/lib/libverticaodbc.so
    /opt/vertica/lib64/libverticaodbc.so
    /opt/vertica/lib64/libverticaodbc.so.7
    /opt/vertica/lib64/libverticaodbc.so.7.1
    /opt/vertica/lib64/libverticaodbc.so.7.1.2

    locate libodbcinst.so

    /home/bbubuntuuser/unixODBC-2.3.4/odbcinst/.libs/libodbcinst.so
    /home/bbubuntuuser/unixODBC-2.3.4/odbcinst/.libs/libodbcinst.so.2
    /home/bbubuntuuser/unixODBC-2.3.4/odbcinst/.libs/libodbcinst.so.2.0.0
    /usr/lib/libodbcinst.so
    /usr/lib/libodbcinst.so.2
    /usr/lib/libodbcinst.so.2.0.0
    /usr/lib/x86_64-linux-gnu/libodbcinst.so
    /usr/lib/x86_64-linux-gnu/libodbcinst.so.1
    /usr/lib/x86_64-linux-gnu/libodbcinst.so.1.0.0

    I'm honestly lost and have no clue where to search anymore.

     

    I tried all the steps provided in the following guide (exactly as written down):

     

    http://www.vertica.com/wp-content/uploads/2014/06/vRODBC-Installation-Guide.pdf

     

    Also on one of the nodes that was still untouched in regards to the RODBC or unixODBC files but sadly this didn't work either and resulted in the same error.

     

    Is there anybody that could possibly help?

  • Honestly nobody that has a clue what is going on?

     

    Anybody that got this working then on an Ubuntu 14.04 LTS install with the latest version of UnixODBC from the website? (So not the package included with DistR)

     

    Or perhaps anybody that can point me to an install guide for vRODBC that has worked for them?

  • This is what the log has to say about the failing connection by the way:

     

    Feb 15 15:54:56 INFO  2752448320 VConnection::UpdateConnectionSettings: in: DSN:VerticaDSN, type 0
    Feb 15 15:54:56 INFO 2752448320 VConnection::UpdateConnectionSettings: out BackupServerNode
    Feb 15 15:54:56 INFO 2752448320 VConnection::UpdateConnectionSettings: type 0, value: ?
    Feb 15 15:54:56 INFO 2752448320 VConnection::UpdateConnectionSettings: out ColumnsAsChar
    Feb 15 15:54:56 INFO 2752448320 VConnection::UpdateConnectionSettings: type 0, value: ?
    Feb 15 15:54:56 INFO 2752448320 VConnection::UpdateConnectionSettings: out ConnectionLoadBalance
    Feb 15 15:54:56 INFO 2752448320 VConnection::UpdateConnectionSettings: type 0, value: ?
    Feb 15 15:54:56 INFO 2752448320 VConnection::UpdateConnectionSettings: out ConnSettings
    Feb 15 15:54:56 INFO 2752448320 VConnection::UpdateConnectionSettings: type 0, value: ?
    Feb 15 15:54:56 INFO 2752448320 VConnection::UpdateConnectionSettings: out Database
    Feb 15 15:54:56 INFO 2752448320 VConnection::UpdateConnectionSettings: type 0, value: ?
    Feb 15 15:54:56 INFO 2752448320 VConnection::UpdateConnectionSettings: out DirectBatchInsert
    Feb 15 15:54:56 INFO 2752448320 VConnection::UpdateConnectionSettings: type 0, value: ?
    Feb 15 15:54:56 INFO 2752448320 VConnection::UpdateConnectionSettings: out DriverStringConversions
    Feb 15 15:54:56 INFO 2752448320 VConnection::UpdateConnectionSettings: type 0, value: ?
    Feb 15 15:54:56 INFO 2752448320 VConnection::UpdateConnectionSettings: out Label
    Feb 15 15:54:56 INFO 2752448320 VConnection::UpdateConnectionSettings: type 0, value: ?
    Feb 15 15:54:56 INFO 2752448320 VConnection::UpdateConnectionSettings: out Locale
    Feb 15 15:54:56 INFO 2752448320 VConnection::UpdateConnectionSettings: type 0, value: ?
    Feb 15 15:54:56 INFO 2752448320 VConnection::UpdateConnectionSettings: out Port
    Feb 15 15:54:56 INFO 2752448320 VConnection::UpdateConnectionSettings: type 0, value: ?
    Feb 15 15:54:56 INFO 2752448320 VConnection::UpdateConnectionSettings: out PreferredAddressFamily
    Feb 15 15:54:56 INFO 2752448320 VConnection::UpdateConnectionSettings: type 0, value: ?
    Feb 15 15:54:56 INFO 2752448320 VConnection::UpdateConnectionSettings: out PWD
    Feb 15 15:54:56 INFO 2752448320 VConnection::UpdateConnectionSettings: type 0, value: ?
    Feb 15 15:54:56 INFO 2752448320 VConnection::UpdateConnectionSettings: out ResultBufferSize
    Feb 15 15:54:56 INFO 2752448320 VConnection::UpdateConnectionSettings: type 0, value: ?
    Feb 15 15:54:56 INFO 2752448320 VConnection::UpdateConnectionSettings: out ServerName
    Feb 15 15:54:56 INFO 2752448320 VConnection::UpdateConnectionSettings: type 0, value: ?
    Feb 15 15:54:56 INFO 2752448320 VConnection::UpdateConnectionSettings: out SSLCertFile
    Feb 15 15:54:56 INFO 2752448320 VConnection::UpdateConnectionSettings: type 0, value: ?
    Feb 15 15:54:56 INFO 2752448320 VConnection::UpdateConnectionSettings: out SSLKeyFile
    Feb 15 15:54:56 INFO 2752448320 VConnection::UpdateConnectionSettings: type 0, value: ?
    Feb 15 15:54:56 INFO 2752448320 VConnection::UpdateConnectionSettings: out SSLMode
    Feb 15 15:54:56 INFO 2752448320 VConnection::UpdateConnectionSettings: type 0, value: ?
    Feb 15 15:54:56 INFO 2752448320 VConnection::UpdateConnectionSettings: out TransactionIsolation
    Feb 15 15:54:56 INFO 2752448320 VConnection::UpdateConnectionSettings: type 0, value: ?
    Feb 15 15:54:56 INFO 2752448320 VConnection::UpdateConnectionSettings: out UID
    Feb 15 15:54:56 INFO 2752448320 VConnection::UpdateConnectionSettings: type 0, value: ?
    Feb 15 15:54:56 ERROR 2752448320 Connection::SQLConnectW: [Vertica][ODBC] (10380) Unable to establish a connection with data source. Missing settings: {[Database] [ServerName]}

    It seems to me that the values are supposed to actally be read, but instead they are all empty.

  • I am also facing the same problem.
    Is there anyone to help us out from this issue.

     

    Many thanks in advance,

    Kalpesh

  • SruthiASruthiA Administrator

    Hi,

     

        Are there any other packages installed in your server , by default installed ODBC Driver. Please map obdcinstlib  to correct

    libodbcinst.so

    which was created when you installed vertica ODBC driver.

     

     

    Sruthi 

  • Thanks for your response.

    But this file is not present in my server.

     

    Would you please help me to do needful.

     

    Thanks,

    Kalpesh

  • Hi Kalpesh

     

    'm installing Vertica for the first time today, maybe later to answer but I fix this issue installing the package unixodbc-dev.

     

    My Setup is a Ubuntu 14

     

    Regards

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file