We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 53719
    • 4 Posts
    Hello everyone aboard!

    Trying to have new fresh modx-2.5.7-pl up and running, but after flawlessly successful setup nothing works: after pressing the "login" button the issue from the topic header appears.

    Test server: Debian stable (stretch)
    Apache: 2.4.25-3+deb9u2
    MariaDB (mysql): 5.5.9999+default
    PHP: 7.0+49

    Packages installed:
    apache2 libapache2-mod-php php php-simplexml php-mysql mysql-server

    ModX was downloaded from official link and unzipped with a standard unzip utility into standard www path: /var/www/html/

    During installation I left default options intact, including encoding:
    Connection character set: utf8mb4
    Collation: utf8mb4_general_ci
    Installation Summary: all OK
    Database test was also OK, and setup finished with no errors.

    Now we're here: ./modx/setup/index.php?action=complete
    and the issue begins:
    Logs listed below.

    Apache logs:
    /var/log/apache2/access.log:
    ::1 - - [29/Aug/2017:20:19:16 +0300] "POST /modx/setup/index.php?action=complete HTTP/1.1" 302 378 "http://localhost/modx/setup/index.php?action=complete" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.78 Safari/537.36"
    ::1 - - [29/Aug/2017:20:19:16 +0300] "GET /modx/setup/index.php?action=login HTTP/1.1" 302 357 "http://localhost/modx/setup/index.php?action=complete" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.78 Safari/537.36"
    ::1 - - [29/Aug/2017:20:19:16 +0300] "GET /modx/manager/ HTTP/1.1" 500 326 "http://localhost/modx/setup/index.php?action=complete" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.78 Safari/537.36"
    /var/log/apache2/error.log:
    [Tue Aug 29 20:20:12.812719 2017] [:error] [pid 9306] [client ::1:57424] PHP Fatal error:  Maximum execution time of 45 seconds exceeded in /var/www/html/modx/core/model/modx/modaccessibleobject.class.php on line 93, referer: http://localhost/modx/setup/index.php?action=complete

    MODX logs:
    ./modx/core/cache/logs/install.config.20170829T171910.log:
    [2017-08-29 17:19:10] (ERROR @ /var/www/html/modx/core/xpdo/om/xpdoobject.class.php : 240) Error 42S02 executing statement: 
    Array
    (
        [0] => 42S02
        [1] => 1146
        [2] => Table 'testdb.modx_context_setting' doesn't exist
    )
    
    [2017-08-29 17:19:10] (ERROR @ /var/www/html/modx/core/xpdo/om/xpdoobject.class.php : 240) Error 42S02 executing statement: 
    Array
    (
        [0] => 42S02
        [1] => 1146
        [2] => Table 'testdb.modx_access_policies' doesn't exist
    ./modx/core/cache/logs/error.log:
    <…>
    
    [2017-08-29 17:20:12] (ERROR @ /var/www/html/modx/core/xpdo/om/xpdoobject.class.php : 240) Error 42S02 executing statement: 
    Array
    (
        [0] => 42S02
        [1] => 1146
        [2] => Table 'testdb.modx_session' doesn't exist
    )
    
    [2017-08-29 17:20:12] (ERROR @ /var/www/html/modx/core/xpdo/om/xpdoobject.class.php : 1452) Error 42S02 executing statement:
    INSERT INTO `modx_session` (`id`, `access`, `data`) VALUES ('g7u75dntrmhdkosthgn362k8u7', 1504027212, '')
    Array
    (
        [0] => 42S02
        [1] => 1146
        [2] => Table 'testdb.modx_session' doesn't exist
    )
    
    [2017-08-29 17:20:12] (ERROR @ Unknown0) PHP warning: Unknown: Failed to write session data (user). Please verify that the current setting of session.save_path is correct (/var/lib/php/sessions)


    Database `testdb' is accessible for the installer and filled out with tables during the setup process:
    mysql -u test -p -D testdb -e "show tables"
    shows fresh new modx_* tables, BUT! modx_context_setting, modx_access_policies and modx_session really doesn't exist.

    Did I miss something?

    This question has been answered by BobRay. See the first response.

    [ed. note: hueman last edited this post 6 years, 7 months ago.]
      • 53719
      • 4 Posts
      Head of ./modx/core/cache/logs/install.config.2017-08-30T13.38.31.log:
      [2017-08-30 13:38:31] (ERROR @ /var/www/html/modx/setup/includes/tables_create.php : 116) Could not create table `modx_access_policies`
      SQL: CREATE TABLE `modx_access_policies` (`id` INTEGER unsigned NOT NULL AUTO_INCREMENT, `name` VARCHAR(255) NOT NULL, `description` MEDIUMTEXT NULL, `parent` INT(10) unsigned NOT NULL DEFAULT '0', `template` INT(10) unsigned NOT NULL DEFAULT '0', `class` VARCHAR(255) NOT NULL DEFAULT '', `data` TEXT NULL, `lexicon` VARCHAR(255) NOT NULL DEFAULT 'permissions', PRIMARY KEY (`id`), UNIQUE KEY `name` (`name`), INDEX `parent` (`parent`), INDEX `class` (`class`), INDEX `template` (`template`)) ENGINE=MyISAM
      ERROR: Array
      (
          [0] => 42000
          [1] => 1071
          [2] => Specified key was too long; max key length is 1000 bytes
      Does this "Specified key was too long; max key length is 1000 bytes" say something helpful here?
      Encoding? Mysql settings? DB user rights?

      p.s. drupal and joomla run on this server configuration as supposed.. [ed. note: hueman last edited this post 6 years, 7 months ago.]
      • discuss.answer
        • 3749
        • 24,544 Posts
        I don't think MariaDB is supported at this point. I could be wrong.

        Using utf8mb4 is definitely a factor.

        Some info here: https://github.com/modxcms/revolution/issues/13121

        and here: https://github.com/modxcms/revolution/issues/12445

        and here: https://github.com/modxcms/revolution/pull/13559

        No mention of MariaDB, so I'm guessing it's still not supported.

          Did I help you? Buy me a beer
          Get my Book: MODX:The Official Guide
          MODX info for everyone: http://bobsguides.com/modx.html
          My MODX Extras
          Bob's Guides is now hosted at A2 MODX Hosting
          • 53719
          • 4 Posts
          Thank you, it really works now in an Ubuntu container: this distro keeps vanilla mysql.
          Very sad that modx still has issues with mariadb..

          BTW, MariaDB is mentioned here: https://modx.com/download
            • 3749
            • 24,544 Posts
            It may just be an issue with the utf8mb4 character set (which would also be sad).

            You might file it as a bug here: https://github.com/modxcms/revolution/issues
              Did I help you? Buy me a beer
              Get my Book: MODX:The Official Guide
              MODX info for everyone: http://bobsguides.com/modx.html
              My MODX Extras
              Bob's Guides is now hosted at A2 MODX Hosting
              • 53719
              • 4 Posts
              BobRay, actually I tried utf8 too, the same result. Maybe something with table length set?
              A bugreport is an idea, thank you!
                • 3749
                • 24,544 Posts
                Some field is apparently overflowing. Do any of your Access Policies, Context keys, or Context Setting keys have particularly long names? I've read that in practice the limit is sometimes 191 characters even though it says 1000. With mb4, it could possibly 1/4 of that.

                Since you have it working, you could look at the tables mentioned and check for long entries.
                  Did I help you? Buy me a beer
                  Get my Book: MODX:The Official Guide
                  MODX info for everyone: http://bobsguides.com/modx.html
                  My MODX Extras
                  Bob's Guides is now hosted at A2 MODX Hosting