I am getting database error for snapshot plugin

Greetings,

I am getting the following error for the snapshot plugin:

[09-Dec-2013 12:35:21 UTC] WordPress database error for query SELECT option_value FROM ht_options

WHERE option_name = 'wpmudev_snapshot' made by do_action_ref_array, call_user_func_array, WPMUDEVSnapshot->snapshot_backup_cron_proc, WPMUDEVSnapshot->add_update_config_item, WPMUDEVSnapshot->load_config, m_wpdb->query

Is this a known issue and is there a fix?

thanks

  • Paul
    • The Green Incsub

    @Danny,

    Is this a known issue and is there a fix?

    Well, it is known now. Where exactly are you seeing this error? In the snapshot logs or in your server logs?

    So from your first post on this thread the SQL statement appears valid

    SELECT option_value FROM ht_options WHERE option_name = 'wpmudev_snapshot'

    I'm assuming your database prefix 'ht_' and your options table name fully is 'ht_options', correct? Have you tried running this query by hand? I'm not seeing anything wrong with it.

    So the other information you have provided give me some clues as to where this is occuring. Here is the function chain.
    1. WPMUDEVSnapshot->snapshot_backup_cron_proc,
    2. WPMUDEVSnapshot->add_update_config_item,
    3. WPMUDEVSnapshot->load_config,
    4. m_wpdb->query

    Notice the last element is m_wpdb and not the standard wpdb which is the default global database reference used by WordPress. So you must have some other plugin installed that is manipulating the global $wpdb instance. Maybe our Multi-DB plugin ( https://premium.wpmudev.org/project/multi-db/ )

  • Danny
    • The Incredible Code Injector

    I am seeing this error in the error_log for this domain. I do have multi-db installed. I am using ht_ for the prefix, ht_options is the table name. Databases are named hnn247_wpms_0 thru _f and _ global as defined by multi-db.

    Yes, the query runs fine when I execute in phpmyadmin.

    I don't know what the m_wpdb refers to.

    Not sure I get where you are going with this.

  • Paul
    • The Green Incsub

    @Danny,

    Not sure I get where you are going with this.

    I means I suspected you were running something like Multi-DB which makes changes to the global $wpdb object.

    I've not tested Snapshot with new versions of Multi-DB. Basically what is happening is that code in snapshot is attempting to load its own settings. This is standard in any plugin startup processing. But for some reason it is failing. So will need to setup my own environment to see if I can figure out what is going on.

    Need more information. The backup you are attempting to run via the Snapshot scheduled task. Is it for the primary site or a sub-site within your Multisite setup?

  • Danny
    • The Incredible Code Injector

    It is for all sites since there is only one instance of WordPress and snapshot is configured at the network level.I just ran that snapshot manually from the snapshot dashboard and it seemed to run just fine. I will need to download and look at it to verify that but there were no errors.

    I am still in the process of building out this network so there are only two sites and two multi-db databases.

  • Danny
    • The Incredible Code Injector

    I downloaded and looked at the snapshot. It appears it did what it was supposed to. However, I don't see data from any tables. Is that not part of the snapshot process? If not, it doesn't look like this plugin is usable for restoring a multisite network and all of its websites. Or am I missing something here?

    thanks

  • Paul
    • The Green Incsub

    @Danny,

    When you unzip the file you should see each table listed in the unzipped root folder. You will see each table as the filename with a .sql extension. Depending on your system where you are extracting the zip archive from snapshot your system may be hiding these .sql files from you. Ir they may not actually be getting included in the archive. You mentioned the last automated backup was Nov 20. Can you download and compare the archives?

    And to be clear on the Snapshot concept it does not backup all sites within a Multisite via a single backup. You must configure each site backup individually. Under Multisite this is done only at the network level. So my assumption is you create a snapshot configuration. This is probably for the primary site. When you go to Snapshots > Add New the first field you see will let you select a different site.

  • Danny
    • The Incredible Code Injector

    Yes, I can see all the .sql and see that data is also included. I thought that snapshot would back up all sites. It's kind of a pain to have to set this up for each site if you are adding hundreds of sites.

  • Paul
    • The Green Incsub

    @Danny,

    Yes, I can see all the .sql and see that data is also included.

    Great. Well that mystery is solved.

    I thought that snapshot would back up all sites. It's kind of a pain to have to set this up for each site if you are adding hundreds of sites.

    Yes, but nowhere in the Snapshot documentation does in imply it is a tool to backup the entire site.

    There are many tools like BackupBuddy which only do whole system backup. There are actually a good half dozen plugins which do this. We on the other hand decided to offer a backup tool for the individual sites. This then makes it easier to setup different schedules for each site. You may have one site backed up daily. And many others only weekly.

    Also with a whole site backup if you need to restore an individual site there is no way to do this. You would need to restore the entire system. Not to mention having a site have a single backup for many many sites would really be a large single archive. Much easier to handle the individual site archives.

    True there is on huge hole in that logician that there is no automatic way to setup a new site or existing sites. And ad you mentioned if you have many hundred or even several dozen creating the snapshot setting for each is a pain. We hope to have a solution for that soon.

    Back to your original issue. I tried testing under my own setup this morning and I'm not having any issues. It might be easier to have access to your site, both wp-admin and FTP, to see if I can discover something. Let me know if you are willing to provide access and I'll provide instructions on where to sent the login details.

    • wp.network
      • The Bug Hunter

      Hey @Paul

      I'm doing a deep-dive in the forums as I hope to jettison BackupBuddy, and am also looking to use Multi-DB.

      Your logic on not supporting network-wide backups is absolutely correct, imho.

      Still, managing the settings for hundreds or thousands (or may I someday have the issue, 100k+) sites is a crazy task.

      I was very thrilled by your mention above

      if you have many hundred or even several dozen creating the snapshot setting for each is a pain. We hope to have a solution for that soon.

      I see nothing in the usage documentation and nothing so far in the forums on this feature. Did it happen?

      Thanks for your work on Snapshot. Its one of the few plugins that I can imagine all WPMUDev members using; aka essential.

      Regards,
      Max

  • Jack Kitterhing
    • Code Norris

    Hi there @Danny

    Hope your well today, just wanted to check in and see where you were on this?

    If you'd like Paul to take a look, you can send the following.

    - In the subject field add "Attn: Paul"
    - Link back to this thread
    - Include admin/network access
    - Include FTP
    - Include any relevant URLS for your site

    On the contact form, select "I have a different question", this ensures it comes through and gets assigned to Paul :slight_smile:

    https://premium.wpmudev.org/contact/

    Thank you!

    Kind Regards
    Jack.

  • Danny
    • The Incredible Code Injector

    Nowhere. It's a big problem as snapshot is not working. It was working to run it manually but that is screwed up now due to a problem with another plugin. It gets a bad lin in the zip file and windows cannot open/read the zip file. Once get that issue resolved and I send the appropriate contact info to work on this problem.

    thanks, I seem to be uncovering a lot of problems with your plugins.

  • Danny
    • The Incredible Code Injector

    Sorry, typing too fast. It should read like this:

    It gets a bad line in the zip file and windows cannot open/read the zip file. Once I get that issue resolved I will send the appropriate contact info to work on this problem.

  • Jack Kitterhing
    • Code Norris

    Hi there Danny,

    Thanks for the additional information, sorry to hear your still having issues with this, on the bad line in the zip, is that one of our plugins or another plugin?

    We do support any WordPress related issues, so if there's anything we can assist with please let us know :slight_smile:

    Thanks!

    Kind Regards
    Jack.

  • Danny
    • The Incredible Code Injector

    The bad line in the zip file was caused by another plugin that was taking an error. So when I would manually run snapshot the error occurred and for some unknown reason that error became the first two lines of the zip file.

    It is strange that the snapshot works when I manually run it but errors off when it runs automatically at its scheduled time.

    I will send the contact info in the next day or so.

    thanks

  • Danny
    • The Incredible Code Injector

    @Paul

    Greetings., I have just gone through the process of rebuilding both of my networks. I setup snapshot and it worked fine. Now it is taking those same errors again.

    I have attached an error log. I need to get this resolved or drop this plugin and find a replacement.

    thanks

  • Paul
    • The Green Incsub

    @Danny,

    Ok. I've downloaded the log. Thanks.

    I see the errors. Could something maybe be corrupt with the data? Not in the database but in the Snapshot settings. The first line is

    [14-Jan-2014 10:09:47 UTC] WordPress database error MySQL server has gone away for query SELECT option_value FROM XXX_options
    WHERE option_name = 'wpmudev_snapshot' made by do_action_ref_array, call_user_func_array, WPMUDEVSnapshot->snapshot_backup_cron_proc, WPMUDEVSnapshot->add_update_config_item, WPMUDEVSnapshot->load_config

    Surely the size of the option is not over the limit of what can be held in the wp_options table value field. It should be set the text which is very very large.

    How many snapshot items do you have? Go to Snapshots > All Snapshots.

  • Danny
    • The Incredible Code Injector

    Seems my response was lost.

    There are 5 snapshots, around 40 meg in size. Is there a size limitation? Seems like this type of mysql error is usually some kind of timeout. Did I need to change execution time setting? Right now it is 30 seconds.

    I don't know about corrupt data. This snapshot worked on Jan 13 and 15 and failed on Jan 14 and 16.

  • Danny
    • The Incredible Code Injector

    Not resolved, However, I changed what is being backed up, removing plugins and themes from the backup and snapshots ran fine. I am wondering if this is a timeout error of some kind. Or if the size of a backup has anything to do with this.

    Is there really any need to include themes and plugins in the backup?

  • Paul
    • The Green Incsub

    @Danny,

    Is there really any need to include themes and plugins in the backup?

    Well technically I would want to include as much as I can. But yeah since most of your plugins can be pulled from remote places like wordpress.org seem redundant to also include those in repeated snapshot archives.

    So back to your issue. Try this. Try running another snapshot. This time don't include any database tables. But for files include only plugins. See if you can get a complete backup. Next to a snapshot for just themes. Then last try one just media/uploads. I'm beating the media/uploads fails. But I'll let you test and report back.

    Going to mark this as unresolved again.

  • Paul
    • The Green Incsub

    @Danny,

    I am continuing to have this problem and I would like to get this solved by someone.

    As it has been a month since your last reply can you please be more specific on the exact problem you are seeing?

    Well, error log is too big. Let me know how to send so that you can review.

    As before can you create the log file on your own site and just provide the link?

  • Paul
    • The Green Incsub

    @Danny,

    Thanks for the link. I've reviewed the log and see plenty of message like

    [24-Feb-2014 16:35:14 UTC] WordPress database error MySQL server has gone away for query UPDATE XX_sitemeta SET meta_value = 'O:8:\"stdClass\":4:

    [24-Feb-2014 16:35:14 UTC] WordPress database error MySQL server has gone away for query SELECT meta_value FROM XXX_wpms_global.gt_sitemeta WHERE meta_key = 'wdp_un_local_themes' AND site_id = 1 made by do_action_ref_array, call_user_func_array, WPMUDEV_Dashboard->refresh_local_projects, WPMUDEV_Dashboard->get_projects, update_site_option, get_site_option, m_wpdb->query

    But these are not really related to Snapshot.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.