Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Problem Adding Categories

edited January 2012 in Vanilla 2.0 - 2.8

I've just installed Vanilla forums and I was trying to add some categories but I keep getting an error. I enabled detailed errors and it tells me:

Duplicate entry '2147483647' for key 'PRIMARY'

Does anyone have any idea how to solve this problem?

please help!!!

Thanks in advance
Thomas

«13

Answers

  • After a bit more investigation, what I think is going wrong is that every tim it tries to add a category it uses the same key as the existing one if that helps? Anyone any ideas?

  • TimTim Operations Vanilla Staff

    2147483647 is actually MAX SIGNED INT. Looks like something is up with your database.
    PHP version, MySQL version, Vanilla version?

    Vanilla Forums COO [GitHub, Twitter, About.me]

  • Hi,

    PHP is version 5.2.17

    MySQL is version 5.0.32

    Vanilla is the latest version

  • edited January 2012

    I did a complete clean install and it's doing the exact same thing. Every other aspect seems to work fine.

  • 422422 Developer MVP
    edited January 2012

    Perhaps post copy of your php.ini for the devs to check , i only ever had problems With pdo and bwlimited .. I really dont get under the hood.

    There was an error rendering this rich post.

  • I'm not sure my hosting provider will let me access the php.ini file. I will check.

  • 422422 Developer MVP
    edited January 2012

    Create a file called phpinfo.php and put this in it.

    <?php phpinfo(); ?>

    Upload that file anywhere on your website and call it up in your browser.

    There was an error rendering this rich post.

  • 422422 Developer MVP

    Looks ok, im no expert. Far from it, suhosin has give us grief before. Hopefully one of the guys here can help

    There was an error rendering this rich post.

  • Thanks for your help anyway - I was able to manually create categories by editing the database in the sql editor - but I still can't create them directly.

  • 422422 Developer MVP
    edited January 2012

    You did install correctly? And 777 appropriate folders. Have u deleted all .ini files in cache folder.

    Sometimes u have go to via cpanel filemanager to set permissions... Clutching at straws for you.

    There was an error rendering this rich post.

  • yep, did all that!

  • x00x00 MVP
    edited January 2012
  • x00x00 MVP
    edited January 2012

    hm categories you say. Sound like an increment problem

    I believe root is -1, is the column signed or unsigned? Perhaps the default is to make it unsigned, and that is causing the problem.

    grep is your friend.

  • I'm not brilliant with SQL - how do I tell?

  • In phpMyAdmin go to GDN_Category

    First root CategoryID should be -1 the first row.

    then look at the structure of the table. There is an auto increment on CategoryID

    at the bottom it says Next Autoindex, what does it say.

    grep is your friend.

  • Ok, Category ID is -1

    Next Autoindex says: 4,294,967,305

    Here's a screenshot of the structure:

    dl.dropbox.com/u/9380800/php-structure.png

  • 422422 Developer MVP

    Wow

    There was an error rendering this rich post.

  • TimTim Operations Vanilla Staff
    edited January 2012

    You can manually fix the auto index with:

    ALTER TABLE GDN_Category AUTO_INCREMENT = 5;
    

    Vanilla Forums COO [GitHub, Twitter, About.me]

  • Ok, I did that and now it says next auto index = 18,446,744,073,709,552,000

Sign In or Register to comment.