Skip to main content

Unable to locate SQLGetPrivateProfileString function

  • February 1, 2016
  • 16 replies
  • 37 views

FDropp
Forum|alt.badge.img
  • Participating Frequently

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)

16 replies

SruthiA
Forum|alt.badge.img+1
  • Participating Frequently
  • February 1, 2016

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


FDropp
Forum|alt.badge.img
  • Author
  • Participating Frequently
  • February 1, 2016

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


SruthiA
Forum|alt.badge.img+1
  • Participating Frequently
  • February 1, 2016

Hi,

 

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

 

 

Sruthi


FDropp
Forum|alt.badge.img
  • Author
  • Participating Frequently
  • February 1, 2016

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

 


SruthiA
Forum|alt.badge.img+1
  • Participating Frequently
  • February 2, 2016

Hi,

 

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

 

 

Sruthi


FDropp
Forum|alt.badge.img
  • Author
  • Participating Frequently
  • February 4, 2016

They are as follows:

 

echo $VERTICAINI
/etc/vertica.ini

echo $ODBCINI
/etc/odbc.ini

Many thanks in advance.


FDropp
Forum|alt.badge.img
  • Author
  • Participating Frequently
  • February 4, 2016

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.


SruthiA
Forum|alt.badge.img+1
  • Participating Frequently
  • February 5, 2016

Hi,

 

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

 

 

Thank you,

 Sruthi


FDropp
Forum|alt.badge.img
  • Author
  • Participating Frequently
  • February 9, 2016

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.


FDropp
Forum|alt.badge.img
  • Author
  • Participating Frequently
  • February 11, 2016

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?


FDropp
Forum|alt.badge.img
  • Author
  • Participating Frequently
  • February 15, 2016

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?


FDropp
Forum|alt.badge.img
  • Author
  • Participating Frequently
  • February 15, 2016

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.


KalpeshJ
  • New Participant
  • April 29, 2016

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

 

Many thanks in advance,

Kalpesh


SruthiA
Forum|alt.badge.img+1
  • Participating Frequently
  • April 29, 2016

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 


KalpeshJ
  • New Participant
  • May 2, 2016

Thanks for your response.

But this file is not present in my server.

 

Would you please help me to do needful.

 

Thanks,

Kalpesh


rafzx2
  • New Participant
  • December 20, 2016

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