Opened 3 years ago

Closed 3 years ago

#1487127 closed Bugs (worksforme)

DB constraint violation when populating messages

Reported by: ralfm Owned by:
Priority: 5 Milestone: 0.5-beta
Component: Core functionality Version: 0.4.2
Severity: normal Keywords: cache constraint violation
Cc:

Description

Roundcube 0.4.2
RC pluging: dblog
PostgreSQL 8.3.12

Hello, we are getting an error in our system. It does not happen always and only with some users, but it is irritating to get all logs full with these error messages.

It happens when RC tries to update the table 'messages' and the errors are of this type:

DB Error: MDB2 Error: constraint violation Query: _doQuery: [Error message: Could not execute statement] [Last executed query: EXECUTE mdb2_statem
nt_pgsql_23c2cef935f6e5f94fe44729e6d23203dfbdcc7857 ('291', 'INBOX.msg', '67', '42703', 'Dana Cup, HjXrring News', 'xxxxx@xxxxxx.xx <xxxxx@xxxxxx.xx>', 'xxxxx@xxxxxx.xx', '', 130199, 'O:17:"rcube_mail_header":35:{s:2:"id";s:2:"67";s:3:"uid";s:
:"42703";s:7:"subject";s:23:"Dana Cup, HjXrring News";s:4:"from";s:63:""=?iso-8859-1?B?c29jY2VyQGRhbmFjdXAuZGs=?=" <xxxxx@xxxxxx.xx>";s:2:"to";s:23:"xxx.xxxx in /local/webmail-roundcube/program/include/rcube_mdb
.php on line 646 (GET /new/?_task=mail&_remote=1&_action=check-recent&_t=1289905331035&_mbox=INBOX&_list=1&_quota=1&_=1289905331036&_unlock=1)

We can see in the database logs that the problem is because the unique index "messages_user_id_key"

ERROR:  duplicate key value violates unique constraint "messages_user_id_key"

This index is defined as:

"messages_user_id_key" UNIQUE, btree (user_id, cache_key, uid)

What is the meaning of the column 'uid' in this context?
How can we solve this problem?
Do you need more information?

Thanks in advance

Change History (1)

comment:1 Changed 3 years ago by alec

  • Milestone changed from later to 0.5-beta
  • Resolution set to worksforme
  • Status changed from new to closed

It means it tries to add a message with specified message UID that already exists in DB. The unique index prevents from data duplication, so you could probably ignore this error. Please, check svn-trunk version. There have been some fixes related to this.

Note: See TracTickets for help on using tickets.