Announcement

Collapse
No announcement yet.

Postlog Database Error, Please Help Fix!

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • LenKaiser
    started a topic [CMS] Postlog Database Error, Please Help Fix!

    Postlog Database Error, Please Help Fix!

    Whenever I create a new article or try to edit an old one in the CMS I get this database error & PHP error:

    PHP:

    Code:
    PHP Warning: mysqli_query(): (23000/1062): Duplicate entry '81' for key 'PRIMARY' in ..../includes/class_core.php on line 1394
    Database Error:

    Code:
    Database error in vBulletin 4.2.3:
    
    Invalid SQL:
    
                    INSERT INTO postlog
                    (postid, useragent, ip, dateline)
                    VALUES
                    (81, 'Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.59 Safari/537.36 OPR/41.0.2353.46', 403421714, 1477672825);
    
    MySQL Error   : Duplicate entry '81' for key 'PRIMARY'
    Error Number  : 1062
    Request Date  : Friday, October 28th 2016 @ 04:40:25 PM
    Error Date    : Friday, October 28th 2016 @ 04:40:25 PM
    Script        : http://xxxxxxx.com/forums/content/232-Creating-Sound-Valid-Code
    Referrer      : http://xxxxxxx.com/forums/content/232-Creating-Sound-Valid-Code/edit
    IP Address    : xx.xx.xx.xx
    Username      : LenKaiser
    Classname     : vB_Database_MySQLi
    MySQL Version : 5.5.52-cll
    So far I've disabled all the mods in the config file, optimized the database & repaired it in the vb Admin panel, & cleared my browser cache.

    Any help would be appreciated, thanks.

  • LenKaiser
    replied
    Originally posted by Paul M View Post
    Have you re-uploaded all the default files for your current version ?

    If you are 100% sure you have disabled the plugin system, and are running the current default 4.2.3 files (and style), and it still happens, then you need to provide a clear set of steps to reproduce it, because its really unclear to me atm what exactly you are doing, so I cannot try it on my test site. That said, I find it hard to believe its not something local to your set-up as it would have expected it to have been reported long ago if it were a core issue.
    No I do not think its a core issue at all, never did. I think now that I've been working on it for a bit that my database somehow got hosed since I've backed it up and imported it a couple of times. I think initially it did have to do with a particular plugin/mod because yesterday I remembered that I had a problem with comments after deleting some comments in a mod that I installed, so I bet there in lies the problem now and somehow it hosed the database in the process not allowing comments anywhere in the CMS as well as the mod.

    What I've done is I have my demo site up and I moved my custom skin to that site and moved all the mods except the one that I suspect caused this issue and now I cannot reproduce this issue which IMO is a good thing lol. So I'll work on creating the site from scratch again and check periodically as I do so to ensure there is no problem as I go along. If I have any other issues with it I'll let you guys know. Thanks for your help.

    Leave a comment:


  • Paul M
    replied
    Have you re-uploaded all the default files for your current version ?

    If you are 100% sure you have disabled the plugin system, and are running the current default 4.2.3 files (and style), and it still happens, then you need to provide a clear set of steps to reproduce it, because its really unclear to me atm what exactly you are doing, so I cannot try it on my test site. That said, I find it hard to believe its not something local to your set-up as it would have expected it to have been reported long ago if it were a core issue.

    Leave a comment:


  • Mark.B
    replied
    Originally posted by LenKaiser View Post

    Yeah but I globally disabled the plugins and it still happened that is what baffles me. Shouldn't it have temporarily solved the issue so that I could systematically go through them and find the culprit?
    Once the problem exists it won't go away even with plugins disabled, until the conflict is resolved.

    So you could try disabling plugins via config.php, then recreating the table from scratch as Paul suggested. It should work then. It's then a matter of finding out which plugin is causing it.

    To be honest I would be tempted to do as Paul suggested and just afresh with the table, it may well work then. Databases can have a mind of their own at times.

    Leave a comment:


  • LenKaiser
    replied
    Originally posted by Paul M View Post
    The structure actually looks fine so you have a code conflict going on somewhere, a plugin seems the most likely cause.
    Yeah but I globally disabled the plugins and it still happened that is what baffles me. Shouldn't it have temporarily solved the issue so that I could systematically go through them and find the culprit?

    Leave a comment:


  • Paul M
    replied
    The structure actually looks fine so you have a code conflict going on somewhere, a plugin seems the most likely cause.

    Leave a comment:


  • LenKaiser
    replied
    Originally posted by Wayne Luke View Post
    You can rebuild the unique indexes in the AdminCP under Maintenance -> Repair / Optimize tables. You will need to make sure the Install directory is uploaded and that your site is in debug mode.

    You can put your site into debug mode by adding this line to your config.php under the <?php line:
    Code:
    $config['Misc']['debug'] = true;
    Did all and it did not fix the table, its the same. Tried to create a new article and got the same issue as before with the PHP Warning & DB Error. Incidentally something I forgot to mention was that when I get this database error and I'm creating a new article not editing an article I can go back and refresh the home page and the article is there but it does not have comments enabled even though I did enable them when creating the article. I'm not sure if that makes a difference or not.

    Leave a comment:


  • LenKaiser
    replied
    Originally posted by Paul M View Post
    What does the table structure show ?
    I've attached a screen shot. Click image for larger version

