We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 43368
    • 7 Posts
    Dears,

    I'm getting this error after uploading a large file then doing some database query.
    Would you please tell me what caused this issue ?

    [2013-07-28 13:24:11] (ERROR @ /index.php) Error HY000 executing statement:
    Array
    (
    [0] => HY000
    [1] => 2006
    [2] => MySQL server has gone away
    )
    [2013-07-28 13:24:11] (ERROR @ /index.php) Error HY000 executing statement:
    INSERT INTO `modx_session` (`id`, `access`, `data`) VALUES ('ac2b44ee27d8b772378e3f10e327181b', 1375017851, 'modx.user.contextTokens|a:1:{s:3:\"web\";i:366;}modx.user.0.attributes|a:1:{s:3:\"web\";a:4:{s:16:\"modAccessContext\";a:1:{s:3:\"web\";a:1:{i:0;a:3:{s:9:\"principal\";i:0;s:9:\"authority\";s:1:\"0\";s:6:\"policy\";a:1:{s:4:\"load\";b:1;}}}}s:22:\"modAccessResourceGroup\";a:0:{}s:17:\"modAccessCategory\";a:0:{}s:28:\"sources.modAccessMediaSource\";a:0:{}}}modx.user.0.resourceGroups|a:1:{s:3:\"web\";a:0:{}}fb_312537015486066_state|s:32:\"1faff59bf076dde2e4cd4cc5fde93633\";modx.web.user.token|s:54:\"modx50f5e77d404d41.11302303_36651f514ca948035.33171858\";modx.web.session.cookie.lifetime|i:0;modx.user.366.attributes|a:1:{s:3:\"web\";a:4:{s:16:\"modAccessContext\";a:0:{}s:22:\"modAccessResourceGroup\";a:1:{i:1;a:1:{i:0;a:3:{s:9:\"principal\";s:1:\"3\";s:9:\"authority\";s:4:\"9999\";s:6:\"policy\";a:3:{s:4:\"load\";b:1;s:4:\"list\";b:1;s:4:\"view\";b:1;}}}}s:17:\"modAccessCategory\";a:0:{}s:28:\"sources.modAccessMediaSource\";a:0:{}}}modx.user.366.resourceGroups|a:1:{s:3:\"web\";a:1:{i:0;s:1:\"1\";}}modx.user.366.userGroupNames|a:1:{i:0;s:7:\"Members\";}user_type|s:6:\"seller\";logged_in|i:1;')
    Array
    (
    [0] => HY000
    [1] => 2006
    [2] => MySQL server has gone away
    )

    Regards,
    Mohamed
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      It's possible that processing the large file upload takes too long, and the PHP connection to the database has timed out.

      You might want to try using the default PHP session_handler instead of the MODx session_handler; in the System Settings the session_handler_class can be left empty to use the default PHP session handler.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 43368
        • 7 Posts
        Thanks sottwell for your reply.

        I tried the solution you told me and still getting the same error.

        What else could i do to fix that issue?

        Thanks,
        Mohamed
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          It's most likely a timeout issue; the uploaded file processing is taking too long and the initial database connection made by MODx times out. There are a couple of setting that you might be able to change,
          ini_set('mysql.connect_timeout', 300);
          ini_set('default_socket_timeout', 300);

          http://www.php.net/manual/en/mysql.configuration.php#ini.mysql.connect-timeout
          http://www.php.net/manual/en/filesystem.configuration.php#ini.default-socket-timeout
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 43368
            • 7 Posts
            I tried changing the two variables in the php configs but got the same error.
            Do you have any other suggestions.

            Regards,
            Mohamed
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              No, unless the database tables are corrupted. You could try to repair and optimize the tables.
                Studying MODX in the desert - http://sottwell.com
                Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                Join the Slack Community - http://modx.org
                • 43368
                • 7 Posts
                mmm but i'm not getting this error if i upload a small file huh weird right huh
                  • 28042 ☆ A M B ☆
                  • 24,524 Posts
                  No, not weird at all. It takes longer to process a large file upload, so the MySQL connection that MODx makes when it starts times out while the file upload is being processed. Smaller files don't take as long to process, so the connection doesn't time out.
                    Studying MODX in the desert - http://sottwell.com
                    Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                    Join the Slack Community - http://modx.org