pg-boss: invalid message format

Hi,

I am receiving odd pg errors after I upgraded to version 7.4 (from 6.x) “invalid message format” - and I have no ideas how to debug this, or where this is coming from.

It only happens rarely, and overall the job processing works.

I run 20 node instances with the pg-boss worker on each instance:

this.boss = new PgBoss({
	database: process.env.DATABASE,
	user: process.env.DATABASE_USER,
	password: process.env.DATABASE_PASSWORD,
	host: process.env.DATABASE_HOST,
	port: process.env.DATABASE_PORT,
	application_name: `xyz_${packageJson.version}_pgboss`,
	noSupervisor: !isWorker,
	noScheduling: !isWorker,
	max: 5,
	uuid: 'v4',
	newJobCheckInterval: 2000,
	monitorStateIntervalSeconds: 5,
	expireCheckIntervalSeconds: 10,
	archiveCompletedAfterSeconds: 300,
	deleteAfterDays: 90, // Delete archived jobs
});

Full error:

PgBossWorker: on error {
   length: 81,
   name: 'error',
   severity: 'ERROR',
   code: '08P01',
   detail: undefined,
   hint: undefined,
   position: undefined,
   internalPosition: undefined,
   internalQuery: undefined,
   where: undefined,
   schema: undefined,
   table: undefined,
   column: undefined,
   dataType: undefined,
   constraint: undefined,
   file: 'pqformat.c',
   line: '640',
   routine: 'pq_getmsgend',
   message: 'invalid message format (Queue: __pgboss__monitor-states, Worker: 1aaed893-107a-4cdf-8509-e8b2f1da09c8)',
   stack: 'error: invalid message format (Queue: __pgboss__monitor-states, Worker: 1aaed893-107a-4cdf-8509-e8b2f1da09c8)\n' +
     '    at Parser.parseErrorMessage (/var/www/cointrackr/node_modules/pg-protocol/dist/parser.js:287:98)\n' +
     '    at Parser.handlePacket (/var/www/cointrackr/node_modules/pg-protocol/dist/parser.js:126:29)\n' +
     '    at Parser.parse (/var/www/cointrackr/node_modules/pg-protocol/dist/parser.js:39:38)\n' +
     '    at Socket.<anonymous> (/var/www/cointrackr/node_modules/pg-protocol/dist/index.js:11:42)\n' +
     '    at Socket.emit (node:events:527:28)\n' +
     '    at Socket.emit (node:domain:475:12)\n' +
     '    at addChunk (node:internal/streams/readable:315:12)\n' +
     '    at readableAddChunk (node:internal/streams/readable:289:9)\n' +
     '    at Socket.Readable.push (node:internal/streams/readable:228:10)\n' +
     '    at TCP.onStreamRead (node:internal/stream_base_commons:190:23)',
   queue: '__pgboss__monitor-states',
   worker: '1aaed893-107a-4cdf-8509-e8b2f1da09c8'
 }

Also seeing this for other queues like: __pgboss__cron, and my own queues fetch_xyz.

Do you know where to look for to fix this?

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 17 (14 by maintainers)

Most upvoted comments

Glad you tracked it down! You can re-open this so we can track it for a fix.

By the way, expireCheckIntervalSeconds is obsolete