Nix88 Absent Member.
Absent Member.
4582 views

HPSM 9.40 - Error while trying to connect to db

Jump to solution

Hi all,

it's two days that i am surfing the internet in order to find a clue about this but no success till now...

I am experiencing an issue with a local instance of HPSM Server running on a vm with WinSrv2k12 and SQL Express 2k12:  ODBC connection (32bit) setup and test works fine, server installation goes fine, demo data upload goes fine, but when i try to start HPSM Server service i notice the following in the sm.log file:

  3208(  3908) 02/02/2016 11:58:51  RTE I smservice: start service event received for service smservice
  3208(  3908) 02/02/2016 11:58:51  RTE I smservice: starting process sm
  2592(  3696) 02/02/2016 11:58:52  RTE I Using "utalloc" memory manager, mode [0]
  2592(  3696) 02/02/2016 11:58:52  RTE I Command line: sm
  2592(  3696) 02/02/2016 11:58:52  RTE I Process sm 9.40.0015 () System: 13080 (0x784DFB00) on PC (x64 64-bit) running Windows (6.2 Build 9200) Timezone GMT+01:00 daylight Locale it_IT from Server
  2592(  3696) 02/02/2016 11:58:52  RTE I Creating resources for system '13080' with key 0x784DFB00
  2592(  3696) 02/02/2016 11:58:52  RTE W The shared memory size 32000000 is less than the recommended size 134217728
  2592(  3696) 02/02/2016 11:58:52  RTE I Created shared memory of size 32000000 using key 0x784DFB00 and attached to it at address 0x80000000
  2592(  3696) 02/02/2016 11:58:52  RTE I JVM successfully created
  2592(  3696) 02/02/2016 11:58:52 JRTE I Java version: 1.7.0_67
  2592(  3728) 02/02/2016 11:58:53 JRTE I Starting Memory Monitoring thread to check for memory every 15 seconds.
  2592(  3728) 02/02/2016 11:58:53  RTE I Using "utalloc" memory manager, mode [0]
  2592(  3696) 02/02/2016 11:58:56  RTE I Host network address: 10.200.25.77
  2592(  3696) 02/02/2016 11:58:56  RTE E Failure connecting to dbtype [sqlserver], using database 'SM940' user 'sa'
  2592(  3696) 02/02/2016 11:58:56  RTE I Going to sleep for 15 seconds and try again to connect
  3208(  3908) 02/02/2016 11:58:56  RTE I smservice: starting process sm system.start
    88(   916) 02/02/2016 11:58:57  RTE I Using "utalloc" memory manager, mode [0]
    88(   916) 02/02/2016 11:58:57  RTE I Command line: sm system.start
    88(   916) 02/02/2016 11:58:57  RTE I Process sm 9.40.0015 () System: 13080 (0x784DFB00) on PC (x64 64-bit) running Windows (6.2 Build 9200) Timezone GMT+01:00 daylight Locale it_IT from Server
    88(   916) 02/02/2016 11:58:57  RTE I Process attaching to resources with key 0x784DFB00
    88(   916) 02/02/2016 11:58:57  RTE I JVM successfully created
    88(   916) 02/02/2016 11:58:57 JRTE I Java version: 1.7.0_67
    88(  2668) 02/02/2016 11:58:57  RTE I Using "utalloc" memory manager, mode [0]
    88(  2668) 02/02/2016 11:58:57 JRTE I Starting Memory Monitoring thread to check for memory every 15 seconds.
    88(   916) 02/02/2016 11:59:00  RTE I Host network address: 10.200.25.77
    88(   916) 02/02/2016 11:59:01  RTE E Failure connecting to dbtype [sqlserver], using database 'SM940' user 'sa'
    88(   916) 02/02/2016 11:59:01  RTE I Going to sleep for 15 seconds and try again to connect
  3208(  3908) 02/02/2016 11:59:01  RTE I smservice: initialization complete
  2592(  3696) 02/02/2016 11:59:11  RTE E Failure connecting to dbtype [sqlserver], using database 'SM940' user 'sa'
  2592(  3696) 02/02/2016 11:59:11  RTE I Going to sleep for 15 seconds and try again to connect
    88(   916) 02/02/2016 11:59:16  RTE E Failure connecting to dbtype [sqlserver], using database 'SM940' user 'sa'
    88(   916) 02/02/2016 11:59:16  RTE I Going to sleep for 15 seconds and try again to connect
  2592(  3696) 02/02/2016 11:59:26  RTE E Failure connecting to dbtype [sqlserver], using database 'SM940' user 'sa'
  2592(  3696) 02/02/2016 11:59:26  RTE I Going to sleep for 15 seconds and try again to connect
    88(   916) 02/02/2016 11:59:31  RTE E Failure connecting to dbtype [sqlserver], using database 'SM940' user 'sa'
    88(   916) 02/02/2016 11:59:31  RTE I Going to sleep for 15 seconds and try again to connect
  2592(  3696) 02/02/2016 11:59:41  RTE E Failure connecting to dbtype 'sqlserver' database 'SM940' user 'sa'
  2592(  3696) 02/02/2016 11:59:41  RTE E Failure connecting to dbtype [sqlserver], using database 'SM940' user 'sa'
  2592(  3696) 02/02/2016 11:59:41  RTE I Going to sleep for 15 seconds and try again to connect
    88(   916) 02/02/2016 11:59:46  RTE E Failure connecting to dbtype 'sqlserver' database 'SM940' user 'sa'
    88(   916) 02/02/2016 11:59:46  RTE E Failure connecting to dbtype [sqlserver], using database 'SM940' user 'sa'
    88(   916) 02/02/2016 11:59:46  RTE I Going to sleep for 15 seconds and try again to connect
  2592(  3696) 02/02/2016 11:59:56  RTE E Failure connecting to dbtype [sqlserver], using database 'SM940' user 'sa'
  2592(  3696) 02/02/2016 11:59:56  RTE I Going to sleep for 15 seconds and try again to connect
    88(   916) 02/02/2016 12:00:01  RTE E Failure connecting to dbtype [sqlserver], using database 'SM940' user 'sa'
    88(   916) 02/02/2016 12:00:01  RTE I Going to sleep for 15 seconds and try again to connect
  2592(  3696) 02/02/2016 12:00:11  RTE E Failure connecting to dbtype [sqlserver], using database 'SM940' user 'sa'
  2592(  3696) 02/02/2016 12:00:11  RTE I Going to sleep for 15 seconds and try again to connect
    88(   916) 02/02/2016 12:00:16  RTE E Failure connecting to dbtype [sqlserver], using database 'SM940' user 'sa'
    88(   916) 02/02/2016 12:00:16  RTE I Going to sleep for 15 seconds and try again to connect
  2592(  3696) 02/02/2016 12:00:26  RTE E Failure connecting to dbtype 'sqlserver' database 'SM940' user 'sa'
  2592(  3696) 02/02/2016 12:00:26  RTE E Failure opening 'dbdict' file, terminating.
  2592(  3696) 02/02/2016 12:00:26  RTE E Failed to initialize one or all of the core files( dbdict, code, format and link)
  2592(  3696) 02/02/2016 12:00:26  RTE I -Memory : S(241856) O(94700) MAX(357036) - MALLOC's Total(2784)
  2592(  3696) 02/02/2016 12:00:26  RTE I Thread termination in progress
  2592(  3696) 02/02/2016 12:00:26  RTE I Process termination cleanup complete (exit code=0)
    88(   916) 02/02/2016 12:00:31  RTE E Failure connecting to dbtype 'sqlserver' database 'SM940' user 'sa'
    88(   916) 02/02/2016 12:00:31  RTE E Failure opening 'dbdict' file, terminating.
    88(   916) 02/02/2016 12:00:31  RTE E Failed to initialize one or all of the core files( dbdict, code, format and link)
    88(   916) 02/02/2016 12:00:31  RTE I -Memory : S(240608) O(91852) MAX(352940) - MALLOC's Total(1315)
    88(   916) 02/02/2016 12:00:31  RTE I Thread termination in progress
    88(   916) 02/02/2016 12:00:31  RTE I Shutdown of HP Service Manager environment has completed
    88(   916) 02/02/2016 12:00:31  RTE I Process termination cleanup complete (exit code=0)

