Snapshot pro error: 405 NOT ALLOWED nginx/1.12.2

Snapshot stuck at /plugins around 53% and throws this error " error: 405 NOT ALLOWED " my max execution time is set to 0 so that shouldn't be a problem.

  • Ash

    Hello zimrock

    Please add the following in your nginx site specific config file:

    error_page  405     =200 $uri;

    So it might look like:

    server {
        listen       80;
        server_name  test.com;
    
        root   /my/root;
    
        error_page  405     =200 $uri;
    
        location / {
            index  index.html index.htm;
        }
    
        # ...
    }

    Then, make sure you restart your nginx server. Hope it helps! Please feel free to ask more questions if you have any.

    Have a nice day!

    Cheers,
    Ash

  • James Morris

    Hello zimrock,

    Unfortunately, if your host is having this particular error, but does not want to apply the appropriate fix for this, there may not be anything we can do in this particular situation.

    However, if you could provide me with access to your HostGator hosting control panel, I can see if I can find a workaround for this issue for you.

    Please visit the Contact page and complete the form with the following information:

    Subject: "Attn: James Morris"

    In the Message box, please provide the following:

    - link back to this thread for reference
    - any other relevant urls

    - Admin login:
    Admin username
    Admin password
    Login url

    - Hosting Control Panel Login
    Admin username
    Admin password
    Login url

    Best regards,

    James Morris

  • James Morris

    Hello zimrock,

    I've been testing this issue extensively on your server. I've made some pretty dramatic changes to the PHP resources and what I'm finding is that there definitely seems to be a server configuration issue here.

    First, I significantly increased the amount of memory allocated to your site as well as set the execution time to a very high level:

    max_execution_time = 6000
    max_input_time = 6000
    memory_limit = 2048M

    The above is sufficient resources to backup a very large site with gigabytes of data. So, it should have been plenty for your site.

    - I also went through your site and check for any erroneous .git* or .zip files and removed them. There were only a few .git* files.
    - I also checked for symlinks and excessive directory depth. Neither of which are a problem.
    - I monitored CPU usage and your I/O usage. Neither hit their cap.

    I was able to get as far as 96% on plugins before failure. And this was consistent beyond 512M of memory allocated to your site. Nothing I did would get you past that point.

    Finally, as a last measure, I completely eliminated Snapshot and WordPress entirely from the equation and tested a very rudimentary backup solution... I uploaded a file with the following code in it and executed it. This would use PHP to perform a shell (bash) command to manually backup your files:

    <?php
    $back_it_up = shell_exec('tar -czvf ../public_html.tar.gz ./');
    echo $back_it_up;
    echo "<h1>Manually backed up!</h1>";

    This failed with the same error as Snapshot.

    I then checked your PHP error_log in the root of your site and found the following:

    [05-Dec-2017 00:41:14 America/Chicago] PHP Warning:  PHP Startup: imagick: Unable to initialize module
    Module compiled with module API=20100525
    PHP    compiled with module API=20131226
    These options need to match
     in Unknown on line 0
    [05-Dec-2017 00:41:14 America/Chicago] PHP Warning:  PHP Startup: SourceGuardian: Unable to initialize module
    Module compiled with module API=20100525
    PHP    compiled with module API=20131226
    These options need to match
     in Unknown on line 0

    This indicates that there are issues with the configuration of PHP on your account. While these are not necessarily directly related to Snapshot, the fact that these modules are not loading properly indicates there is an issue with how PHP is configured.

    At this point, I'm afraid there is nothing further we can do on our end as we've exhausted what can be done in software. As my simple backup script indicates, this isn't a Snapshot error, but rather a server error.

    My recommendation at this point is to contact your hosting provider and point them to this thread so that they will have a greater understanding of the nature of the problem and can look into your hosting account's configuration deeper.

    While they are at it, I highly recommend upgrading to PHP 7.x. It is a much faster, more stable, and better supported branch. :slight_smile:

    Let us know if you have any further questions. We'll be happy to help! :slight_smile:

    Best regards,

    James Morris

  • zimrock

    Doesn't look good, here was my host response:

    Hello,

    Thank you for contacting Hostgator. I have read the report you provided us in your attachment. The person assisting you reported that they attempted to increase the following PHP limits as below:

    --------------------
    "I significantly increased the amount of memory allocated to your site as well as set the execution time to a very high level:
    max_execution_time = 6000
    max_input_time = 6000
    memory_limit = 2048M"
    --------------------

    Please note that these limits far exceed the limits of our Shared hosting platform: https://www.hostgator.com/help/article/php-settings-that-cannot-be-changed

    Using a PHP script to backup your public_html/ directory, which is 3.8 GB in size, is bound to fail on this platform because the PHP process will invariably time out before the backup creation is completed. This would lead to corrupted backup files and begin to rapidly increase the account's disk usage as well. A better option to maintain backups of your site on a regular basis would be to create a cron job to repeat this task on a schedule of your choice:

    https://www.hostgator.com/help/article/how-do-i-create-and-delete-a-cron-job

    Alternatively, you may be interested in Codeguard, which is an addon we offer that creates backups of your site on a daily basis:

    https://www.hostgator.com/help/article/what-is-codeguard

    Please let us know if you have any questions.

  • James Morris

    Hello zimrock,

    I'm afraid, at this time, Snapshot may not be the best solution for your backup needs. As mentioned by your host, using a PHP application to perform such a large backup, on their platform, is not going to be the most reliable. This is due tot he large size of your backup. On a dedicated server or VPS platform, you have much more control over the resources allocated. But, on a shared environment, you are much more limited.

    We are working on new version of Snapshot that is due to be released in the near future. This new version has a significantly improved backup engine built into it that is designed to be more compatible with restrictive shared hosts. See https://premium.wpmudev.org/roadmap/#wpmud-roadmap-product-snapshot

    I'm afraid I cannot give an exact ETA on when this new version will be released, but development is very active on this as it has been a high demand update.

    Best regards,

    James Morris

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.