Skip to content

Error: NJS-500: connection to the Oracle Database was broken #1616

@yakov-rs

Description

@yakov-rs
  1. What versions are you using?

"oracledb": "^6.2.0"

Oracle XE 18

  1. Is it an error or a hang or a crash?
    crash

  2. What error(s) or behavior you are seeing?

ORA-00600: internal error code, arguments: [kodpunp1], [600], [], [], [], [], [], [], [], [], [], []
ORA-00600: internal error code, arguments: [kopp2ucoll233], [], [], [], [], [], [], [], [], [], [], []
Help: https://docs.oracle.com/error-help/db/ora-00600/
    at Protocol._processMessage (node_modules\oracledb\lib\thin\protocol\protocol.js:172:17)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async ThinConnectionImpl._execute (node_modules\oracledb\lib\thin\connection.js:189:7)
    at async ThinConnectionImpl.execute (node_modules\oracledb\lib\thin\connection.js:927:14)
    at async Connection.execute (node_modules\oracledb\lib\connection.js:861:16)
    at async Connection.<anonymous> (node_modules\oracledb\lib\util.js:165:14)
    at async executePLSQL (index.js:13:3) {
  offset: 0,
  errorNum: 600,
  code: 'NJS-500'
}
  1. Include a runnable Node.js script that shows the problem.

oracle scripts

create table test_insert_string(id number(19),str varchar2(256 char));

create or replace type test_insert_rec is object (
  id   number(19),
  str1 varchar2(256 char),
  str2 varchar2(256 char),
  str3 varchar2(256 char),
  str4 varchar2(256 char)
);

create or replace type test_insert_tab is table of test_insert_rec;

create or replace procedure saveString(p_strings test_insert_tab)
as
begin
  insert into test_insert_string(id, str)
  select
    id,
    str1
  from
    table(p_strings);
end;

node js

const oracledb = require('oracledb');

async function executePLSQL() {
	let connection;

	try {
		connection = await oracledb.getConnection({
			user: "user",
			password: 'password',
			connectString: "connect string"
		});

		await connection.execute(`begin saveString(:p_strings); end;`,
			{
				p_strings: {
					dir: oracledb.BIND_IN,
					val: [1,2,3,4,5,6].map(() => ({
						ID: 1,
						STR1: JSON.stringify({
							message_id: 11111111111111,
							from: {
								id: 22222222,
								bool: false,
								text1: "aaaaaa",
								text23:"qqqqqq1"
							},
							chat: {data: '1sa12wug12iwt1i2et1i2egi12uegi12u3ti123t'},
							date: 1697533373,
							text: '11111111111111111111111111111111111111111111111111'
						})
					})),
					type: `TEST_INSERT_TAB`
				}
			},
			{
				autoCommit: true
			});

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

executePLSQL();

works fine if:

create or replace type test_insert_rec is object (
  id   number(19),
  str1 varchar2(256 char),
  str2 varchar2(256 char),
  str3 varchar2(256 char)
);

or

text23:"qqqqqq" // shorten by 1 symbol

or

"oracledb": "^5.5.0"

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