I’m using GridDB 5.7 with Node.js 16 on WSL2 Ubuntu 22.04. I can successfully connect to the GridDB node, but when I create a container and try to insert a row, I get a segmentation fault:
My code test.js:
const griddb = require('griddb-node-api');
async function main() {
try {
const factory = griddb.StoreFactory.getInstance();
const store = factory.getStore({
host: '127.0.0.1',
port: 10001,
clusterName: 'defaultCluster',
username: 'admin',
password: 'admin'
});
console.log('Connected to GridDB node!');
const containerInfo = {
name: 'sample_container',
columnInfoList: [
{ name: 'id', type: griddb.Type.INTEGER },
{ name: 'name', type: griddb.Type.STRING }
],
rowKey: true
};
let container = await store.putContainer(containerInfo);
const row = [1, 'Ayman'];
await container.put(row);
console.log('Row inserted:', row);
} catch (err) {
console.error('Error:', err);
}
}
main();
Output:
Connected to GridDB node!
Segmentation fault (core dumped)
What I have tried:
Verified the connection works.
Tried changing rowKey to 'id'.
Checked container schema matches the inserted row.
Ensured GridDB node is running and accessible.
What I to know: Why does this code cause a segmentation fault after connecting to GridDB? How can I safely insert a row without crashing Node.js?
Environment:
- WSL2 Ubuntu 22.04
- Node.js: 16.x
- GridDB 5.7
- griddb-node-api