You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
nodejs 14.18.1
psql (PostgreSQL) 10.1 (also on 13.1)
pg 8.7.1
After that, when any type error happening on callback function, the following error occurring infinitely :
TypeError: Cannot read property 'name' of null
at Client._handleParseComplete (/Users/amr/workspace/node_modules/pg/lib/client.js:367:26)
at Connection.emit (events.js:314:20)
at /Users/amr/workspace/node_modules/pg/lib/connection.js:114:12
at Parser.parse (/Users/amr/workspace/node_modules/pg-protocol/dist/parser.js:40:17)
at Socket. (/Users/amr/workspace/node_modules/pg-protocol/dist/index.js:11:42)
at Socket.emit (events.js:314:20)
at addChunk (_stream_readable.js:297:12)
at readableAddChunk (_stream_readable.js:272:9)
at Socket.Readable.push (_stream_readable.js:213:10)
at TCP.onStreamRead (internal/stream_base_commons.js:188:23)
Before the update, our code had been working properly for several years.
Sample of code that raises the error:
var pg = require('pg');
let newPool = function() {
@juanrmn I suspect #2836 might fix many of these similar-looking bugs. Difficulty reproducing is a common theme, so if you feel like testing the patch in prod that would be helpful 😉 OTOH the PR might give you clues to help reproduce if you're motivated.
Hi.
We have updated our set up from
nodejs 12.16.1
psql (PostgreSQL) 10.1
pg 7.11.0
to:
nodejs 14.18.1
psql (PostgreSQL) 10.1 (also on 13.1)
pg 8.7.1
After that, when any type error happening on callback function, the following error occurring infinitely :
TypeError: Cannot read property 'name' of null
at Client._handleParseComplete (/Users/amr/workspace/node_modules/pg/lib/client.js:367:26)
at Connection.emit (events.js:314:20)
at /Users/amr/workspace/node_modules/pg/lib/connection.js:114:12
at Parser.parse (/Users/amr/workspace/node_modules/pg-protocol/dist/parser.js:40:17)
at Socket. (/Users/amr/workspace/node_modules/pg-protocol/dist/index.js:11:42)
at Socket.emit (events.js:314:20)
at addChunk (_stream_readable.js:297:12)
at readableAddChunk (_stream_readable.js:272:9)
at Socket.Readable.push (_stream_readable.js:213:10)
at TCP.onStreamRead (internal/stream_base_commons.js:188:23)
Before the update, our code had been working properly for several years.
Sample of code that raises the error:
var pg = require('pg');
let newPool = function() {
};
let ExecuteQuery = function(sql, bindVars, callback) {
var pool = newPool();
pool.query(sql, bindVars, (err, result) => {
return callback(err, result);
});
}
ExecuteQuery("select 1 from tableX WHERE id = $1", [1], function(err, res) {
if(err) {
console.error(err);
return;
}
console.log(res.a.b); // whatever TypeError caused by the application
});
Any advice?
The text was updated successfully, but these errors were encountered: