Bug tracker

This ticket has been moved to our new tracker. Open Ticket PHPBB3-9257 now.

duplicate key violates unique constraint "posts_pkey" (fix completed in vcs)

The two databases are running on PostgreSQL 7.4. Database of phpBB2 is in LATIN1 while database of phpBB3 is in UNICODE.

When converting a forum with 7873 messages, I get 1126 errors like this one :
Code: Select all
Error while processing INSERT query
» SQL:INSERT INTO posts (post_id, topic_id, forum_id, poster_id, icon_id, poster_ip, post_time, enable_bbcode, enable_smilies, enable_sig, enable_magic_url, post_username, post_subject, post_attachment, post_edit_time, post_edit_count, post_edit_reason, post_edit_user, bbcode_uid, post_text, bbcode_bitfield, post_checksum) VALUES ('1639', '62', '9', '8', 0, '193.52.32.157', '1133805480', '1', '1', '1', 1, '', '', 0, 0, '0', '', '8', 'c30fe', 'certains considérerait la chose comme de l''art !! d''où droit d''auteur !!', 'EA==', '')

Array ( [message] => ERROR: duplicate key violates unique constraint "posts_pkey" [code] => )


After conversion ends, statistics say I only have 6748 messages on my new forum (so I've lost about 1126 messages).

But when adding number of posts of all the categories, I get 7881.

When analysing table phpbb_post, there is a difference of 1126 entries between phpBB2 and phpBB3 forums.

phpBB2 :
- number of messages (bottom of the page) : 7873
- number of messages (addition of categories' number) : 7873
- number of rows in phpbb_post : 7874

phpBB3 :
- number of messages (bottom of the page) : 6748
- number of messages (addition of categories' number) : 7881
- number of rows in phpbb_post : 6748

Comments / History

Edited ticket

Action performed by ondex on May 9th 2007, 15:07

Edited ticket

Action performed by ondex on May 9th 2007, 15:19

Changed ticket status from "New" to "Awaiting information"

Action performed by Kellanved (Former Team Member) on May 12th 2007, 14:50

Posted by Kellanved (Former Team Member) on May 12th 2007, 14:50

That is strange. could you please send us a dump of your database, so that we can look into the issue?

Regards,
~H

Assigned ticket to group "Development Team"

Action performed by Kellanved (Former Team Member) on May 12th 2007, 14:50

Posted by ondex on May 12th 2007, 16:30

Because it's a private forum, I have to discuss this point with the members. I hope they will allow me to give you a dump.

Posted by Acyd Burn (Server Manager) on May 12th 2007, 16:37

If you provide a dump for testing, please provide it via PM here or by email. I do not want dumps to be exposed within the trackers, even if tagged as private. ;)

To further secure the dump, try to set every user password within the users table to md5('blah') (for example); the md5 hash for 'blah'. Furthermore, make sure no passwords are listed within phpbb_config.

Posted by ondex on May 18th 2007, 14:59

After some discussions with the members, I decided to provide you a dump because the few persons opposed to this didn't provide any good reasons.

I will send you a PM with the informations to get and use the dump.

I hope it will help you.

Posted by Chairman Kaga on May 22nd 2007, 11:33

I am experiencing this same issue. Witness:

viewtopic.php?f=68&t=544133

If you would like another dump to work with, please PM me. I will be happy to provide.

Posted by ondex on May 22nd 2007, 13:45

It seems Kellanved is not able to reproduce the problem with my dump, it's really strange.

Can you (Kellanved, Chairman Kaga) detail your configuration please ?

Mine is :
- Apache 1.3.34
- PHP 4.4.4
- PostgreSQL 7.4.16

The system is a Debian Etch with the default repository.

Posted by Kellanved (Former Team Member) on May 22nd 2007, 16:08

PGSQL 8.2.4
Apache 2.2.4
PHP 5.2.1

I have however found a few other postgres issues while converting your board.

Changed ticket status from "Awaiting information" to "Duplicate"

Action performed by Kellanved (Former Team Member) on May 23rd 2007, 12:08

Changed ticket status from "Duplicate" to "Fix in progress"

Action performed by Kellanved (Former Team Member) on May 23rd 2007, 14:41

Assigned ticket to user "Kellanved"

Action performed by Kellanved (Former Team Member) on May 23rd 2007, 14:41

Linked ticket with changeset: r7666

Action performed by Kellanved (Former Team Member) on May 23rd 2007, 15:05

Changed ticket status from "Fix in progress" to "Fix completed in CVS"

Action performed by Kellanved (Former Team Member) on May 23rd 2007, 15:06

Posted by ondex on May 23rd 2007, 15:26

It seems my message is a little too late but I write it nevertheless.

I did some tests and the problem appears only when using PostgreSQL 7.4. With PostgreSQL 8.1 conversion happens without error.

However, I have inconsistencies with the number of messages but no message seems lost.

Ticket details

Related SVN changesets