Skip to Content
0
Dec 15, 2017 at 10:44 AM

"authentication failed" when connecting to SAP HANA Express Edition from Python/Java/Excel

8119 Views Last edit Dec 19, 2017 at 04:30 PM 10 rev

I've installed HANA Express Edition 2 in a virtual machine running on Windows 10 in Virtualbox. I successfully connected Eclipse to the database using the following (faked) credentials:

Host: 10.10.1.25
Port: 39015
User: SYSTEM
Password: MyPassword1

This works fine and I've been using it for a while.

Recently, I wanted to access the database via Python. For that I followed this helpful tutorial: https://www.sap.com/developer/how-tos/2016/08/hxe-python-connection.html

However, it fails at the connectivity check :-(

Specifically, I executed the following script:

from hdbcli import dbapi
connection = dbapi.connect('10.10.1.25', 39015, 'SYSTEM', 'MyPassword1')

It fails with error:

Traceback (most recent call last):
  File "test.py", line 2, in <module>
    connection = dbapi.connect('10.10.1.25', 39015, 'SYSTEM', 'MyPassword1')
  File "C:\Users\MyUser\AppData\Local\Programs\Python\Python36\lib\site-packages\hdbcli\dbapi.py", line 85, in __init__
    self.__connection = pyhdbcli.connect("%s:%d" % (address, port), 'HDB', user, password, self.__properties)
hdbcli.dbapi.Error: (10, 'authentication failed')

Modifying the parameters "port" or "server" in the second line results in different errors so there's really something odd with the authentication. The credentials are definitely equal to those in Eclipse (which is still working).

Is there something I have missed during installation? Or what are other possible reasons for rejecting authentication apart from wrong credentials?

Edit: I tried connecting via JDBC (64bit) and got the same error. Connecting via Excel (32bit) also does not work:

Feels like there is something odd with the configuration of the server, so I checked the debug trace for authentication in the indexserver:

[...]
[2352]{-1}[29/-1] 2017-12-19 17:20:51.984769 d Authentication Connection.cc(03987) : [PRE AUTHENTICATION] logon name: SYSTEM
[2352]{-1}[30/-1] 2017-12-19 17:20:51.985535 i Authentication catalog_authmgr.cc(00574) : lock time for user SYSTEM is 1440 minutes; user is locked until 2017-12-20 16:20:51.9840000 (given in UTC) [1440,2017-12-20 16:20:51.9840000]
[2352]{-1}[-1/-1] 2017-12-19 17:20:51.985648 d Authentication Connection.cc(03203) : exception during authentication: ERROR [SQL-10] authentication failed at ptime/query/catalog/catalog_authmgr.cc:575
exception 1: no.71000010 (ptime/query/catalog/catalog_authmgr.cc:575)
ptime::PtimeException

NO exception throw location recorded. Stack generation suppressed.

Attachments

gzlp2.png (3.0 kB)