During configuration it works fine and every time i tested the connection it was able to verify it (i even tried with different users and it always worked). Here's the sm.config file:

 

  3120(  3648) 02/02/2016 11:57:12  RTE I Using "utalloc" memory manager, mode [0]
  3120(  3648) 02/02/2016 11:57:12  RTE I Command line: "C:\Program Files (x86)\HP\Service Manager 9.40\Server\RUN\sm" -encrypt:sqllogin "-log:C:\Program Files (x86)\HP\Service Manager 9.40\Server\smconfig.log"
  3120(  3648) 02/02/2016 11:57:12  RTE I -Memory : S(50320) O(101660) MAX(160172) - MALLOC's Total(59)
  3120(  3648) 02/02/2016 11:57:12  RTE I Thread termination in progress
  3120(  3648) 02/02/2016 11:57:12  RTE E Unable to obtain SYSTEM lock in interm().
  3120(  3648) 02/02/2016 11:57:12  RTE I Process termination cleanup complete (exit code=0)
   108(  3496) 02/02/2016 11:57:14  RTE I Using "utalloc" memory manager, mode [0]
   108(  3496) 02/02/2016 11:57:14  RTE I Command line: "C:\Program Files (x86)\HP\Service Manager 9.40\Server\RUN\sm" -sqlverifyconnection "-log:C:\Program Files (x86)\HP\Service Manager 9.40\Server\smconfig.log"
   108(  3496) 02/02/2016 11:57:14  RTE I Info: SQL State: 01000-5701  Message: [Microsoft][ODBC SQL Server Driver][SQL Server]Changed database context to 'SM940'.
   108(  3496) 02/02/2016 11:57:14  RTE I Info: SQL State: 01000-5703  Message: [Microsoft][ODBC SQL Server Driver][SQL Server]Changed language setting to us_english.
   108(  3496) 02/02/2016 11:57:14  RTE I API=SQLConnect
   108(  3496) 02/02/2016 11:57:14  RTE I Connection established to dbtype 'sqlserver' database 'SM940' user 'sa'
   108(  3496) 02/02/2016 11:57:14  RTE I Connected to Data source 'SM940' SQL server 'Server' version: 11.0.2218 through SQL driver version: 6.3.9600 using database 'SM940' as user 'dbo'
   108(  3496) 02/02/2016 11:57:14  RTE I MS SQL Server collation 'Latin1_General_CI_AS', varchar codepage 1252, comparison 196609: case insensitive, accent sensitive
   108(  3496) 02/02/2016 11:57:14  RTE I Successfully connected to RDBMS server
   108(  3496) 02/02/2016 11:57:14  RTE I -Memory : S(52352) O(107820) MAX(172460) - MALLOC's Total(118)
   108(  3496) 02/02/2016 11:57:14  RTE I Thread termination in progress
   108(  3496) 02/02/2016 11:57:14  RTE E Unable to obtain SYSTEM lock in interm().
   108(  3496) 02/02/2016 11:57:14  RTE I Process termination cleanup complete (exit code=0)

At a point i couldn't think about anything but Windows' and HPSM's locales so i even changed Windows' locale accordingly, but it didn't seem to work (although i only did a quick test here and am therefore not 100% sure about this)

Any ideas? Any help would be much appreciated...

Thanks,

N.-

0 Likes
1 Solution

Accepted Solutions
Nix88 Absent Member.
Absent Member.

Re: HPSM 9.40 - Error while trying to connect to db

Jump to solution

Hi guys,

first off, a big thank you to everyone for all the advices and the time you spent on this, much appreciated.

Now, it seems i have finally been able to fix the issue.

As @Lukus suggested i dug into MSSQL install folder and found the logs, in which i noted a recurring error:

Login failed for user 'NT AUTHORITY\SYSTEM'. Reason: Failed to open the explicitly specified database 'SM940'. [CLIENT: <named pipe>]
2016-02-01 16:29:30.71 Logon       Error: 18456, Severity: 14, State: 38.

I then ran a services.msc which confirmed that HPSM service runs with "local service account" privileges. I therefore started SQL Server Management Studio and went under Security->Logins->NT AUTHORITY\SYSTEM->right-click Properties-> flagged "sysadmin" role under "Server Roles" tab.

Tested, works fine. I even connected successfully with HPSM client.

I have one more question, well it's more a "nice to have": since i edited SYSTEM's permissions at server level (not at HPSM database level), is this "correct"? I mean in terms of granularity of permissions and security, i'd like to know if what i did respects the least minimum privilege principle for the application or if there is a better way to do it.

 

