Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crashes on Windows 7 64-bit if a bad connection string is given #21

Closed
qntm opened this issue Nov 21, 2014 · 13 comments
Closed

Crashes on Windows 7 64-bit if a bad connection string is given #21

qntm opened this issue Nov 21, 2014 · 13 comments

Comments

@qntm
Copy link

qntm commented Nov 21, 2014

On Windows 7 64-bit, using the pre-built binaries, if I use a correct connection string such as

DRIVER={DB2};DATABASE=MBRECORD;HOSTNAME=localhost;PORT=50000;PROTOCOL=TCPIP;UID=username;PWD=password

then ibm_db behaves as normally. If I alter the connection string so that the target hostname and port is not a DB2 database, for example

DRIVER={DB2};DATABASE=MBRECORD;HOSTNAME=localhost;PORT=49999;PROTOCOL=TCPIP;UID=username;PWD=password

then Node.js crashes when ibm_db.open(dsnString, function(err, conn) { ... }) is called:

stop

This should never happen, ibm_db should fail gracefully with a useful error message no matter what.

@avikalar
Copy link
Contributor

Hey Ferno,

Did you download the pre built binary from the intermediate_fixes branch ? If not please download the latest binary from the same branch which you can find inside the build.zip file. We have fixed this issue already in the latest binary.

@s100
Copy link

s100 commented Nov 24, 2014

Are you referring to this file: https://github.com/ibmdb/node-ibm_db/blob/intermediate_fixes/build.zip ? If so, what am I supposed to do with it? This is not a Node.js package, so unzipping it to my node_modules directory doesn't work, unlike https://www.ibm.com/developerworks/community/blogs/pd/resource/ibm_db_x64.zip which I was using before.

@avikalar
Copy link
Contributor

Yes, I am referring to the same file (https://github.com/ibmdb/node-ibm_db/blob/intermediate_fixes/build.zip). You can download the entire intermediate_fixes branch and then extract the build.zip into the same folder as the zip file. Replace the ibm_db under your node_modules with the whole intermediate_fixes branch you have downloaded.

@s100
Copy link

s100 commented Nov 25, 2014

Ah, I am progressing further now. Thank you. Now I see this error on connection:

[IBM][CLI Driver] SQL30081N A communication error has been detected. Communication protocol being used: "SSL". Communication API being used: "SOCKETS". Location where the error was detected: "SOCKETS". Communication function detecting the error: "sqlcctcpconnr". Protocol specific error code(s): "202", "", "". SQLSTATE=08001

My connection string (sanitised) is:

DRIVER={IBM DB2 ODBC DRIVER};DATABASE=BLUDB;HOSTNAME=********;PORT=********;PROTOCOL=TCPIP;UID=********;PWD=********;Security=ssl;SSLClientKeystoredb=dashdb.kdb;SSLClientKeystash=dashdb.sth

This is a strange error to get because SQLSTATE 08001 indicates a communications error and the code 202 indicates an error inside GSKit:

202 - GSK_KEYRING_OPEN_ERROR Unable to open the key file or the Microsoft Certificate Store. Either the path was specified incorrectly or the file permissions did not allow the file to be opened, or the file format is incorrect.

but I am not using a key file, I am using a key database. Does ibm_db support this form of connection or should I use a key file instead?

@mariobriggs
Copy link
Contributor

It should work ( i assume you have installed the DB2 Runtime client or installed GSKIT... DS Driver does not ship with the GSKit as of today).

SSLClientKeystoredb=dashdb.kdb;SSLClientKeystash=dashdb.sth
<<

Should those filenames include the fullpath/relative path from current directory in which the process is running ?

I can try to repro locally if the above doesnt solve

@s100
Copy link

s100 commented Nov 26, 2014

Those filenames do include the relative path. In this example, the key database and stash file are both in the same directory as the Node.js application.

@avikalar
Copy link
Contributor

Hey,
When I tried to repro your issue using DB2 CLI 10.5 FP4 and gskit version 8.0.14.43, it worked for me. Can you tell me which version of DB2 are you working on ?

@s100
Copy link

s100 commented Dec 2, 2014

I have found that when I use a slightly modified connection string,

DRIVER={IBM DB2 ODBC DRIVER};DATABASE=BLUDB;HOSTNAME=********;PORT=********;PROTOCOL=TCPIP;UID=********;PWD=********;Security=ssl;SSL_Client_Keystoredb=dashdb.kdb;SSL_Client_Keystash=dashdb.sth

, I am able to connect with no problems. Notice how I replaced SSLClientKeystoredb with SSL_Client_Keystoredb and SSLClientKeystash with SSL_Client_Keystash. It looks like the connection string I was given had missing underscores. (Perhaps some Markdown implementation stripped them out and made the word "Client" italicised instead?)

@s100
Copy link

s100 commented Dec 2, 2014

The target DB2 server is v10.5.0, fix pack 4.

@s100
Copy link

s100 commented Dec 2, 2014

From the documentation it seems that these two keywords both changed at some point in the past.

@mariobriggs
Copy link
Contributor

good to know u are unblocked. What about the DB2 client version (also which client are u using for e.g. Data Server Driver package, runtime client etc), since it is the client that is processing those 'SSLClientKeyxxx' arguments

@s100
Copy link

s100 commented Dec 3, 2014

According to the Readme file in my "IBM DATA SERVER DRIVER" directory, V9.7.6.

@mariobriggs
Copy link
Contributor

ok. Any particular reason you are using a v9.7.6 client with a v10.5.4 server? Would suggest using the latest client too and treat this closed

Will pass on to CLI team that without '_' in the keyword, doesnt work in 9.7.6, though doc claim it should, starting that version :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants