Announcement

Collapse
No announcement yet.

Postlog Database Error, Please Help Fix!

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

  • [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:
    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.
    vBulletin 3 & 4 Design & Development For Hire!

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

    Comment


    • #3
      Originally posted by Paul M View Post
      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:
      PHP Warning: mysqli_query(): (23000/1062): Duplicate entry '83' 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
                      (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 29th Oct '16, 8:08am.
      vBulletin 3 & 4 Design & Development For Hire!

      Comment


      • #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 29th Oct '16, 8:39am.
        vBulletin 3 & 4 Design & Development For Hire!

        Comment


        • #5
          Originally posted by LenKaiser View Post
          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

          TalkNewsUK - My vBulletin 5.5.2 Demo
          AdminAmmo - My Cloud Demo

          Comment


          • #6
            Originally posted by Mark.B View Post

            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


            • #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


              • #8
                So what exact error are you getting now please?
                MARK.B | vBULLETIN SUPPORT

                TalkNewsUK - My vBulletin 5.5.2 Demo
                AdminAmmo - My Cloud Demo

                Comment


                • #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


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

                    PHP Warning:

                    Code:
                    PHP Warning: mysqli_query(): (23000/1062): Duplicate entry '92' for key 'PRIMARY' in ..../includes/class_core.php on line 1394
                    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


                    • #12
                      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?
                      vBulletin 3 & 4 Design & Development For Hire!

                      Comment


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

                        Wayne Luke
                        The Rabid Badger - a vBulletin Cloud customization and demonstration site.
                        vBulletin 5 Documentation - Updated every Friday. Report issues here.
                        vBulletin 5 API - Full / Mobile
                        I am not currently available for vB Messenger Chats.

                        Comment


                        • #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


                          • #15
                            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

                            vBulletin 3 & 4 Design & Development For Hire!

                            Comment

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