incorrectly detecting server timeout

When I go to add a new backup in status I see the following message:

Your web server timeout is set very low, 0 seconds. Also, it appears this timeout cannot be adjusted via the Snapshot backup process. Attempting a snapshot backup could result in a partial backup of your tables.

However, phpinfo() shows that my max_execution_time is set to 30. Screenshot shows the error and phpinfo() side-by-side on the same site.

  • Paul
    • The Green Incsub

    taisweb, thanks for the extra screenshot. Basically, the snapshot plugin gets the current value of your 'max_execution_time' php setting via ini_get('max_execution_time':wink: It then tried to triple this value and set the value via php ini_set('max_execution_time':wink:; If it cannot adjust the timeout and the current timeout is less than 60 seconds then the warning message above the form is displayed. When you actually run the snapshot the timeout will automatically be set depending on the table size. So this is why you do not see a Setting to adjust the timeout.

    More curious is why you are seeing 0 from within WordPress. Possibly there is some setting in your .htaccess or some other plugin affecting this value. Possibly.

    As for the scheduled snapshot not working. What information can you provided? This uses the standard WordPress Cron API. The WP Cron API is not perfect and does require front-end traffic to kick off the cron processing. Try setting the interval to 5 minutes for testing. On the All Snapshot screen in the 'Interval' column you should see selected Interval and below it should should see when the next run will take place. Something like the attached image.

  • taisweb
    • WPMU DEV Initiate

    I verified that there is no setting in .htaccess that would effect this. Even if there were, wouldn't that override the display in phpinfo() as well since it is called from the same domain? I'm attaching it anyway. [edit: extension denied, attached as htaccess.txt]

    Also attached is the display of my scheduled snapshot, which just says "No Snapshot file found"

  • Paul
    • The Green Incsub

    Thanks for the .htaccess file and the new screenshot. Correct if from the same domain the .htaccess should override the display in the phpinfo(). But what I was getting at before is the phpinfo() is running outside of WordPress. Assumed you setup a stand alone phpinfo.php containing <?php phpinfo(); ?>
    So even if there was some setting in your .htaccess file setting the timeout you can still have something in your theme or other plugins overriding that. Which would not show in the stand along phpinfo output.

    I'm still researching. Still puzzled why a simple ini_get('max_execution_time') returns zero. Not sure it if is related to the scheduled cron issue. Will get back to you soon.

  • Paul
    • The Green Incsub

    Actually after thinking about this a zero value is valid. But it means your server will never timeout a request. Again I think something somewhere in your site is setting this to '0'. I'll change the Snapshot code to allow for zero. And if non-zero and below the 60 seconds limit I'll prompt the error you reported.

    As for the scheduled snapshot issue can I ask that for now you install one of the available Cron display plugins The WP-Cron Dashboard will probably do it. I'm looking to see if you show the snapshot cron request in your cron listing. This should show as something with a value 'snapshot_backup_cron' in the listing. If you don't want to install a plugin I'll setup some debug output via snapshot which will provide the details I'm looking for.

  • taisweb
    • WPMU DEV Initiate

    I went into the plugin editor and added "echo phpinfo();" to the top of the function snapshot_utility_check_server_timeout().

    Here is a link to the output:
    Evernote: Shared Note

    As you can see from the output, something is indeed setting the timeout to zero before Snapshot gets to it, possibly a plugin, because the local and default settings are different. I don't know how I can figure out where it is being set, though.

    I think accepting a zero value as valid is probably the correct method, since as you say it means "no timeout".

    As for the other issue, I installed WP-Cron Dashboard and I can see the cron job "snapshot_backup_cron" exists. Screenshot attached.

  • Paul
    • The Green Incsub

    I would not worry about the zero timeout. As I mentioned I will correct the snapshot code to not show an error on the zero value. But for your protection the snapshot script will set the timeout for it's own needs to 60 seconds. When you use the immediate snapshot option (not scheduled) it will set this during the AJAX calls. Once this finishes the timeout will revert back to the default zero value.

    For the cron issue I'm not sure. I know using the WordPress cron requires front-end traffic to keep things pushing along. So try this try to delete the cron entry via that plugin interface. Then go back to list the snapshots. Edit the one scheduled entry and set the Interval to the every 5 minutes option. This is for testing. You can always set it back later. Save the snapshot which will create a new WP cron instance. Double check this via the cron plugin output. At this point ensure you have regular traffic to the front-end of your site. Let me know if the snapshot process finally fires.


  • aecnu
    • WP Unicorn

    Greetings taisweb,

    Just checking if this issue was eventually resolved in another thread? Or by yourself separately to us? Or by us over email with you? Or using our live support?

    If so, no need to reply, that's great news.

    If not, or you have any more questions related to this thread, please feel free to post them below including any new symptoms or errors and tick the 'Mark as Not Resolved (re-open)' box below the post area (or else we'll miss it!)

    Otherwise, happy days, glad you got it sorted :slight_smile:

    Thank you for being a WPMU Dev member!

    Cheers, Joe

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.