oracle / node-oracledb

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

CQN is not working with - Error ORA-24912: Listener thread failed. Failed to get IP address of host #1496

Closed asadbsse closed 2 years ago

asadbsse commented 2 years ago

Versions: Database version: 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production platform: 'linux' version: 'v16.13.1' arch : 'x64' versionString: 5.3.0 oracleClientVersionString :19.10.0.0.0

[Error ORA-24912: Listener thread failed. Failed to get IP address of host]

let oracledb=require('oracledb');
let dbConfig={
    user          : "xxx",
    password      : "xxx",
    connectString : "192.168.1.102:1521/xxxx",
    events        : true
};

const options = {
    sql      : `SELECT * FROM CUSTOMERCLASSES`, 
    callback : myCallback                
};

function myCallback(message) {
    console.log(JOSN.stringify(message));
}

async function runTest() {
    let connection;

    try {
        connection = await oracledb.getConnection(dbConfig);

        await connection.subscribe('mysub', options);

        console.log("Subscription created...");

    } catch (err) {
        console.error(err);
    } finally {
        if (connection) {
            try {
                await connection.close();
            } catch (err) {
                console.error(err);
            }
        }
    }
}

runTest();
cjbj commented 2 years ago

You will need to make sure the DB can connect back to the Node.js machine. Ports needs to be open etc.

asadbsse commented 2 years ago

You will need to make sure the DB can connect back to the Node.js machine. Ports needs to be open etc.

@cjbj I have checked port is open and I can telnet from DB machine to Node.js process

asadbsse commented 2 years ago

@cjbj Tested this on different linux(centos 7/8) machines (with different versions of node/oracledb/instant client ) and its not working throwing the same error but I tested this on windows machines and its working perfectly fine.

cjbj commented 2 years ago

If it's working on one machine, then the issue on the others is going to be your network configuration.

Have you tried setting the options ipAddress and port? Can you check with Oracle Support for docs on CQN?

Is there any chance you can upgrade the DB to a recent 19c release, and then use the clientInitiated option? There are only a few months left of the final, final, final DB support for 11.2, see https://support.oracle.com/epmos/faces/DocumentDisplay?id=742060.1

stale[bot] commented 2 years ago

This issue has been automatically marked as inactive because it has not been updated recently. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 2 years ago

This issue has been automatically closed because it has not been updated for a month.