Skip to content

Exception thrown from thin mode connection finalizer #1749

@sharadraju

Description

@sharadraju

Discussed in #1748

Originally posted by gcowan-ot August 9, 2025
I'm seeing an issue with version 6.8+ when a thin mode connection attempt fails. When the subsequent finalizer runs, an exception is thrown. My service implementation will try connecting with thick mode when the connection fails. The thick mode connection is successful but the service is left in an potentially unstable state due to the thin mode connection finalizer exception. Has anyone else seen this?

finalizer from connection.js
const finalizationRegistry = new global.FinalizationRegistry((heldValue) => {
heldValue.disconnect();
});

exception that is thrown...

C:\iv\oracle-connect\node_modules\oracledb\lib\thin\sqlnet\networkSession.js:640
if (type != constants.NSFIMM && !this.ntAdapter.err) {
^

TypeError: Cannot read properties of null (reading 'err')
at NetworkSession.disconnect (C:\iv\oracle-connect\node_modules\oracledb\lib\thin\sqlnet\networkSession.js:640:53)
at C:\iv\oracle-connect\node_modules\oracledb\lib\thin\connection.js:47:13
at FinalizationRegistry.cleanupSome ()

reason for connection failure

Error: NJS-533: Advanced Networking Option service negotiation failed. Native Network Encryption and DataIntegrity only supported in node-oracledb thick mode.
Cause: ORA-12660
Help: https://docs.oracle.com/error-help/db/ora-12660
at Object.throwErrWithORAError (C:\iv\oracle-connect\node_modules\oracledb\lib\errors.js:746:17)
at ANO.processPacket (C:\iv\oracle-connect\node_modules\oracledb\lib\thin\sqlnet\ANO.js:419:16)
at NetworkSession.connect2 (C:\iv\oracle-connect\node_modules\oracledb\lib\thin\sqlnet\networkSession.js:316:17)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async NetworkSession.connect1 (C:\iv\oracle-connect\node_modules\oracledb\lib\thin\sqlnet\networkSession.js:336:23)
at async NetworkSession.connect (C:\iv\oracle-connect\node_modules\oracledb\lib\thin\sqlnet\networkSession.js:617:5)
at async ThinConnectionImpl.connect (C:\iv\oracle-connect\node_modules\oracledb\lib\thin\connection.js:778:5)
at async Object.getConnection (C:\iv\oracle-connect\node_modules\oracledb\lib\oracledb.js:771:3)
at async Object.getConnection (C:\iv\oracle-connect\node_modules\oracledb\lib\util.js:271:16)
at async tryOracleConnect (C:\iv\oracle-connect\src\oc.js:12:18) {
code: 'NJS-533'
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions