Duplicate entry '34482' for key 'PRIMARY'

by jidey, Wednesday, March 23, 2016, 17:49 (3123 days ago)

Hi,

My server had an electric failure and now selfoss do not read new articles anymore. I can see my olds articles.

I launched manually the following command :
root@myserver:/var/www/selfoss# /usr/bin/php5 /var/www/selfoss/update.php
PDOStatement: Duplicate entry '34482' for key 'PRIMARY'

I looked into my mysql database, and the last entry id in the items tables is 34481. I tried to remove this last entry of the items tables :
MariaDB [selfoss]> delete from items where id='34481';
Query OK, 1 row affected (0.03 sec)

I still have the same error "PDOStatement: Duplicate entry '34482' for key 'PRIMARY'".

Any help would be greatly appreciated.

PS : I'm french, sorry for my English mistakes :)

Duplicate entry '34482' for key 'PRIMARY'

by jidey, Sunday, April 03, 2016, 17:04 (3112 days ago) @ jidey

Hi,

In case of someone else got this problem, I found a (brutal) solution:
1) dump your selfoss database: mysqldump -u selfoss_user -p selfoss_database > dump.sql
2) drop your selfoss database (in mysql, root user): drop database selfoss_database
3) recreate your selfoss database (in mysql, root user): create database selfoss_database
4) restore your data: mysql -u root -p selfoss_database < dump.sql

That worked for me, I didn't search further.
jidey

RSS Feed of thread
powered by my little forum