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.

Failed upgrade to 2.1.8

Hey guys, I'm sorry to say but my upgrade failed. I get this message:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'alter table `GDN_UserPoints` add primary key (`SlotType`, `TimeSlot`, `Source`, ' at line 4|Gdn_Database|Query|/* 'primary key (`SlotType`, `TimeSlot`, `Source`, `CategoryID`, `UserID`)' => 'primary key (`SlotType`, `TimeSlot`, `Source`, `UserID`)' */ alter table `GDN_UserPoints` drop primary key; alter table `GDN_UserPoints` add primary key (`SlotType`, `TimeSlot`, `Source`, `UserID`);

I also noticed I got redirected to the 'installer' page after going to the 'upgrade' url. When I fill out my db and forum details on the page, it gives this message. Does anyone know what's going on?


  • Options
    LincLinc Detroit Admin

    Do you have a GDN_UserPoints table in your database?

    Going to the installer page indicates your config file is missing. Did you back it up before upgrading? It's possible your FTP program, when copying the conf folder, erased the conf.php file inside and you need to restore it.

  • Options

    I have that table in my database.

    When I tried restoring the conf.php file, the forum said there was an error (the big smiley appeared).

  • Options
    LincLinc Detroit Admin

    Follow this guide:

    Report back with the error.

  • Options
    edited January 2015

    Thanks for the help. This is what it says:

    Fatal Error in Gdn_Database.SQL();
    Creating default object from empty value
    The error occurred on or near: /library/database/class.database.php
    357:    public function SQL() {
    358:       if(is_null($this->_SQL)) {
    359:          $Name = $this->Engine . 'Driver';
    360:          $this->_SQL = Gdn::Factory($Name);
    361:          $this->_SQL->Database = $this;
    362:       }
    364:       return $this->_SQL;
    365:    }
    [/library/database/class.database.php:361] PHP::Gdn_ErrorHandler();
    [/library/core/class.model.php:133] Gdn_Database->SQL();
    [/applications/dashboard/models/class.usermodel.php:30] Gdn_Model->__construct();
    [/library/core/class.factory.php:206] UserModel->__construct();
    [/library/core/class.factory.php:95] Gdn_Factory->_InstantiateObject();
    [/library/core/] Gdn_Factory->Factory();
    [/library/core/] Gdn::Factory();
    [/library/core/class.auth.php:328] Gdn::UserModel();
    [/library/core/class.session.php:318] Gdn_Auth->GetUserModel();
    [/library/core/class.auth.php:41] Gdn_Session->Start();
    [/bootstrap.php:214] Gdn_Auth->StartAuthenticator();
    [/index.php:33] PHP::require_once();
    Variables in local scope:
    [Name] 'Driver'
    [this] array (
      'ClassName' => 'Gdn_Database',
      'ConnectionOptions' => NULL,
      'DatabasePrefix' => NULL,
      'ExtendedProperties' => 
      array (
      'Dsn' => 'host=localhost;dbname=MY DBNAME;',
      'Engine' => NULL,
      'Password' => 'SECURITY',
      'User' => 'MY DB USER',
    Need Help?
    If you are a user of this website, you can report this message to a website administrator.
    If you are an administrator of this website, you can get help at the Vanilla Community Forums.
    Additional information for support personnel:
    Application: Vanilla
    Application Version: 2.1.8p1
    PHP Version: 5.4.25
    Operating System: Linux
    Server Software: Apache
    User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/600.2.5 (KHTML, like Gecko) Version/8.0.2 Safari/600.2.5
    Request Uri: /
    Controller: Gdn_Database
    Method: SQL
  • Options
    LincLinc Detroit Admin

    @Todd suggests running this database query manually (like in phpMyAdmin): alter table GDN_UserPoints drop primary key and then attempting the update again.

  • Options
    LincLinc Detroit Admin
  • Options

    I managed to do the upgrade after a few tries. Thanks.

Sign In or Register to comment.