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

Compatibility Issue with node-oracledb Library #30528

Open
merveodabasi opened this issue Nov 4, 2024 · 1 comment
Open

Compatibility Issue with node-oracledb Library #30528

merveodabasi opened this issue Nov 4, 2024 · 1 comment
Labels
stage: needs information Not enough info to reproduce the issue

Comments

@merveodabasi
Copy link

merveodabasi commented Nov 4, 2024

Current behavior

When we run our tests, we encounter the following error message from thenode-oracledb library:

NJS-069: node-oracledb 6.6.0 requires Node.js 14.6 or later.

Cypress reports this error as originating from our test code, causing our tests to automatically fail.

System Details
 
• Node.js Version: 20.17.0, then upgraded to v22.11.0.
 
node -v v20.17.0
npm -v 10.8.2
• oracledb Library Version: 6.6.0

Solutions We Have Tried

  1. Node.js Version Update: We upgraded Node.js using nvm, first to 20.17.0 and then to v22.11.0, but the issue persisted.
  2. Reinstalling the Library: We uninstalled and reinstalled oracledb (using npm uninstall oracledb and npm install oracledb), but no changes were observed.
  3. Project Cleanup: We deleted the node_modules folder and package-lock.jsonfile, then reinstalled the project dependencies with npm install.
  4. Environmental Variables Check: We confirmed that environment variables like ORACLE_HOME and LD_LIBRARY_PATH are properly set.

Desired behavior

We expect tests verifying Oracle database connections to work smoothly with the node-oracledb library in Cypress. Ideally, the tests should validate database connections successfully without any compatibility errors and proceed as expected.

Test code to reproduce

const oracledb = require('oracledb');

// Veritabanı bağlantısını oluşturma
async function createPool() {
  try {
    await oracledb.createPool({
      user: 'AAAA,
      password: 'AAAA',
      connectString: '10.10.10.10:1010/AAA'
    });
    console.log('Successfully connected to Oracle Database!');
  } catch (err) {
    console.error('Error connecting to Oracle Database:', err);
    throw err;
  }
}

// Sorgu çalıştırma fonksiyonu
async function runQuery(query) {
  let connection;
  try {
    connection = await oracledb.getConnection();
    const result = await connection.execute(query);
    await connection.commit();
    return result;
  } catch (err) {
    console.error('Query error:', err);
    throw err;
  } finally {
    if (connection) {
      try {
        await connection.close();
      } catch (err) {
        console.error('Error closing connection:', err);
      }
    }
  }
}

// Sorguları çalıştır
async function init() {
  try {
    await createPool();
    // İlk sorgu
    await runQuery("DELETE FROM error_message_content WHERE ERROR_MESSAGE IN (SELECT id FROM ERROR_MESSAGE WHERE key='otomasyonAnahtar')");
    // İkinci sorgu
    await runQuery("DELETE FROM ERROR_MESSAGE WHERE key='otomasyonAnahtar'");
  } catch (err) {
    console.error('Failed to execute delete queries:', err);
  }
}

// Bağlantı havuzunu kapatma
async function closePool() {
  await oracledb.getPool().close(0);
}

module.exports = { runQuery, init, closePool };

Cypress Version

13.15.1

Node version

v20.17.0

Operating System

macOS 14.7

Debug Logs

No response

Other

No response

@jennifer-shehane
Copy link
Member

@merveodabasi Are you requiring this file in your tests? Do you see this error outside of Cypress? I'm not understanding how this code is related to Cypress tests.

@jennifer-shehane jennifer-shehane added the stage: needs information Not enough info to reproduce the issue label Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stage: needs information Not enough info to reproduce the issue
Projects
None yet
Development

No branches or pull requests

2 participants