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.

Invalid default value for 'DateExpires' (Vanilla 2.5)

MinnitMinnit New
edited December 2017 in Vanilla 2.0 - 2.8

There's no Vanilla 2.5 Help category so I had to create this in Vanilla 2.3 Help.

I've never used Vanilla before and this is the first time I'm setting it up.

I get this error when I enter my DB credentials / admin username / password etc in /dashboard/setup:

Invalid default value for 'DateExpires'

Comments

  • LincLinc Detroit Admin

    Can you get to /utility/structure and Scan to see what it says?

    If that fails, can you run /utility/update?

    If that doesn't work, can you look at your database and see if DateExpires is a column on both the AccessToken and Invitation table?

  • jonasltujonasltu New
    edited December 2017

    I can get the same problem, when I try to install Vanilla 2.5 on fresh server setup (Ubuntu 16.04) running VestaCP.
    This is what DB structure looks like:

  • R_JR_J Ex-Fanboy Munich Admin

    @Linc said:
    Can you get to /utility/structure and Scan to see what it says?

    If that fails, can you run /utility/update?

    If that doesn't work, can you look at your database and see if DateExpires is a column on both the AccessToken and Invitation table?

    @Linc: That PR must be backported.

    @All
    As long as that haven't been done, you need to make a few changes to your installation. Search in the files below for "DateExpire" and manually replace it with "DateExpires". Watch out for the upper and lower case spelling

    /applications/dashboard/controllers/api/AuthenticateApiController.php
    /applications/dashboard/models/class.sessionmodel.php
    /applications/dashboard/settings/structure.php

    Run /utility/structure afterwards.

  • Merry Christmas to everybody?
    How to run these utility commands? Are they shell commans? I can't find such file structure and such executables? Ar they API? If so, how to run them?

  • LincLinc Detroit Admin

    This is now fixed in the release. Thanks, @R_J.

  • MinnitMinnit New
    edited December 2017

    I redownloaded the release and I'm still getting the same error.

    I can't run /utility/structure or /utility/update since it redirects me to /dashboard/setup.

    This is what the DB structure looks like:

    Here's the full error:

    Invalid default value for 'DateExpires'
    ## /var/www/html/forum/library/database/class.database.php(407)
    #0 [internal function]: gdn_ErrorHandler(256, 'Invalid default...', '/var/www/html/f...', 407, Array)
    #1 /var/www/html/forum/library/database/class.database.php(407): trigger_error('Invalid default...', 256)
    #2 /var/www/html/forum/library/database/class.databasestructure.php(442): Gdn_Database->query('create table `G...')
    #3 /var/www/html/forum/library/database/class.mysqlstructure.php(313): Gdn_DatabaseStructure->executeQuery('create table `G...')
    #4 /var/www/html/forum/library/database/class.databasestructure.php(509): Gdn_MySQLStructure->_create()
    #5 /var/www/html/forum/applications/dashboard/settings/structure.php(292): Gdn_DatabaseStructure->set(false, false)
    #6 /var/www/html/forum/applications/dashboard/controllers/class.setupcontroller.php(248): include('/var/www/html/f...')
    #7 /var/www/html/forum/applications/dashboard/controllers/class.setupcontroller.php(86): SetupController->configure()
    #8 /var/www/html/forum/library/core/class.dispatcher.php(832): SetupController->index()
    #9 /var/www/html/forum/library/core/class.dispatcher.php(261): Gdn_Dispatcher->dispatchController(Object(Gdn_Request), Array)
    #10 /var/www/html/forum/index.php(29): Gdn_Dispatcher->dispatch()
    #11 {main}
    
  • LincLinc Detroit Admin
    edited December 2017

    I suggest deleting all the tables + the conf/config.php and starting again.

  • @Linc said:
    I suggest deleting all the tables + the conf/config.php and starting again.

    I tried that and received the same error again.

    I'm running Ubuntu 16.04, using PHP 7.1 and MySQL 5.7 if that matters.

  • LincLinc Detroit Admin

    I believe your MySQL install is in strict mode. Are you able to change that?

    See https://github.com/vanilla/vanilla/issues/5832

  • MinnitMinnit New
    edited December 2017

    It worked after I turned strict mode off.

    Thanks!

  • FabulousPandaFabulousPanda London New
    edited December 2017

    I ran in to the same issue and after disabling strict mode in MYSQL now the v2.5 installer results in this error:

    Invalid log level: Failed to insert {type} ({content}): {error}.

    I'm running a fresh install of Ubuntu 16.04, MYSQL 5.7 and PHP 7.0.22 and using a database from a Vanilla instance on another server.

  • Sorry ignore me, I just copied over the old config file and it ran fine without going through the install

  • yqwangyqwang New
    edited January 2018

    structure.php
    line 290
    ->column('DateExpires', 'timestamp', false)
    change it to
    ->column('DateExpires', 'datetime', false)

Sign In or Register to comment.