Fix for “Database connection is not available” Error in HANA SPS05 (Rev 56)
Background:
I had to upgrade the HANA One (Developer Edition) in AWS from Rev 48 to Rev 56 as part of the openSAP Introduction to Software Development on SAP HANA class.
Rev 48 client setup:
My Win7, C:\Windows\system32\drivers\etc\hosts file had the entry, aa.bb.cc.dd imdbhdb, where aa.bb.cc.dd is the Elastic IP of the HANA Instance in AWS.
I added the system in HANA studio using the entries below:
Hostname: imdbhdb
Instance Number: 00
DB User Name: SYSTEM
Password: <your password>
Rev 56 Error:
After the upgrade to Rev 56, the above setup resulted in the Error “Database connection is not available” within a few minutes after adding the system in the HANA Studio.
Problem Analysis:
I activated the JDBC trace as below for Rev 56 (See http://help.sap.com/hana_platform SAP HANA Developer’s Guide):
JDBC would initially connect to the HANA server:
new Connection ‘jdbc:sap://imdbhdb:30015’locale=en_USuser=SYSTEMpassword=***timeout=0reconnect=truevalidateCertificate=falseencrypt=falseHOSTLIST: [imdbhdb:30015,]
new Connection ‘jdbc:sap://10.29.1.187:30015’locale=en_USuser=SYSTEMpassword=***timeout=0reconnect=truevalidateCertificate=falseencrypt=falseHOSTLIST: [10.29.1.187:30015,]new RTEException: -813 Cannot connect to host 10.29.1.187:30015 [Connection timed out: connect], -813.whereAmIjava.lang.Throwableat com.sap.db.util.Tracer.whereAmI(Tracer.java:348)at com.sap.db.rte.comm.RTEException.<init>(RTEException.java:66)at com.sap.db.rte.comm.SocketComm.openSocket(SocketComm.java:125)at com.sap.db.rte.comm.SocketComm.<init>(SocketComm.java:58)at com.sap.db.rte.comm.SocketComm$1.open(SocketComm.java:42)at com.sap.db.jdbc.topology.Topology.getSession(Topology.java:145)at com.sap.db.jdbc.Driver.openByURL(Driver.java:1016)at com.sap.db.jdbc.Driver.connect(Driver.java:230)at com.sap.ndb.studio.jdbc.JDBCPlugin$3.run(JDBCPlugin.java:642)using null=> FAILED
Rev 48 JDBC Connect |
Rev 56 JDBC Connect |
---|---|
First three Connection attempts: new Connection ‘jdbc:sap://imdbhdb:30015’ HOSTLIST: [imdbhdb:30015,] Subsequent Connection attempts: new Connection ‘jdbc:sap://imdbhdb:30015’ HOSTLIST:
[imdbhdb:30015,imdbhdb.sapcoe.sap.com:30015,
10.30.128.6:30015,]
|
First three Connection attempts: new Connection ‘jdbc:sap://imdbhdb:30015’ HOSTLIST: [imdbhdb:30015,] Subsequent Connection attempts: new Connection ‘jdbc:sap://10.29.1.187:30015’ HOSTLIST: [10.29.1.187:30015,] |
SELECT “HOST”,”PORT”,“SERVICE_NAME”,”ACTIVE_STATUS”,”PROCESS_ID”,“COORDINATOR_TYPE”,”SQL_PORT” FROM SYS.M_SERVICES
Rev 48 Output |
|
---|---|
Rev 56 Output |
SELECT “HOST”,”KEY”,”VALUE” FROM SYS.M_HOST_INFORMATION WHEREUPPER(“HOST”) = ‘IMDBHDB’ AND (UPPER(“KEY”) = ‘SID’ OR UPPER(“KEY”) = ‘SAPSYSTEM’
Rev 48 Output |
Rev 56 Output |
---|---|
SELECT “HOST”,”KEY”,”VALUE” FROM SYS.M_HOST_INFORMATION WHERE UPPER(“KEY”) LIKE ‘NET_%’
Rev 48 Output |
Rev 56 Output |
---|---|
Workaround:
#1) Someone in openSAP forum suggested using hanaserver in the hosts file entry and in adding the system in HANA studio. While this worked, I did not like this option since hanaserver has no relationship to the actual hostname — imdbhdb.
#2) I have been suggesting to folks — in the openSAP forum and in the AWS upgrade blog (http://scn.sap.com/docs/DOC-30980) — to use AWS Elastic IP for hostname in HANA studio while adding the system and to NOT add any entry in the hosts file. While this might be the lesser of the two evils, both options had the yellow-icon problem for the sapstartsrv process in the HANA studio.The SAP HANA Systems (Navigator) tab/view would also say “Some services are not started” (with an yellow icon) or “System state cannot be determined” (with a gray icon) for the system.
Fix:
When you compared the outputs of the SQL commands between Rev 48 and Rev 56 listed above, the only difference is the new key net_publicname added in Rev 56 in the View SYS.M_HOST_INFORMATION.
I had to wait until SPS06 documents were published to see what this new key was.
“Public host name that should be used by client interfaces. Can contain a host name, FQDN or IP address”. (See http://help.sap.com/hana_platform SAP HANA System Views Reference)
The public_hostname_resolution parameter is documented in the SAP HANA Administration Guide (http://help.sap.com/hana_platform). This is a new parameter that has obviously been introduced after Rev 48. The values for this parameter are no,ip,name,fqdn with ip being the default in Rev 56. That is probably why the net_publichostname was set to the internal IP of the AWS HANA Instance. This raises another question as to why this was not set to the public IP (aka AWS Elastic IP) of the AWS Instance. The prudent thing at this point seems to be to disable this feature for the aforementioned reason and for backward compatibility.
The changed parameters are stored at the OS level as shown below.
The original *.ini files are at the OS level as shown below.
Let us run the SQL command now.
SELECT “HOST”,”KEY”,”VALUE” FROM SYS.M_HOST_INFORMATION WHERE UPPER(“KEY”) LIKE ‘NET_%’
Now the net_publicname is set to imdbhdb.
Delete the system from the HANA studio, add the AWS ELASTIC IP-to-host (imdbhdb) mapping in the hosts file, and re-add the system in the HANA studio using the hostname ibmdbhdb.
Now the sapstartsrv process has the green icon as above.
Let us compare the JDBC Connections.
Rev 48 JDBC Connect |
Rev 56 JDBC Connect |
---|---|
First three Connection attempts: new Connection ‘jdbc:sap://imdbhdb:30015’ HOSTLIST: [imdbhdb:30015,] Subsequent Connection attempts: new Connection ‘jdbc:sap://imdbhdb:30015’ HOSTLIST:
[imdbhdb:30015,imdbhdb.sapcoe.
sap.com:30015,10.30.128.6:30015,]
|
First three Connection attempts: new Connection ‘jdbc:sap://imdbhdb:30015’ HOSTLIST: [imdbhdb:30015,] Subsequent Connection attempts: new Connection ‘jdbc:sap://imdbhdb:30015’ HOSTLIST:
[imdbhdb:30015,imdbhdb.sapcoe.sap.com:30015,
10.29.1.187:30015,]
|
You are done. 🙂
[Please note that I have tested this fix only in AWS. I am not sure if Rev 56 systems hosted by other HANA Cloud hosting providers like CloudShare would have the same issue or if the fix would work if they did.]
I've been also struggling with studio Rev 56. I was thinking it was just because of the machine (windows 8) where I installed the studio, but then I see some people are also experiencing the same. Probably someone from developer center needs to comment on this blog.
Thanks Mani for posting this blog. I'll update once I have the chance to play with your workaround
Regards,
Idi
Idi, Thanks for commenting on the blog. I reported the problem to SAP in their Rev 56 upgrade blog (http://scn.sap.com/docs/DOC-30980) and also sent the log files to inmemorydevcenter@sap.com around June 13, 2013. I decided to fix the issue myself since there has been no response from SAP -- probably they are all busy with getting SPS06 (Rev 60) out the door :-).
Regards.
Yes, Mani. It works. But then, I had to recreate the workspace (delete and create). It didn't allow to create a workspace with the same name as the previous one, so I had to delete the folder "._SYS_REGI_settings" first, then created a new workspace. I needed to checkout the project as well.
Thanks.
Idi, Thanks for testing the fix. I don't like the idea of deleting "\._SYS_REGI_settings" folder -- you could have created a workspace with a different name. You could check out/import the project if the Repository had the latest version. You could also add the project (Create new project accepts an existing project) from your local C: drive and share it.
Regards.
Thank you !!!!
Hi Mani Sekaran Muthu
Thanks for this nicely constructed, clear blog post
. It's still valid by the way, I'm running a Suite on HANA instance on Amazon AWS (REV72) and this came in use handy.
Best regards
Tom
Applied the fix, no more yellow triangles, all green!
Thanks!
AA