PDA

View Full Version : Database error while making post - PLEASE HELP


XYZ500
11-21-2014, 10:12 PM
I am getting a database error on my forum whenever any user (including admins) try to make a post. Surfing the forum seems to be fine, but whenever a user tries to make a post, this error appears and this is not letting anyone make a post.

Here is the screenshot of the error. Just blacked out the website URL and IP.

https://vborg.vbsupport.ru/external/2014/11/14.png

Following is error that is shown in that yellowish box. In the brackets I have written what is shown there, also made that text bold.

Database error in vBulletin 4.2.2:

Invalid SQL:
INSERT INTO bocetapost
(showsignature, allowsmilie, htmlstate, username, userid, title, pagetext, iconid, visible, dateline, ipaddress, attach, threadid)
VALUES
(1, 1, 'on_nl2br', '(forum username trying to post)', 26828, '(thread title)', '(post content)', 0, 1, 1416614576, '39.32.208.108', 0, 165544);

MySQL Error : Duplicate entry '1133455' for key 'PRIMARY'
Error Number : 1062
Request Date : Friday, November 21st 2014 @ 06:02:56 PM
Error Date : Friday, November 21st 2014 @ 06:02:56 PM
Script : http://domain.com/newthread.php?do=postthread&f=89
Referrer : http://domain.com/newthread.php?do=newthread&f=89
IP Address : 39.32.xxx.xxx
Username : (forum username trying to post)
Classname : vB_Database
MySQL Version : 5.1.69




PLEASE TELL ME HOW TO FIX THIS ERROR ASAP.

squidsk
11-22-2014, 12:22 PM
A quick guess would be someone/something has played around with the autoincrement postid value for the post table.

To check this issue the following two mysql commands:

select max(postid) from bocetapost

and

SELECT AUTO_INCREMENT
FROM information_schema.TABLES
WHERE TABLE_SCHEMA = "DATABASE NAME"
AND TABLE_NAME = "bocetapost"

Note: Don't forget for the second query to change the db name to the one for your db.

If the second number is less than or equal to the first, take note of the postid from the first and run the following query:

ALTER TABLE bocetapost AUTO_INCREMENT = postid + 1;

Lynne
11-22-2014, 06:10 PM
You can try doing an optimize/repair on the bocetapost table under Maintenance > Optimize/Repair > select the table > Continue

Paul M
11-22-2014, 10:48 PM
Run a repair on the "bocetapost" table.