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

Database insert error after migrating to Postgres #465

Closed
JijeshP opened this issue Oct 10, 2018 · 2 comments
Closed

Database insert error after migrating to Postgres #465

JijeshP opened this issue Oct 10, 2018 · 2 comments
Assignees

Comments

@JijeshP
Copy link

JijeshP commented Oct 10, 2018

Getting the following error after migrating to postgres Database

where: undefined, schema: 'public', table: 'hitl_messages', column: undefined, dataType: undefined, constraint: 'tmp_hitl_messages_pkey', file: 'nbtinsert.c', line: '434', routine: '_bt_check_unique' } } Reason: { message: 'insert into "hitl_messages" ("direction", "raw_message", "session_id", "text", "ts", "type") values ($1, $2, $3, $4, now(), $5) - duplicate key value violates unique constraint "tmp_hitl_messages_pkey"', stack: 'error: duplicate key value violates unique constraint "tmp_hitl_messages_pkey"\n at Connection.parseE (/Works/bot/mb-bot/node_modules/pg/lib/connection.js:567:11)\n at Connection.parseMessage (/Works/bot/mb-bot/node_modules/pg/lib/connection.js:391:17)\n at Socket.<anonymous> (/Works/bot/mb-bot/node_modules/pg/lib/connection.js:129:22)\n at emitOne (events.js:116:13)\n at Socket.emit (events.js:211:7)\n at addChunk (_stream_readable.js:263:12)\n at readableAddChunk (_stream_readable.js:250:11)\n at Socket.Readable.push (_stream_readable.js:208:10)\n at TCP.onread (net.js:594:20)', name: 'error', length: 212,

Botpress version: 10.46.4

Channels: Webchat, Webhook

@shamoh19
Copy link

shamoh19 commented Oct 14, 2018

+1 Facing same issue

@epaminond
Copy link

This one seems to be introduced by botpress/botpress#972 and botpress/botpress#978 : module migration that was added runs each time the bot gets started. The migration that was added to hitl recreates table which causes it sequence to reset and thus fail later on.

@epaminond epaminond self-assigned this Oct 18, 2018
@michaelmass michaelmass transferred this issue from botpress/botpress Jun 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants