oracle / node-oracledb

Oracle Database driver for Node.js maintained by Oracle Corp.
http://oracle.github.io/node-oracledb/
Other
2.24k stars 1.07k forks source link

NJS-116: password verifier type 0x939 is not supported by node-oracledb in Thin mode #1584

Closed venkateshkolisetty-ctl closed 1 year ago

venkateshkolisetty-ctl commented 1 year ago
  1. What versions are you using?

Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

process.platform: win32 process.version: v18.16.0 process.arch: x64 require('oracledb').versionString: 6.0.2 require('oracledb').oracleClientVersionString:

Uncaught:
Error: NJS-089: getting the Oracle Client version is not supported by node-oracledb in Thin mode
    at throwErr (~\node_modules\oracledb\lib\errors.js:591:10)
    at Object.throwNotImplemented (~\node_modules\oracledb\lib\errors.js:600:3)
    at get oracleClientVersionString [as oracleClientVersionString] (~\node_modules\oracledb\lib\oracledb.js:1064:14) {
  code: 'NJS-089'
  1. Is it an error or a hang or a crash?

Error

  1. What error(s) or behavior you are seeing?
Process exited with code 1
Uncaught Error Error: NJS-116: password verifier type 0x939 is not supported by node-oracledb in Thin mode
    at throwErr (~\node_modules\oracledb\lib\errors.js:591:10)
    at encode (~\node_modules\oracledb\lib\thin\protocol\messages\auth.js:208:20)
    at _encodeMessage (~\node_modules\oracledb\lib\thin\protocol\protocol.js:105:20)
    at _processMessage (~\node_modules\oracledb\lib\thin\protocol\protocol.js:146:18)
    at connect (~\node_modules\oracledb\lib\thin\connection.js:547:28)
    at processTicksAndRejections (internal/process/task_queues:95:5)
  1. Include a runnable Node.js script that shows the problem.
import * as oracledb from 'oracledb';
oracledb.createPool({
                user: 'username'
                , password: 'password'
                , connectString: 'host:port/sid'
            }).then((pool) => {
                resolve(pool);
            }).catch((err) => {
                reject(err);
            });
cjbj commented 1 year ago

The first one, NJS-089 is obvious: don't call that function in Thin mode. Remove the call, or change to Thick mode.

The second one, NJS-116, is answered in https://stackoverflow.com/a/76436179/4799035

venkateshkolisetty-ctl commented 1 year ago

I am trying to connect to Oracle 12.2.0.1.0 and the verified that the parameter sec_case_sensitive_logon is set to true. Even though the configuration is supported by the Thin mode, I am getting error.

cjbj commented 1 year ago

Regenerate your password as per the steps on SO.

venkateshkolisetty-ctl commented 1 year ago

I tried regenerating the password but I am getting same error. I also tried connecting to 3 different databases having same configuration and I see same error.

sosoba commented 1 year ago

Try to run a fresh database via docker compose:

services:
  XEPDB1:
    image:  container-registry.oracle.com/database/express:21.3.0-xe
    ports:
      - '1521:1521'
    environment:
      ORACLE_PWD: 'oracle'

and connect as:

await oracledb.getConnection({
  user: 'PDBADMIN',
  password: 'oracle',
  connectString:'localhost/XEPDB1',
});
sharadraju commented 1 year ago

Hi @venkateshkolisetty-ctl, It seems that the username used to connect to Oracle Database is using a less secure 10G password verifier for some reason. Can you run the following query and see if your username is listed in the result:

SELECT USERNAME FROM DBA_USERS WHERE ( PASSWORD_VERSIONS = '10G 'OR PASSWORD_VERSIONS = '10G HTTP ')
AND USERNAME <> 'ANONYMOUS';

You might want to check the following documentation to upgrade your password verifier in Oracle Database - Resetting Oracle Database password verifiers.

venkateshkolisetty-ctl commented 1 year ago

@sharadraju , my username IS LISTED in the result. What is the supported version for the Thin mode to work?

sharadraju commented 1 year ago

Node-oracledb's Thin mode supports 11G and higher password verifiers, which are more secure. To reset your password verifier to use more secure versions in your Oracle Database, please follow the steps listed here - Resetting Oracle Database password verifiers.

venkateshkolisetty-ctl commented 1 year ago

Thank you

emonsalves commented 10 months ago

Hellou how resolve this i have the same problem

diegomansua commented 10 months ago

@sharadraju Hello, I'm getting the same error Error: NJS-116: password verifier type 0x939 is not supported by node-oracledb in Thin mode and:

I would've thought that having 11G and 12C on top of 10G would make it possible to connect, but it doesn't seem to be the case. Is it that password_versions should not have 10G at all?

Thank you.

sharadraju commented 10 months ago

@diegomansua Yes, the password_versions should not have 10G for the users as it is less secure and will be the default password verifier. As indicated in this link - Resetting Oracle Database password verifiers, the recommendation is to remove 10G from password-versions completely.

emonsalves commented 10 months ago

thx a lot! i can fix it!