Getting SQL1042C ... SQL STATE=580004 when connecting to the database

370 views
Skip to first unread message

J Lanham

unread,
Nov 29, 2016, 12:35:58 PM11/29/16
to node-ibm_db
When we try to connect to our Informix database, we are getting the following error:

[IBM][CLI Driver] SQL1042C  An unexpected system error occurred.  SQLSTATE=58004

According to our DBAs, the logs show that we are missing IBM Global Security Kit (GSKit) version 7.0.4.27 or higher.  Is this coming from the ibm_db module or the odbc driver?  (i.e. is it something that can be changed in the module so that the kit doesn't have to be added to the database?)

Thanks
 

bimaljha

unread,
Nov 29, 2016, 12:41:55 PM11/29/16
to node-ibm_db
Yes, this issue is related to GSKit. Seems your system has old version of GSKit installed. This error is coming from odbc driver. You can fix it by setting the environment  variable LIB on Windows/ LIBPATH on AIX/LD_LIBRARY_PATH on Linux / DYLD_LIBRARY_PATH on Mac to ibm_db/installer/clidriver/bin/icc64 on Windows or ibm_db/installer/clidriver/lib/icc on other platforms. Thanks.

J Lanham

unread,
Dec 2, 2016, 12:02:41 PM12/2/16
to node-ibm_db
I have tried as you recommended, but I am still getting the same error.  Is there anything you can think of that I can try to resolve this issue locally.  I can see the dynamic libraries for the gskit in the path specified.  And I have verified the correct path is in the environment variable and can be seen when I echo the path name.  I'm just not sure why that is not satisfying the database connection request. 

Thanks again for your help,
Jennifer

bimaljha

unread,
Dec 2, 2016, 1:21:23 PM12/2/16
to node-ibm_db

Please set below environment variables and run commands to test. Run these commands on command prompt or you can set it in systems environment variable:

set IBM_DB_HOME=path_to_ibm_db\installer\clidriver
set PATH=path_to_ibm_db\installer\clidriver\bin;path_to_ibm_db\installer\clidriver\lib;%PATH%
set LIB=path_to_ibm_db\installer\clidriver\lib;path_to_ibm_db\installer\clidriver\bin\icc64;%LIB%
db2trc on -f 1.trc
db2cli validate -database "sample:hotel.torolab.ibm.com:21169" -connect -user newton -passwd serverpass
db2trc off
db2trc flw 1.trc 1.flw
db2trc fmt 1.trc 1.fmt
db2trc fmt -cli 1.trc 1.cli

Update the connection information in above db2cli validate command before running it. Share the generated 1.flw, 1.fmt and 1.cli files to check for root cause of the issue. Thanks.

J Lanham

unread,
Dec 4, 2016, 2:21:42 PM12/4/16
to node-ibm_db
Thank you for the suggestion.  I am not able to upload the files due to company security policies.  Is there something in particular that you would be looking for?  I can see in the 1.fmt file where it appears to have loaded the dynamic libraries successfully (cryptDynamicLoadGSKitCrypto ... GSKit SSL have been loaded by short name).  Also, I see the following response from the database server which is the error that we were reporting so this may not help much. 

Data1 (PD_DB2_TYPE_SQLCA,136) SQLCA:
 sqlcaid : SQLCA     sqlcabc: 136   sqlcode: -1042   sqlerrml: 3
 sqlerrmc: 205
 sqlerrp : SQLEXSLC
 sqlerrd : (1) 0x875C00CD      (2) 0x000000CD      (3) 0x00000000
           (4) 0x00000000      (5) 0x00000000      (6) 0x00000000
 sqlwarn : (1)      (2)      (3)      (4)        (5)       (6)    
           (7)      (8)      (9)      (10)        (11)     
 sqlstate: 58004

I wish I could provide more information.  I could use the help.  Is there anything else I can look for in the files that you can think of that might point to my issue?

Thanks so much for your time!

bimaljha

unread,
Dec 15, 2016, 5:24:46 AM12/15/16
to node-ibm_db
Can you paste all logs from 1.fmt file related to 2 functions cryptDynamicLoadGSKitCrypto and OSSHLibrary::load?
It will help me to identify the root cause. You can also copy them in a file and paste the contents here. There should not be much trace.
Also, if you want look into those traces and try to identify the first log which reported error. OSSHLibrary::load function will tell library loading failed or not.
Thanks.

Ken Dudley

unread,
Jun 27, 2017, 11:50:58 AM6/27/17
to node-ibm_db
I was wondering if you ever found out what the issue was because we are facing the exact same issue.

bimaljha

unread,
Jun 27, 2017, 11:54:00 AM6/27/17
to node-ibm_db
We have provided solution for SQL1042C error in many issues opened on github: https://github.com/ibmdb/node-ibm_db/issues?utf8=✓&q=SQL1042C%20
Please go through the solutions discussed in these issues. If none work for you, then open a new issue with all the info. Thanks.
Reply all
Reply to author
Forward
0 new messages