Frustrating issue (DB Users issue)

Moderator: NorbertKrupa

Post Reply
Benjamin_e
Newbie
Newbie
Posts: 15
Joined: Tue Aug 26, 2014 1:43 pm

Frustrating issue (DB Users issue)

Post by Benjamin_e » Fri Mar 06, 2015 8:18 pm

Hey all and happy purim :)

I have a VERTICA database installed on my machine, well all is working like a Swiss clock except 1 thing.
My UID called bennydb. when i want to login into the database i do the follow:

su - bennydb
pwd line.

then just vsql & password so all-right till here.

now if I logged in into this bennydb user and I want to enter python code to login into the database i do the follow:

Code: Select all

import pyodbc
cur = pyodbc.connect('dsn=vertica;uid=bennydb;pwd=***')
BUT Then i get:
Mar 06 21:05:05 INFO  1873950528 Driver::LogVersions: SDK Version: 09.02.10.1013
Mar 06 21:05:05 INFO  1873950528 Driver::LogVersions: DSII Version: 07.01.0004
Mar 06 21:05:05 INFO  1873950528 Driver::Initialize: Database CHAR Encoding: UTF-8
Mar 06 21:05:05 INFO  1873950528 Driver::Initialize: Database WCHAR Encoding: UTF-8
Mar 06 21:05:05 INFO  1873950528 Driver::Initialize: ANSI CHAR Encoding: UTF-8
Mar 06 21:05:05 INFO  1873950528 Driver::Initialize: Driver Manager WCHAR Encoding: UTF-16LE
Mar 06 21:05:05 INFO  1873950528 Environment::SQLSetEnvAttr: Attribute: 200
Mar 06 21:05:05 INFO  1873950528 Environment::SQLGetEnvAttr: Attribute: 200
Mar 06 21:05:05 INFO  1873950528 VEnvironment::CreateConnection: ODBC Version is: 3
Mar 06 21:05:05 INFO  1873950528 Connection::SQLSetConnectAttr: Attribute: 115
Mar 06 21:05:05 INFO  1873950528 VConnection::UpdateConnectionSettings: in: Database:expertSys, type 0
Mar 06 21:05:05 INFO  1873950528 VConnection::UpdateConnectionSettings: in: Description:expert System database, type 0
Mar 06 21:05:05 INFO  1873950528 VConnection::UpdateConnectionSettings: in: Driver:/opt/vertica/lib64/libverticaodbc.so.7, type 0
Mar 06 21:05:05 INFO  1873950528 VConnection::UpdateConnectionSettings: in: DSN:vertica, type 0
Mar 06 21:05:05 INFO  1873950528 VConnection::UpdateConnectionSettings: in: Locale:en-GB, type 0
Mar 06 21:05:05 INFO  1873950528 VConnection::UpdateConnectionSettings: in: Port:5433, type 0
Mar 06 21:05:05 INFO  1873950528 VConnection::UpdateConnectionSettings: in: PWD:********, type 0
Mar 06 21:05:05 INFO  1873950528 VConnection::UpdateConnectionSettings: in: Servername:localhost, type 0
Mar 06 21:05:05 INFO  1873950528 VConnection::UpdateConnectionSettings: in: UID:bennydb, type 0
Mar 06 21:05:05 INFO  1873950528 VConnection::UpdateConnectionSettings: out BackupServerNode
Mar 06 21:05:05 INFO  1873950528 VConnection::UpdateConnectionSettings: type 0, value: ?
Mar 06 21:05:05 INFO  1873950528 VConnection::UpdateConnectionSettings: out ColumnsAsChar
Mar 06 21:05:05 INFO  1873950528 VConnection::UpdateConnectionSettings: type 0, value: ?
Mar 06 21:05:05 INFO  1873950528 VConnection::UpdateConnectionSettings: out ConnectionLoadBalance
Mar 06 21:05:05 INFO  1873950528 VConnection::UpdateConnectionSettings: type 0, value: ?
Mar 06 21:05:05 INFO  1873950528 VConnection::UpdateConnectionSettings: out ConnSettings
Mar 06 21:05:05 INFO  1873950528 VConnection::UpdateConnectionSettings: type 0, value: ?
Mar 06 21:05:05 INFO  1873950528 VConnection::UpdateConnectionSettings: out DirectBatchInsert
Mar 06 21:05:05 INFO  1873950528 VConnection::UpdateConnectionSettings: type 0, value: ?
Mar 06 21:05:05 INFO  1873950528 VConnection::UpdateConnectionSettings: out DriverStringConversions
Mar 06 21:05:05 INFO  1873950528 VConnection::UpdateConnectionSettings: type 0, value: ?
Mar 06 21:05:05 INFO  1873950528 VConnection::UpdateConnectionSettings: out Label
Mar 06 21:05:05 INFO  1873950528 VConnection::UpdateConnectionSettings: type 0, value: ?
Mar 06 21:05:05 INFO  1873950528 VConnection::UpdateConnectionSettings: out PreferredAddressFamily
Mar 06 21:05:05 INFO  1873950528 VConnection::UpdateConnectionSettings: type 0, value: ?
Mar 06 21:05:05 INFO  1873950528 VConnection::UpdateConnectionSettings: out ResultBufferSize
Mar 06 21:05:05 INFO  1873950528 VConnection::UpdateConnectionSettings: type 0, value: ?
Mar 06 21:05:05 INFO  1873950528 VConnection::UpdateConnectionSettings: out SSLCertFile
Mar 06 21:05:05 INFO  1873950528 VConnection::UpdateConnectionSettings: type 0, value: ?
Mar 06 21:05:05 INFO  1873950528 VConnection::UpdateConnectionSettings: out SSLKeyFile
Mar 06 21:05:05 INFO  1873950528 VConnection::UpdateConnectionSettings: type 0, value: ?
Mar 06 21:05:05 INFO  1873950528 VConnection::UpdateConnectionSettings: out SSLMode
Mar 06 21:05:05 INFO  1873950528 VConnection::UpdateConnectionSettings: type 0, value: ?
Mar 06 21:05:05 INFO  1873950528 VConnection::UpdateConnectionSettings: out TransactionIsolation
Mar 06 21:05:05 INFO  1873950528 VConnection::UpdateConnectionSettings: type 0, value: ?
Mar 06 21:05:05 INFO  1873950528 VConnection::Connect: Connect to host localhost:5433, db expertSys
Mar 06 21:05:05 INFO  1873950528 Connection::SQLGetInfoW: InfoType: 77
Mar 06 21:05:05 INFO  1873950528 Connection::SQLSetConnectAttr: Attribute: 102
Mar 06 21:05:05 INFO  1873950528 Connection::SQLGetInfoW: InfoType: 77
Mar 06 21:05:05 INFO  1873950528 Connection::SQLGetInfoW: InfoType: 10002
Mar 06 21:05:05 INFO  1873950528 Connection::SQLGetInfoW: InfoType: 111
Mar 06 21:05:05 INFO  1873950528 Statement::SQLGetStmtAttrW: Attribute: 10010
Mar 06 21:05:05 INFO  1873950528 Statement::SQLGetStmtAttrW: Attribute: 10011
Mar 06 21:05:05 INFO  1873950528 Statement::SQLGetStmtAttrW: Attribute: 10012
Mar 06 21:05:05 INFO  1873950528 Statement::SQLGetStmtAttrW: Attribute: 10013
Mar 06 21:05:05 INFO  1873950528 Connection::ExecuteCatalogFunction: SQLGetTypeInfo
Mar 06 21:05:05 INFO  1873950528 VMetadataSource::Execute: out_metadataQuery: select * from (select CASE WHEN (UPPER(type_name) = 'CHAR') THEN 'CHAR' WHEN (UPPER(type_name) = 'VARCHAR') THEN 'VARCHAR' ELSE type_name END as data_type_name, CASE WHEN (odbc_type = 1) THEN -8 WHEN (odbc_type = 12) THEN -9 WHEN ( odbc_subtype != 0 ) THEN odbc_subtype ELSE odbc_type END as data_type, column_size, case when type_id not in (5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 114, 115, 116, 117) then null when odbc_type in (-5, 2, 8) then null else E'\'' end as literal_prefix,  case when type_id not in (5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 114, 115, 116, 117) then null when odbc_type in (-5, 2, 8) then null else E'\'' end as literal_suffix, creation_parameters as create_param, 1 as nullable, 1 as case_sensitive, 3 as searchable, 0 as unsigned_attribute, 0 as fixed_prec_scale, 0 as auto_unique, CASE WHEN (UPPER(type_name) = 'CHAR') THEN 'CHAR' WHEN (UPPER(type_name) = 'VARCHAR') THEN 'VARCHAR' ELSE type_name END as local_type_name, min_scale as minimum_scale, max_scale as maximum_scale, CASE WHEN (odbc_type = 1) THEN -8 WHEN (odbc_type = 12) THEN -9 ELSE odbc_type END as sql_data_type, CASE WHEN (odbc_type = 10) THEN (odbc_subtype-100) WHEN (odbc_type = 9) THEN (odbc_subtype-90) ELSE 0 END as sql_datetime_sub, 10 as num_prec_radix, NULL as interval_precision from v_catalog.types order by odbc_type, type_name ) as vmd where data_type = E'93'
Mar 06 21:05:05 INFO  1873950528 VMetadataSource::Execute: Command status: SELECT, 2 tuples 19 fields
But when I am on my super user (benny) I have no access to the vsql itself (the database) but if i try to login via pyodbc I do manage to do it and without any fustrating lines like above.
I know its something with the permissions, tried to fix it but without any success.

