Postlog Database Error, Please Help Fix!

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • LenKaiser
    Member
    • Jan 2014
    • 31
    • 4.2.x

    [CMS] 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:
    [B]PHP Warning[/B]: mysqli_query(): (23000/1062): Duplicate entry '81' for key 'PRIMARY' in [B]..../includes/class_core.php[/B] on line [B]1394[/B]
    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.
    vBulletin 3 & 4 Design & Development For Hire!
  • Paul M
    Former Lead Developer
    vB.Com & vB.Org
    • Sep 2004
    • 9886

    #2
    Remove the existing record for postid 81, they are not really very important, just a log.
    Baby, I was born this way

    Comment

    • LenKaiser
      Member
      • Jan 2014
      • 31
      • 4.2.x

      #3
      Originally posted by Paul M
      Remove the existing record for postid 81, they are not really very important, just a log.
      Thanks Paul, I'll give that a try.

      EDIT: Ok there was no postid 81. I removed all the postlogs and still got a PHP Warning & database error:

      PHP Warning:

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

      Code:
      Database error in vBulletin 4.2.3:
      
      Invalid SQL:
      
                      INSERT INTO postlog
                      (postid, useragent, ip, dateline)
                      VALUES
                      (83, '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, 1477757154);
      
      MySQL Error   : Duplicate entry '83' for key 'PRIMARY'
      Error Number  : 1062
      Request Date  : Saturday, October 29th 2016 @ 04:05:54 PM
      Error Date    : Saturday, October 29th 2016 @ 04:05:54 PM
      Script        : http://xxxx.com/forums/content/232-Creating-Sound-Valid-Code
      Referrer      : http://xxxx.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
      The "VALUES" do not exist in that database table. I tried several times to edit posts and each time it increases the postlog ID, 82, 83 and so forth but those are not even there.

      Last edited by LenKaiser; Sat 29 Oct '16, 8:08am.
      vBulletin 3 & 4 Design & Development For Hire!

      Comment

      • LenKaiser
        Member
        • Jan 2014
        • 31
        • 4.2.x

        #4
        I could not create a new post using the Forms mod from vb.org. So I'll have to fix that as well. I was able to add a new post in the forum area without using the forms mod.
        Last edited by LenKaiser; Sat 29 Oct '16, 8:39am.
        vBulletin 3 & 4 Design & Development For Hire!

        Comment

        • Mark.B
          vBulletin Support
          • Feb 2004
          • 24286
          • 6.0.X

          #5
          Originally posted by LenKaiser
          I could not create a new post using the Forms mod from vb.org. So I'll have to fix that as well. I was able to add a new post in the forum area without using the forms mod.
          Hello

          We can't provide support for third party add-ons...best bet is to ask for assistance in the modification's original thread on vbulletin.org.
          MARK.B
          vBulletin Support
          ------------
          My Unofficial vBulletin 6.0.0 Demo: https://www.talknewsuk.com
          My Unofficial vBulletin Cloud Demo: https://www.adminammo.com

          Comment

          • LenKaiser
            Member
            • Jan 2014
            • 31
            • 4.2.x

            #6
            Originally posted by Mark.B

            Hello

            We can't provide support for third party add-ons...best bet is to ask for assistance in the modification's original thread on vbulletin.org.
            Yeah I know that. But this is in the CMS the third party mod has NOTHING to do with the CMS. I had thought that I could not make a regular post either but I could and the mod was the problem for that but not for the original problem posted.
            vBulletin 3 & 4 Design & Development For Hire!

            Comment

            • LenKaiser
              Member
              • Jan 2014
              • 31
              • 4.2.x

              #7
              Ok upon some further investigation into this issue. I only get a database error when I try to enable comments on an article.
              vBulletin 3 & 4 Design & Development For Hire!

              Comment

              • Mark.B
                vBulletin Support
                • Feb 2004
                • 24286
                • 6.0.X

                #8
                So what exact error are you getting now please?
                MARK.B
                vBulletin Support
                ------------
                My Unofficial vBulletin 6.0.0 Demo: https://www.talknewsuk.com
                My Unofficial vBulletin Cloud Demo: https://www.adminammo.com

                Comment

                • Paul M
                  Former Lead Developer
                  vB.Com & vB.Org
                  • Sep 2004
                  • 9886

                  #9
                  Yeah I know that. But this is in the CMS the third party mod has NOTHING to do with the CMS.
                  Thats not true - CMS comments are regular posts, so yes it will affect them.
                  Baby, I was born this way

                  Comment

                  • LenKaiser
                    Member
                    • Jan 2014
                    • 31
                    • 4.2.x

                    #10
                    Originally posted by Mark.B
                    So what exact error are you getting now please?
                    Same as before but with a different number.

                    PHP Warning:

                    Code:
                    [B]PHP Warning[/B]: mysqli_query(): (23000/1062): Duplicate entry '92' for key 'PRIMARY' in [B]..../includes/class_core.php[/B] on line [B]1394[/B]
                    DB Error:

                    Code:
                    Database error in vBulletin 4.2.3:
                    
                    Invalid SQL:
                    
                                    INSERT INTO postlog
                                    (postid, useragent, ip, dateline)
                                    VALUES
                                    (92, '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, 1477890612);
                    
                    MySQL Error   : Duplicate entry '92' for key 'PRIMARY'
                    Error Number  : 1062
                    Request Date  : Monday, October 31st 2016 @ 05:10:12 AM
                    Error Date    : Monday, October 31st 2016 @ 05:10:13 AM
                    Script        : http://xxxx.com/forums/content/232-Creating-Sound-Valid-Code
                    Referrer      : http://xxxx.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
                    I have narrowed it down to this only happens when I try to create a post that allows comments or edit a previous post to allow comments. As long as I do not allow comments I get no errors. But every time I try to edit the post to allow comments the Duplicate entry goes up one number and there are NO postlogs associated with those numbers.

                    I created a demo board and added my custom skin and tried the submit a new article and it was fine. I have added each mod one by one and created new test articles each time and it works fine there so far (have not done all of them yet). I'm wondering if the database in the original board has not gotten corrupted or something somehow.

                    EDIT: I also tried to use the default skin on the original board to change an article to allow comments and got a DB error as well.
                    vBulletin 3 & 4 Design & Development For Hire!

                    Comment

                    • Trevor Hannant
                      vBulletin Support
                      • Aug 2002
                      • 24325
                      • 5.7.X

                      #11
                      What's the autoincrement value on that table? Is it higher than the highest record number?
                      Vote for:

                      - Admin Settable Paid Subscription Reminder Timeframe (vB6)
                      - Add Admin ability to auto-subscribe users to specific channel(s) (vB6)

                      Comment

                      • LenKaiser
                        Member
                        • Jan 2014
                        • 31
                        • 4.2.x

                        #12
                        Originally posted by Trevor Hannant
                        What's the autoincrement value on that table? Is it higher than the highest record number?
                        Where do I find that information?
                        vBulletin 3 & 4 Design & Development For Hire!

                        Comment

                        • Wayne Luke
                          vBulletin Technical Support Lead
                          • Aug 2000
                          • 73981

                          #13
                          Originally posted by LenKaiser

                          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.
                          Translations provided by Google.

                          Wayne Luke
                          The Rabid Badger - a vBulletin Cloud demonstration site.
                          vBulletin 5 API

                          Comment

                          • Paul M
                            Former Lead Developer
                            vB.Com & vB.Org
                            • Sep 2004
                            • 9886

                            #14
                            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.

                            Baby, I was born this way

                            Comment

                            • LenKaiser
                              Member
                              • Jan 2014
                              • 31
                              • 4.2.x

                              #15
                              Originally posted by Wayne Luke

                              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:	234
Size:	225.9 KB
ID:	4358392Click image for larger version

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

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

                              vBulletin 3 & 4 Design & Development For Hire!

                              Comment

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