Thanks again!

0 Likes
12 Replies
Established Member.. A.Sol
Established Member..

Re: HPSM 9.40 - Error while trying to connect to db

Jump to solution

Hi,

First of all check your Database version is support or not in the compatibility matrix of HPSM 9.40.

second thing:

we can also witness error as :

" The shared memory size 32000000 is less than the recommended size 134217728"

and this means You might need to increase your shared memory in your sm.ini file

 

Also kindly validate that your ODBC settings is working fine and tests successfully to the back end database.

 

Also you might need to change the staring memory allocation address in your sm.ini, but lets validate the above first then we can take this in a later step.

 

 

Hope this helps

 

Regards

A.Sol

 

 

Nix88 Absent Member.
Absent Member.

Re: HPSM 9.40 - Error while trying to connect to db

Jump to solution

Hi A.Sol,

thank you very much for your reply.

I stopped the service and re-checked the settings and the connections, all verifications went OK (odbc test and HPSM test connection via the config file). I also changed the shared mem size in the sm.ini, then restarted the service, but got the very same output as before...i really don't have a clue: when testing the connection it says it's ok, but when launching the service it doesn't work. I also disabled Windows Firewall but unfortunately it didn't help...

N.-

0 Likes
MahendraHPSM
New Member.

Re: HPSM 9.40 - Error while trying to connect to db

Jump to solution

2592(  3696) 02/02/2016 11:58:56  RTE E Failure connecting to dbtype [sqlserver], using database 'SM940' user 'sa'

 

Try to give a user id with 5 plus characters and password with alphanumeric and update ini file accordingly with new id and password.

Established Member.. A.Sol
Established Member..

Re: HPSM 9.40 - Error while trying to connect to db

Jump to solution

Can you please share us here your sm.ini and sm.cfg files

Your OS is 46 bit or 32 bit ?

also send a print screen from your used ODBC [system DSN ] Tab connections? it should be like the sample attached.

Awiting your reply

 

Regards,

A.Sol

0 Likes
Nix88 Absent Member.
Absent Member.

Re: HPSM 9.40 - Error while trying to connect to db

Jump to solution
Spoiler
Thanks boys for the advices, here are the outputs:

@MahendraHPSM
- stopped the service, tried to rename an existing user in SQL Server from "test" to "test123" in order to have more than 5 chars, and also changed its password an made it only of letters and numbers. Test connection worked as you wil see from the attachment, but service connection still does not work.

@A.Sol
OS is Windows Server 2012 R2 Std which is only available in 64bit version, 8GB RAM;
ODBC connection is like the one you posted

I attached the files and the screen in the zip for your convenience.

Thanks again for your assistance guys,
N
0 Likes
Established Member.. A.Sol
Established Member..

Re: HPSM 9.40 - Error while trying to connect to db

Jump to solution

All things are normal in the files and ODBC.

Till this what found below "

3880( 1504) 02/02/2016 14:42:37 RTE I Info: SQL State: 01000-5703 Message: [Microsoft][ODBC SQL Server Driver][SQL Server]Changed language setting to us_english.
3880( 1504) 02/02/2016 14:42:37 RTE I API=SQLConnect
3880( 1504) 02/02/2016 14:42:37 RTE I Connection established to dbtype 'sqlserver' database 'SM940' user 'test123'
3880( 1504) 02/02/2016 14:42:37 RTE I Connected to Data source 'SM940' SQL server 'Server' version: 11.0.2218 through SQL driver version: 6.3.9600 using database 'SM940' as user 'dbo'
3880( 1504) 02/02/2016 14:42:37 RTE I MS SQL Server collation 'Latin1_General_CI_AS', varchar codepage 1252, comparison 196609: case insensitive, accent sensitive
3880( 1504) 02/02/2016 14:42:37 RTE I Successfully connected to RDBMS server 

.........................

"

All seems good and database connected successfully , 

But due to some unforeseen reasons we got the following error

"Unable to obtain SYSTEM lock in interm()."

and for that we got disconnect from the database ! might be this is something related to the database connection configurations ! i came across the same articles below might they be useful to you.

the one below advise to run all things as administrator.

http://community.hpe.com/t5/HPE-Service-Manager-Service/HPSM-9-3-Configuration-Error/td-p/6060029

