MySQL server has gone away f\xc3\xb6rfr\xc3\xa5gan SELECT

I get this error in my apache log from time to time (mostly when starting up the server):
WordPress databasfel f\xc3\xb6r MySQL server has gone away f\xc3\xb6rfr\xc3\xa5gan SELECT option_value FROM wp_20_options \n\t\t\t\t\t\tWHERE option_name = 'wpmudev_snapshot' skapat av require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), do_action('init'), call_user_func_array, WPMUDEVSnapshot->snapshot_init_proc, WPMUDEVSnapshot->load_config

I am trying to find out if this is the reason why my snapshots do not appear in my dropbox anymore. They are created "locally" but does not seem to get uploaded to dropbox.

  • Bruno

    A new line in the log appeared that can have something to do with dropbox problem:
    PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 199495106 bytes) in /var/www/wp-content/plugins/snapshot/lib/destinations/dropbox/includes/Dropbox/API.php on line 293
    This can possibly give someone a clue on what is happening.
    Maybe deleting all snapshot settings and uninstalling and then reinstalling plugin can help?
    Will an uninstall clear out everything related to the plugin, so I can start from scratch again?
    Any ideas...
    Cheers

  • Paul

    @ben4wpmudev, You might just be running low on available memory.

    In wp-admin go to Snapshots > Settings. Look for the section 'Server Info'. This will list all information needed to debug your site. There should be a line about the available memory. What is the value?

    Generally you want 64M or really 128M. Below the Server Info section there is another section where you can give Snapshot more memory. Or if you run a lot of plugin you may want to increase memory for WordPress as a whole http://codex.wordpress.org/Editing_wp-config.php#Increasing_memory_allocated_to_PHP

  • Bruno

    Yes it seems i Have a limit of 64 M in the server info setting.

    "Display Errors Off
    Error Reporting 4983 - E_ERROR, E_WARNING
    Magic Quotes Off
    Max Execution Time (seconds) 30 The value displayed can be adjusted by Snapshot PHP scripts.
    Memory Limit 64M - WP_MEMORY_LIMIT defined by WordPress wp-config.php.
    Open Basedir Off
    Running PHP in Safe Mode Off
    ZLib Compression Off"

    and the next section is set to 128M.

    I will try to increase both settings (php memory to 128M and the snapshot limit to 192M) and see what happens. I'll get back when I have tested this.

  • Bruno

    hm tried to uninstall and reinstall plugin and set memory limit to 128M for PHP and 192M for snapshot and the log says:
    2012-12-17 17:54:43: file: wp-content/blogs.dir/5/files/thumb-cache/lars-bilder-006-67b2b338f6b86b817239fc3550252150-800x101-75-nocrop.jpg
    2012-12-17 17:54:49: memory limit: 192M: memory usage current: 18M: memory usage peak: 18.5M
    2012-12-17 17:54:49: finish: snapshot-1355763077-121217-165357-634ea4e5.zip
    2012-12-17 17:54:49: Sending file: snapshot-1355763077-121217-165357-634ea4e5.zip
    2012-12-17 17:54:49: Destination: dropbox: Weekly

    And the snapshot is generated and exists in local snapshot directory but it has not uploaded it to dropbox. I will try to browse through server logs and try another site in my multisite setup to see what could possibly be the problem. I'll get back with a report. Does anyone have a suggestion?

  • Bruno

    Maybe log gives a clue: (still no upload to dropbox although local copy in snapshot folder exists)

    [Mon Dec 17 16:58:34 2012] [error] WordPress database error Table 'wp0101.wp_sitecategories' doesn't exist for query DESCRIBE wp_sitecategories; made by require_once('wp-admin/admin.php'), do_action('toplevel_page_snapshots_edit_panel'), call_user_func_array, snapshot_admin_panels->snapshot_admin_show_items_panel, snapshot_admin_panels->snapshot_admin_show_edit_panel, snapshot_admin_metaboxes->snapshot_metabox_show_backup_tables_options, snapshot_utility_get_database_tables
    [Mon Dec 17 17:15:05 2012] [error] WordPress database error Table 'wp0101.wp_sitecategories' doesn't exist for query DESCRIBE wp_sitecategories; made by do_action_ref_array, call_user_func_array, WPMUDEVSnapshot->snapshot_backup_cron_proc, snapshot_utility_get_database_tables
    [Mon Dec 17 17:15:05 2012] [error] WordPress database error Table 'wp0101.wp_sitecategories' doesn't exist for query DESCRIBE wp_sitecategories; made by do_action_ref_array, call_user_func_array, WPMUDEVSnapshot->snapshot_backup_cron_proc, WPMUDEVSnapshot->snapshot_ajax_backup_init, snapshot_utility_get_database_tables
    [Mon Dec 17 17:15:06 2012] [error] WordPress database error Table 'wp0101.wp_6_options' doesn't exist for query SELECT option_value FROM wp_6_options WHERE option_name = 'wp_6_user_roles' LIMIT 1 made by do_action_ref_array, call_user_func_array, WPMUDEVSnapshot->snapshot_backup_cron_proc, WPMUDEVSnapshot->snapshot_ajax_backup_init, snapshot_utility_get_blog_upload_path, switch_to_blog, WP_Roles->reinit, get_option
    [Mon Dec 17 17:15:06 2012] [error] WordPress database error Table 'wp0101.wp_6_options' doesn't exist for query SELECT option_value FROM wp_6_options WHERE option_name = 'siteurl' LIMIT 1 made by do_action_ref_array, call_user_func_array, WPMUDEVSnapshot->snapshot_backup_cron_proc, WPMUDEVSnapshot->snapshot_ajax_backup_init, snapshot_utility_get_blog_upload_path, wp_upload_dir, get_option
    [Mon Dec 17 17:15:06 2012] [error] WordPress database error Table 'wp0101.wp_6_options' doesn't exist for query SELECT option_value FROM wp_6_options WHERE option_name = 'upload_path' LIMIT 1 made by do_action_ref_array, call_user_func_array, WPMUDEVSnapshot->snapshot_backup_cron_proc, WPMUDEVSnapshot->snapshot_ajax_backup_init, snapshot_utility_get_blog_upload_path, wp_upload_dir, get_option
    [Mon Dec 17 17:15:06 2012] [error] WordPress database error Table 'wp0101.wp_6_options' doesn't exist for query SELECT option_value FROM wp_6_options WHERE option_name = 'upload_url_path' LIMIT 1 made by do_action_ref_array, call_user_func_array, WPMUDEVSnapshot->snapshot_backup_cron_proc, WPMUDEVSnapshot->snapshot_ajax_backup_init, snapshot_utility_get_blog_upload_path, wp_upload_dir, get_option
    [Mon Dec 17 17:15:06 2012] [error] WordPress database error Table 'wp0101.wp_6_options' doesn't exist for query SELECT option_value FROM wp_6_options WHERE option_name = 'uploads_use_yearmonth_folders' LIMIT 1 made by do_action_ref_array, call_user_func_array, WPMUDEVSnapshot->snapshot_backup_cron_proc, WPMUDEVSnapshot->snapshot_ajax_backup_init, snapshot_utility_get_blog_upload_path, wp_upload_dir, get_option
    [Mon Dec 17 17:15:58 2012] [error] PHP Fatal error: Allowed memory size of 201326592 bytes exhausted (tried to allocate 238724817 bytes) in /var/www/wp0101/wp-content/plugins/snapshot/lib/destinations/dropbox/includes/Dropbox/API.php on line 293
    [Mon Dec 17 17:21:34 2012] [error] WordPress database error Table 'wp0101.wp_sitecategories' doesn't exist for query DESCRIBE wp_sitecategories; made by require_once('wp-admin/admin.php'), do_action('toplevel_page_snapshots_edit_panel'), call_user_func_array, snapshot_admin_panels->snapshot_admin_show_items_panel, snapshot_admin_panels->snapshot_admin_show_edit_panel, snapshot_admin_metaboxes->snapshot_metabox_show_backup_tables_options, snapshot_utility_get_database_tables

  • Paul

    @ben4wpmudev, How large is the zip archive created by Snapshot?

    Since the zip IS being created I think we can ignore error log issues.

    Currently Dropbox has a limit of 150Mb for the uploaded archive. We are working on a way around that. The new version would let you upload files over 150Mb. In the mean time you can try splitting you archives. For example create a Snapshot of just the uploads/media section. Another just for Themes, etc.

  • Bruno

    Cough, cough the archive was 230 Mb....
    So i asked it to just make a snapshot of the data base tables and it correctly created a 181 kb zip file in the local snapshot but still refused to upload it...
    same memory error as before

    [Mon Dec 17 19:06:34 2012] [error] PHP Fatal error: Allowed memory size of 201326592 bytes exhausted (tried to allocate 238724819 bytes) in /var/www/wp0101/wp-content/plugins/snapshot/lib/destinations/dropbox/includes/Dropbox/API.php on line 293

  • Bruno

    So I'm finally understanding the problem (or at least one problem, anyway), I think....
    After doing a "Force Re-Authorize with Dropbox" and selecting all databases, it finally actually uploads the resulting 181 kb snapshot.
    I believe the error message (SQL) comes from the following. Try this:

    1. First select "do not include files" and "include all database tables" and run the snapshot. All ok zip file (with database tables) gets uploaded OK.
    2 edit snapshot and go down and "include selected database tables" and try (tick) a couple of them.
    3. Save snapshot.
    4 Do edit snapshot and look at the selected database tables I get all checkboxes unticked. It seems to "forget" which tables to backup. So the only way to backup any tables is to select "include all tables".

    Maybe this is the reason for the sql errors. When the snapshot plugin cannot find out which tables to backup....
    No idea why this is happening, I hope someone wiser can figure this one out.
    Cheers, and thanks for all pointers and helpful suggestions!
    Now I just have to figure out a way to split up snapshots to get the 230MB file section uploaded....

  • Paul

    @ben4wpmudev,

    Do edit snapshot and look at the selected database tables I get all checkboxes unticked. It seems to "forget" which tables to backup. So the only way to backup any tables is to select "include all tables".

    Actually no. When you select 'All table' like 'All Files' it does not actually check the
    tables checkboxes on the form. So this is why you are not seeing them when you go to make the edit. The concept of 'All tables' works like this. Right now you have 12 table but next week you install some plugins that create extra non-WordPress tables. It would be bad if you have to then come back into Snapshot and select the new tables after each new table is added. So the all just does what is says. Backup all table for the blog.

    If however you selected the 'Include selected tables' and set some of the selected tables then when you return to make your edit the radio button selection and the tables checkboxes would be set properly.

    As for your original issue it would like you are getting close. I forgot to mention on your snapshot item that has all your data and produced the 230Mb file. You might want to delete that entry as it will continue to try delivering to Dropbox aver few minutes.

  • Bruno

    Yes I noticed it retried to upload and failed so I deleted that item. I still feel there is something funny with the dropbox integration. Local files run just fine. I have setup a couple of S3 jobs as well and will monitor them to see if all goes well there. I guess the 150 MB limitions is not applicable with S3?
    I'll give S3 a spin and open a new support ticket if I find something odd there.
    I see now the logic behind the tick box thing. Just me that didn't think (again) :slight_smile:

    Thanks for the info and for great support!

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.