SAP Knowledge Base Article - Preview

2653777 - Phyton connection to HANA database using hdbuserstore-key fails

Symptom

Accordingly to Connect Method and Python Connection Properties, it is possible to use a userkey for an SAP HANA database connection with python:
"Connect by using the database parameters stored in hdbuserstore:
connect(key=<hdbuserstore-key>)"
but it is not possible to establish a connection with dbapi.connect and the usage of a valid hdbuserstore key.

Error:
sapadm@sap123456:/usr/sap/SAP/SYS/global/hdb/custom/scripts> python saptest.py
Traceback (most recent call last):
File "saptest.py", line 7, in <module>
connection = dbapi.connect(userkey='SAPUSERTESTSYSTEMDB')
File "/usr/sap/SAP/HDB00/exe/python_support/hdbcli/dbapi.py", line 85, in __init__
self.__connection = pyhdbcli.connect("%s:%d" % (address, port), 'HDB', user, password, self.__properties)
hdbcli.dbapi.Error: (-10709, 'Connect failed (no reachable host left)')

hdbuserstore list:

DATA FILE : /usr/sap/SAP/home/.hdb/sap123456/SSFS_HDB.DAT
KEY FILE : /usr/sap/SAP/home/.hdb/sap123456/SSFS_HDB.KEY
KEY SAPUSERTESTSYSTEMDB
ENV : localhost:39013

The connection with hdbsql and this userkey is possible without any problem.


Read more...

Environment

  • HANA 1.x
  • HANA 2.x

Product

SAP HANA 1.0, platform edition

Keywords

Python, userkey, key, userstore, hdbuserstore, dbapi, connection, kerberos, krb5cc , KBA , HAN-DB-CLI , SAP HANA Clients (JDBC, ODBC) , HAN-DB , SAP HANA Database , Problem

About this page

This is a preview of a SAP Knowledge Base Article. Click more to access the full version on SAP for Me (Login required).

Search for additional results

Visit SAP Support Portal's SAP Notes and KBA Search.