make sure the logged in user is able to access the installation folders, just grant him full access to the installation folders, also right click the windows client icon and run it as administrator.

 

Also in case you have multiple network cards on you sm server you may try adding in the sm.ini the paramter >> groupbindaddress:<your SM server used ip address> refer to that parameter in the sm help files for further details.

 

one last thing here make sure you have a valid license file and make sure that during the dataload wizard you got a successful output like what follows as example

 

Starting Upload process....
Application & Sample data upload to the configured data failed
Please check if the database is empty and the SQL user has rights to create tables,
check smconfig.log for additional detail
Invoking shutipc...
Shutipc completed successfully.
License verification passed.
---------------------------------

 

 

 

Hope this finds you well.

 

 

Regards,

A.Sol

 

0 Likes
Nix88 Absent Member.
Absent Member.

Re: HPSM 9.40 - Error while trying to connect to db

Jump to solution

Thanks @A.Sol,

yes i noticed that error about the system lock too but didn't give it that much of weight honestly...

I ran into the thread you linked above and already tried what they mentioned (run as admin, check permissions...) but that row still appears in the smconfig.log file. I also tried to apply the preferred shared mem address as follows into the sm.ini but didn't help:

shared_memory:134217728
shared_memory_address:0x80000000

As per the license, the cfg file outputs exactly what you posted above, i also ran a sm -reportlic and everything is fine.

Really dunno what's wrong with it...

 

0 Likes
Micro Focus Expert
Micro Focus Expert

Re: HPSM 9.40 - Error while trying to connect to db

Jump to solution

If you run sm -sqlverifyconnection from the RUN command line it works, if I follow correctly.

All of the failures appear to be when you start SM as a service.

You could do this quick test.  Copy sm.cfg to a backup.   Change sm.cfg so that it only has

sm -sqlverifyconnection

Then start the SM service and it will run only that command.  If that fails and the same command works from the command line it must be a permissions issue. 

 

 

0 Likes
Established Member.. Lukus
Established Member..

Re: HPSM 9.40 - Error while trying to connect to db

Jump to solution

Hey Nixx88, out of interest, what does the database errorlog show when you're attempting?

You can normally find it at a path like:
[SQL install directory]\MSSQL...[databasename]\MSSQL\Log\ERRORLOG

it will tell you if the database is rejecting the connection for some reason. If you're not getting there may be check the account details in your syswow64\odbcad32.exe driver, or the account that you're running the service as.

0 Likes
Nix88 Absent Member.
Absent Member.

Re: HPSM 9.40 - Error while trying to connect to db

Jump to solution

Hi guys,

first off, a big thank you to everyone for all the advices and the time you spent on this, much appreciated.

Now, it seems i have finally been able to fix the issue.

As @Lukus suggested i dug into MSSQL install folder and found the logs, in which i noted a recurring error:

Login failed for user 'NT AUTHORITY\SYSTEM'. Reason: Failed to open the explicitly specified database 'SM940'. [CLIENT: <named pipe>]
2016-02-01 16:29:30.71 Logon       Error: 18456, Severity: 14, State: 38.

I then ran a services.msc which confirmed that HPSM service runs with "local service account" privileges. I therefore started SQL Server Management Studio and went under Security->Logins->NT AUTHORITY\SYSTEM->right-click Properties-> flagged "sysadmin" role under "Server Roles" tab.

Tested, works fine. I even connected successfully with HPSM client.

I have one more question, well it's more a "nice to have": since i edited SYSTEM's permissions at server level (not at HPSM database level), is this "correct"? I mean in terms of granularity of permissions and security, i'd like to know if what i did respects the least minimum privilege principle for the application or if there is a better way to do it.

 

Thanks again!

0 Likes
Established Member.. Lukus
Established Member..

Re: HPSM 9.40 - Error while trying to connect to db

Jump to solution

Hi Nix88, I'm glad to hear you got it working.

As for your question, normally i would have a Service Account set up in AD specifically for this. This "service account" could then be given permission only to run SM on the server. Then of course you could also add that user to the SM - SQL database and use that account for the ODBC driver.

This can add a bit more configuration and ability to lock down the permissions.

 

 

0 Likes
Nix88 Absent Member.
Absent Member.

Re: HPSM 9.40 - Error while trying to connect to db

Jump to solution

Perfect, thank you very much for the hints Lukus!

N.-

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.