Name:	screen-postlog-structure.jpg
Views:	5
Size:	441.3 KB
ID:	4358417

    Leave a comment:


  • Wayne Luke
    replied
    You can rebuild the unique indexes in the AdminCP under Maintenance -> Repair / Optimize tables. You will need to make sure the Install directory is uploaded and that your site is in debug mode.

    You can put your site into debug mode by adding this line to your config.php under the <?php line:
    Code:
    $config['Misc']['debug'] = true;

    Leave a comment:


  • Paul M
    replied
    What does the table structure show ?

    Leave a comment:


  • LenKaiser
    replied
    Originally posted by Paul M View Post
    If all else fails, you might find it better to just drop the table and recreate it. Take a backup of it first if you think you may want to re-import the old logs.
    Yeah if I cannot get this solved I'll have to do that I already have a back up saved. Backed it up before I went rooting around in it

    Leave a comment:


  • LenKaiser
    replied
    Originally posted by Wayne Luke View Post

    You need to run a query:
    Code:
    show table status like 'postlog';
    If you have phpMyAdmin, you can look at the table and then click on the "operations" tab. The Auto-increment value should be at least 1 higher than the maximum postid in the postlog table.
    It appears there is no limit set, or at least that is what I gather from what I see. Screen shots of ACP after running the query & screen shot of phpMyAdmin after clicking the tab are below. Click image for larger version

Name:	screengrab-phpmyadmin.png
Views:	15
Size:	225.9 KB
ID:	4358392Click image for larger version

Name:	screengrab-vbadmin1.jpg
Views:	14
Size:	266.8 KB
ID:	4358393Click image for larger version

Name:	screengrab-vbadmin2.jpg
Views:	14
Size:	214.8 KB
ID:	4358394

    Leave a comment:


  • Paul M
    replied
    If all else fails, you might find it better to just drop the table and recreate it. Take a backup of it first if you think you may want to re-import the old logs.

    Leave a comment:


  • Wayne Luke
    replied
    Originally posted by LenKaiser View Post

    Where do I find that information?
    You need to run a query:
    Code:
    show table status like 'postlog';
    If you have phpMyAdmin, you can look at the table and then click on the "operations" tab. The Auto-increment value should be at least 1 higher than the maximum postid in the postlog table.

    Leave a comment:


  • LenKaiser
    replied
    Originally posted by Trevor Hannant View Post
    What's the autoincrement value on that table? Is it higher than the highest record number?
    Where do I find that information?

    Leave a comment:

widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
Working...
X