Snapshot – admin-ajax.php 404's and stalls backups

Managed Backups and Snapshots fail consistently when trying to backup Files. Every time, the console shows a 404 on admin-ajax.php.

  • Kasia Swiderska
    • Support nomad

    Hello Thalia,

    I am really sorry about the inconveniences you are having with regards to using our Snapshot plugin and I hope we resolve it soon.

    Can you contact your host to find out if they are blocking/limiting requests to any files or especially the file ‘yourdomain.com/wp-admin/admin-ajax.php’, if they are then you should ask they whitelist this file for your domain as it is required to process Snapshots along with a lot other requests from other plugins and even WordPress core and your theme.

    Here is a template message you can send to your host:

    Hello,

    I have a website running WordPress and it uses a backup plugin that makes requests to the file: 'http://mydomain.com/wp-admin/admin-ajax.php', the file exists but at some point a request to this file returns a 404 (Not Found) error.

    Request URL:http://mydomain.com/wp-admin/admin-ajax.php
    Request Method:POST
    Status Code:404 Not Found
    Remote Address:160.153.44.193:80
    Response Headers
    view source
    Cache-Control:no-cache, must-revalidate, max-age=0
    Connection:close
    Content-Encoding:gzip
    Content-Length:9067
    Content-Type:text/html; charset=UTF-8
    Date:Fri, 15 Sep 2017 22:09:38 GMT
    Expires:Wed, 11 Jan 1984 05:00:00 GMT
    Link:<http://mydomain.com/wp-json/>; rel="https://api.w.org/"
    Server:Apache/2.4.25
    Vary:Accept-Encoding,User-Agent
    X-Powered-By:PHP/7.1.7
    Request Headers
    view source

    I was wondering if you have firewall rules that limit the number of requests to this file. If yes, would you please raise the limit or allow the file to be requested without limit for my website.
    Thanks.

    Would you please contact your host and find out if they have such rules that limit access to files. Please let us know what they say so we can proceed with this.

    I hope this helps.

    kind regards,

    Kasia

  • Thalia
    • Flash Drive

    Hi Kasia,

    Thanks so much for your reply.

    My hosting is on GoDaddy cPanel Level 2. I talked to GoDaddy’s support and they assured me that there is no limit or firewall, and that I have unlimited bandwidth on my plan.

    Could there be a different issue?

    Thanks,

    Thalia

  • Kasia Swiderska
    • Support nomad

    Hello Thalia,

    I’m very sorry for the late response on my side. I’m going to bring one of our Second Line Support developers to check issue on your site.

    I will need you to send me WP admin access because support access is not working on your site. That can be temporary admin account that you can remove after we will finish checking site.

    Please send in the following via our secure contact form https://premium.wpmudev.org/contact/#i-have-a-different-question :

    – Mark to my attention, the subject line should contain only: ATTN: Kasia Swiderska

    – Do not include anything else in the subject line, doing so may delay our response due to how email filtering works.

    – Link back to this thread

    – Include WordPress admin access details (login address, username & password)

    – Include any relevant URLs for your site

    IMPORTANT: Please make sure you select “I have a different question” for your topic, so it doesn’t go back to the forums – this and the subject line ensure that it gets assigned to me.

    Please confirm here that you send those credentials

    kind regards,

    Kasia

  • Lindeni Mahlalela
    • Recruit

    Hello Thalia,

    I hope you are doing great today. I am very sorry that you have issues using our Snapshot plugins and all the inconveniences that may have been caused. Thank you so much for your patience while we are looking into this issue you are having on your website.

    I had a look into your site and checked the files via FTP and looked at the files. I found a few folders that do not seem to be related to WordPress including a shortcut/symbolic link named formamailer.php, this file was placed by your host so we don't remove it, as for the other files I am not sure what they are but seems to be remains of a previous website or CMS.

    This means that Snapshot has a lot of processing to do, unfortunately for Symbolic links it will fail if they are pointing to files residing outside your WordPress folder or if those links/shortcuts point to folders with other symbolic links/shortcuts in them. To improve the performance of Snapshot, I have added the following to your wp-config.php file

    define('SNAPSHOT_FILESET_CHUNK_SIZE', 10);
    define('SNAPSHOT_TABLESET_CHUNK_SIZE', 100);
    define('SNAPSHOT_FILESET_LARGE_FILE_SIZE', 104857600); /**skip files larger than ~100MB**/
    if (!defined('SNAPSHOT_FORCE_ZIP_LIBRARY')) define('SNAPSHOT_FORCE_ZIP_LIBRARY', 'pclzip'); //use PclZip library
    if (!defined('SNAPSHOT_IGNORE_SYMLINKS')) define('SNAPSHOT_IGNORE_SYMLINKS', true); //skip symbolic links

    I also went to "Snapshot > Settings" and in the Global File Exclusions I listed all the files that should not be included in the backup. After that, I regenerated the Snapshots you had and also created a new one, all were successful.

    I did this on Harris Pillow website, the only thing that does not work now is the Managed Backups and I think this is highly related to the Server I/O which limits the number of disk read/write operations. I am not saying this is the cause but I think it is because I have seen it before. Unfortunately, I cannot verify this unless I have access to your cPanel account. I replied to the email you sent to my Colleague Kasia, not sure if you received it but please send the cPanel login for the websites so I can double check if I am right or not.

    You mentioned that you were on Level 2 hosting on Godaddy, I checked the resource limit for level 2 and the I/O looks the same as the one I have seen before where Snapshot was failing because this limit was reached, but it was on another host.

    I suggest you send in the cPanel login details for both websites so I can have a closer look at the resource usage while Snapshot is running. You need to atleast sent in the FTP details of the other site so we can do what we did for Harris Pillow to make regular Snapshot work. You may send this via our secure contact form, in the subject field, type "Attn: Lindeni Mahlalela" then in the message box include:

    – cPanel login (login url, username and password) – for both CargoComposites and Harris Pillow website

    – FTP login for CargoComposites (ftp host, port, username and password) – not necessary if you provided FTP

    – Link back to this thread for reference

    Once you have done that we will continue with the investigation. Please let us know if you need help with anything else.

    Have a nice day.

    Mahlamusa

  • Lindeni Mahlalela
    • Recruit

    Hello Thalia

    Thank you so much for sending the requested information. I had another run of Snapshot, while running I monitored cPanel.

    I have noticed in cPanel that I/O usage shoot to about 40% when processing the database and shoots to 100% when starting to process the files.

    While still on the WordPress files it fluctuates between about 70% and 100% then cPanel throws an alert saying:

    Alert! We suggest a resource upgrade. Not upgrading could result in website downtime.

    When processing plugins, it says at 100% because the plugins folder has a lot of small files and that requires a lot of read and write (I/O) activity. It is on the plugins step that the server returns a 404 not found which causes Snapshots to stall and throw an error.

    I also go a database connection error while I was trying to save some settings. This is another proof that the server is limited, this might be caused by the limited number of connections to the database:

    If the host's control panel suggests an upgrade then it seems that is an option to consider if you want to backup everything. I see in their levels table, the next level you can upgrade to is level 3 which has twice the I/O usage at 2048Kb/s. Maybe this will work but I cannot guarantee, the host can help if you ask.

    The other option to is to exclude the plugins from backups to get a backup of other things, if something goes wrong then you will have to install the plugins manually and restore everything else from the Snapshot. If that is not the case then you should consider upgrading your hosting account.

    I hope this helps. Please let us know if you have any doubts or concerns about this. We are always happy to help in any way possible.

    Way forward:

    – Upgrade your account or contact your host to see if the can raise the I/O usage without the need for an upgrade. OR

    – Exclude plugins in the backup and backup everything else (You will have to manually install the plugins in case you need to restore)

    – If all fails: Find another host. Make sure to check their I/O usage before you signup as most host don't include these in their package description (Even if they say its unlimited hosting)

    Have a nice day.

    Mahlamusa

  • Thalia
    • Flash Drive

    Hi Mahlamusa,

    I have contacted GoDaddy and already upgraded the resources. I still cannot perform Managed Backups. Snapshots do work though, with the php rules that you provided.

    However, I have added the same php rules on my other websites, cargocomposites.com and summitworx.com, but the Snapshot still fails to complete. I also have the same issue with Managed Backups on those too, that doesn’t work either.

    Unfortunately, GoDaddy is the first choice for hosting for many of my clients, so we have to make this work somehow, because most of them have more than just hosting on GoDaddy and they are reluctant to move to a second provider.

    Thanks, looking forward to your reply!

    Thalia

  • Lindeni Mahlalela
    • Recruit

    Hello Thalia

    I hope you are doing great today. I am so sorry that this is not working for you on other sites but I hope we will be able to try and find a solution. Thank you so much for the feedback we will follow up on that and see what we can do.

    I have attempted to create a Managed Backup on summitworx and checked the resource usage on the cPanel account and it seems we are having the same problem. The account's total Memory Limit is 515M and the I/O is about 1Mb which is the same limit we were having issues with before.

    When these limits are hit, there is an alert displayed in cPanel recommending a resource upgrade:

    Once this happens the website turns to a bank page which keeps on showing the loading icon and if I attempt to refresh cPanel it takes ages to load. So again this makes me conclude that this is an issue with resource limits on the server and even the host acknowledges this by showing the alert recommending a resource upgrade – I guess they are selling :slight_smile:

    As for cargocomposites, it failed at plugins for a regular Snapshot but unfortunately the cPanel access I have for this account was not working so I was unable to see what's going on there in terms of resource usage.

    We would love to help resolve this but it still seems to be a resource limit on each of the accounts and unfortunately that can only be resolved by upgrading server resources as recommended by the host. For now I would recommend an upgrade for the accounts having issues, I see you mentioned that you contacted GoDaddy and they upgraded the resources but for the account I last checked the resources are still to low – would you please verify this for each account?

    Please let us know if you need help with anything regarding this and we will be happy to help in any way possible.

    Have a nice day.

    Mahlamusa

  • Thalia
    • Flash Drive

    Hi Mahlamusa,

    It’s been a while since we looked into this issue last. I now have the latest version of Snapshot on all of my websites and I am able to generate managed backups on all of them (there are more than 30 websites right now) except these 3 websites: cargocomposites.com, harrispillow.com, and summitworx.com (I have created a separate ticket for the latter) — I was hoping that waiting for a bit until the next Snapshot versions could help resolve my issues but it didn’t. Right now I have no way of creating backups for those websites. What do you suggest?

    Thanks!

  • Rupok
    • Support Ninja

    Hi Thalia,

    I’m so sorry to hear the inconvenience you are having again.

    As you mentioned three sites where the managed backup is not working, I’ve initiated a managed backup on “http://cargocomposites.com” and after a couple of minutes, same admin-ajax 404 appeared.

    Can you please try one more workaround? That is – open your wp-config.php file and search for the following lines:

    define('SNAPSHOT_FILESET_CHUNK_SIZE', 10);
    define('SNAPSHOT_TABLESET_CHUNK_SIZE', 100);

    If you find those two lines, please replace both 10 and 100 with 5. If you don’t see those lines in your wp-config.php file, please add the following lines in your wp-config.php file:

    define('SNAPSHOT_FILESET_CHUNK_SIZE', 5);
    define('SNAPSHOT_TABLESET_CHUNK_SIZE', 5);

    Then save the wp-config.php file and try to create another managed backup and let us know the result. If it still doesn’t work, we will investigate further.

    I’m looking forward to hearing from you and resolving this issue as soon as possible.

    Regards,

    Rupok

  • Thalia
    • Flash Drive

    Hi Kasia, I have tried everything that was suggested, but it doesn’t work. I keep getting notifications from Automate that my backup failed so nothing was updated. This is now happening with 6 of my sites, the number is increasing and this is getting more frustrating. I realize that this may be because of high I/O usage, but that sounds like something that could be improved in the way Snapshot makes its backups, as other backup services I tried on the same sites seem to work.

    I’ve been experiencing these issues and have been posting on the support forum for over 1,5 year — it seems to me that Snapshot should have been improved by now to resolve these issues. Most of the sites that don’t work are hosted on GoDaddy cPanel, and thinking that this is a quite popular hosting choice I am pretty sure that I’m not the only one experiencing those. Adding to that the fact that for the sites that are able to make a backup through Snapshot, most of the times I am unable to restore the backups due to some error and I have to run to support in those moments of crisis (and these are all just Snapshot issues, I’m not even going into the Defender topic right now) — then you understand that I kinda question whether I should be paying the pricey monthly fee and keep on supporting and helping improve these products merely because I believe in what you’re trying to achieve.

  • Patrick Freitas
    • Staff

    Hi Thalia

    Sorry to hear that issue persists,

    Indeed the I/O is a big problem for Snapshot; we are working to improve it.

    I will be escalating this thread to our Second Line Support for a closer look on this.

    Note, Second Line Support deal with more complex issues; it can cause a delay on the replay. Once the SLS support replies, you will get an e-mail notification.

    Best Regards,

    Patrick Freitas

  • Konstantinos Xenos
    • Rubber Duck Debugger

    Hi Thalia ,

    I’ve just finished testing Snapshot on http://www.harrispillow.com.

    You’ll find 3 Managed Backups that were successfully uploaded to our servers as well as 2 Snapshots.

    There doesn’t seem to be any issue at all with the backup process itself but there are a couple of things that I noticed that you’ll have to address with your Hosting provider and have under consideration.

    First of all there’s a 2 MB/s I/O limitation, even though the backups finished successfully one after the other at the time being that doesn’t mean that it will always be the case. If the server is generally loaded at any time from other websites/clients as well it might want to start shutting down processes that are close to the limits so it can cool down again.

    On a second note it seems that WP Cron isn’t working properly and sometimes it doesn’t even fire at all. I don’t see any defines in your wp-config.php to disabled it though so that might be a more general issue with the installation.

    WP Cron is used as a “timer” so WordPress scheduled tasks can run properly. Snapshot along with other plugins and even WP rely on it for various tasks such as scheduled backups, checking for updates so on so forth.

    I’d suggest to talk with your hosting provider and ask them to set up server-side crons for you so you don’t have to rely on WP’s “internal clock” to have everything working as expected and on time. This is a common practice on websites that wan’t their backups and other functionalities to run always on time and without skipping events.

    Tell me if you need any further help with this or any extra information.

    Regards,

    Konstantinos

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.