Here is additional information:

Code: Select all

[b]/etc/odbc.ini:[/b]
[vertica]
Description = expert System database
Driver = /opt/vertica/lib64/libverticaodbc.so.7
Database = expertSys
Servername = localhost
UID = bennydb
PWD = ----
Port = 5433
Locale = en-GB

Code: Select all

[b]/etc/odbcinst.ini:[/b]
[vertica]
Description = HP Vertica ODBC Driver
Driver = /opt/vertica/lib64/libverticaodbc.so.7
Anyone know how to fix it!? :/

pythianpearce
Newbie
Newbie
Posts: 1
Joined: Tue Sep 01, 2015 5:03 pm

Re: Frustrating issue (DB Users issue)

Post by pythianpearce » Tue Sep 01, 2015 5:09 pm

Hey,

So we hit the same problem today and after investigation found that it had to do with the log level and log permissions set in /etc/vertica.ini.

Code: Select all

[Driver]
DriverManagerEncoding=UTF-16
ODBCInstLib=/opt/vertica/lib64/libverticaodbc.so.7.1.2
ErrorMessagesPath=/opt/vertica/lib64
LogLevel=4
LogPath=/tmp
The log level we had set was 4. When decreased to 0 I noticed there was no more output when running our test code. After further investigation the vertica_driver.log file in the log path (/tmp/vertica_driver.log) was not writable by the user we were using for testing, forcing all output to STDOUT instead of the log file.

So I would recommend ensuring your Vertica driver log is writable and that your LogLevel is set to an appropriate value.

Post Reply

Return to “Vertica Error Codes”