• Hello!

    I got a somewhat odd problem with 3 websites on the same server / webhoster. Until the 8th December, the backups worked just fine. Starting on the 9th, the backups on all 3 websites started failing, and the backends were inaccessible.

    Error details
    ==============
    An error of type E_ERROR was caused in line 1251 of the file /home/www/domain.com/wp-content/plugins/updraftplus/admin.php. Error message: Uncaught Error: Call to undefined function disk_free_space() in /home/www/domain.com/wp-content/plugins/updraftplus/admin.php:1251
    Stack trace:
    #0 /home/www/domain.com/wp-content/plugins/updraftplus/admin.php(281): UpdraftPlus_Admin->disk_space_check(36700160)
    #1 /home/www/domain.com/wp-content/plugins/updraftplus/admin.php(580): UpdraftPlus_Admin->setup_all_admin_notices_global('s3generic')
    #2 /home/www/domain.com/wp-content/plugins/updraftplus/admin.php(38): UpdraftPlus_Admin->admin_init()
    #3 /home/www/domain.com/wp-content/plugins/updraftplus/admin.php(8): UpdraftPlus_Admin->__construct()
    #4 /home/www/domain.com/wp-content/plugins/updraftplus/updraftplus.php(104): include_once('/home/www/domai...')
    #5 /home/www/domain.com/wp-content/plugins/updraftplus/class-updraftplus.php(508): updraft_try_include_file('admin.php', 'include_once')
    #6 /home/www/domain.com/wp-includes/class-wp-hook.php(324): UpdraftPlus->admin_menu('')
    #7 /home/www/domain.com/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters('', Array)
    #8 /home/www/domain.com/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
    #9 /home/www/domain.com/wp-admin/includes/menu.php(161): do_action('admin_menu', '')
    #10 /home/www/domain.com/wp-admin/menu.php(417): require_once('/home/www/domai...')
    #11 /home/www/domain.com/wp-admin/admin.php(158): require('/home/www/domai...')
    #12 /home/www/domain.com/wp-admin/plugins.php(10): require_once('/home/www/domai...')
    #13 {main}
      thrown

    No updates of WordPress or any plugins were done in the past few weeks. Disabling UpdraftPlus allows me to access the backends again.

    As I’ve not seen this on any of the other sites I support, I contacted the webhoster. As per their statement, no changes were done on the server side and I was recommended to switch to PHP 8.1 or 8.2 as this will “fix” the issue. But one site is still running a legacy plugin I’m stilling trying to replace, and I’m not ready to so right now. The hoster only allows changing the PHP version globally and not per domain. I was also told that the PHP function disk_free_space is already disabled for “years” and can’t be the cause of the issue.

    I’ve checked the UpdraftPlus logs and I see that something certainly changed between the 8th and the 9th

    Last successful backup on the 8th

    0000.000 (0) Opened log file at time: Fri, 08 Dec 2023 13:58:15 +0000 on https://www.domain.com
    0000.003 (0) UpdraftPlus WordPress backup plugin (https://updraftplus.com): 1.23.13 WP: 6.4.2 PHP: 8.0.30 (apache2handler, Linux host.domain.com 5.10.0-23-amd64 #1 SMP Debian 5.10.179-1 (2023-05-12) x86_64) MySQL: 10.10.5-MariaDB-1:10.10.5+maria~deb11 (max packet size=1073741824) WPLANG: de_DE_formal Server: Apache safe_mode: 0 max_execution_time: 900 memory_limit: 1024M (used: 169.5M | 184M) multisite: N openssl: OpenSSL 1.1.1n  15 Mar 2022 mcrypt: N LANG: C ZipArchive::addFile: Y

    Next backup on the 9th failed

    0000.005 (0) Opened log file at time: Sat, 09 Dec 2023 13:53:30 +0000 on https://www.domain.com
    0000.009 (0) UpdraftPlus WordPress backup plugin (https://updraftplus.com): 1.23.13 WP: 6.4.2 PHP: 8.0.30 (apache2handler, Linux host.domain.com 5.10.0-23-amd64 #1 SMP Debian 5.10.179-1 (2023-05-12) x86_64) MySQL: 10.10.5-MariaDB-1:10.10.5+maria~deb11 (max packet size=1073741824) WPLANG: de_DE_formal Server: Apache safe_mode: 0 max_execution_time: 900 memory_limit: 1024M (used: 169.1M | 180M) multisite: N openssl: OpenSSL 1.1.1n  15 Mar 2022 mcrypt: Y LANG: C ZipArchive::addFile: Y

    As you can see, mcrypt is suddenly available. Or could this be caused by something else? All previous backup logs show mcrypt as N.

    The main question here for me is this: Is there anything else that could cause this issue? From what I see from the source code of UpdraftPlus, you already handle if the function is not available. From admin.php:

    private function disk_space_check($space) {
    		// Allow checking by some other means (user request)
    		if (null !== ($filtered_result = apply_filters('updraftplus_disk_space_check', null, $space))) return $filtered_result;
    		global $updraftplus;
    		$updraft_dir = $updraftplus->backups_dir_location();
    		$disk_free_space = function_exists('disk_free_space') ? @disk_free_space($updraft_dir) : false;// phpcs:ignore Generic.PHP.NoSilencedErrors.Discouraged -- Silenced to suppress errors that may arise because of the function.
    		if (false == $disk_free_space) return -1;
    		return ($disk_free_space > $space) ? true : false;
    }

    So technically we shouldn’t run into this issue with UpdraftPlus?

    Let me know if you need any other information to look into this.

Viewing 15 replies - 1 through 15 (of 15 total)
  • Plugin Contributor bcrodua

    (@bcrodua)

    Hi

    To help us work out the cause of your problem, can you please send us a copy of the backup log for each site? This log can be found in the Existing Backups tab of the UpdraftPlus dashboard.
    If you cannot access the UpdraftPlus dashboard, then you can find the log file in the ‘wp-content/updraft’ directory via FTP or your hosts’ file manager.

    Best Wishes,
    Bryle

    Thread Starter TryAllTheThings

    (@roots84)

    Where can I send you the logs without having to censor every single one of them? And if you just want the ones created after the issue started: The log just contains what I already posted above.

    Plugin Support vupdraft

    (@vupdraft)

    Hi,

    I am afraid that due to WordPress rules, you can only post logs here using a tool such as pastebing.com. You can replace your site name with something like mysite if you do not wish for us to see it (there is no reason for us to in this case)

    If your backups are not working we really do need to see your logs though.

    I would agree that the function disk_space_check is not likely to cause the issue. This error just says that it can’t check your disk quota

    When we see an undefined function error, it is almost always caused by a plugin conflict.

    Do you see anything else in your php error logs, can you try deactivating your other plugins and seeing if the issue persists, if it does not can you reactivate your plugins one by one.

    Thread Starter TryAllTheThings

    (@roots84)

    If your backups are not working we really do need to see your logs though.

    It’s not just the backups that stopped working. The whole backend is inaccessible while UpdraftPlus is enabled. As soon as you log into the backend, you are greeted with:

    There has been a critical error on this website. Please check your site admin email inbox for instructions.
    
    Learn more about troubleshooting WordPress.

    I did some testing on the site with the least customization to rule out any other issues. It’s pretty much a standard WordPress installation with 4 plugins and the Accelerate theme. Even with all plugins except UpdraftPlus disabled, I run into this issue. As soon as UpdraftPlus is disabled, everything works as it should. I even switched to the default theme (although it shouldn’t matter for the backend anyway) the issue persisted.

    As for the logs: Like I said, the logs are pretty much empty since the issue started. It is just the “header”. Every single log after the 8th looks like this.

    0000.005 (0) Opened log file at time: Sat, 09 Dec 2023 13:53:30 +0000 on https://www.domain.com
    0000.009 (0) UpdraftPlus WordPress backup plugin (https://updraftplus.com): 1.23.13 WP: 6.4.2 PHP: 8.0.30 (apache2handler, Linux host.domain.com 5.10.0-23-amd64 #1 SMP Debian 5.10.179-1 (2023-05-12) x86_64) MySQL: 10.10.5-MariaDB-1:10.10.5+maria~deb11 (max packet size=1073741824) WPLANG: de_DE_formal Server: Apache safe_mode: 0 max_execution_time: 900 memory_limit: 1024M (used: 169.1M | 180M) multisite: N openssl: OpenSSL 1.1.1n  15 Mar 2022 mcrypt: Y LANG: C ZipArchive::addFile: Y

    The backup is scheduled for 14:30 and usually around 16:00 I get the WordPress email that our site has a technical issue

    Error details
    ==============
    An error of type E_ERROR was caused in line 1251 of the file /home/www/domain.com/wp-content/plugins/updraftplus/admin.php. Error message: Uncaught Error: Call to undefined function disk_free_space() in /home/www/domain.com/wp-content/plugins/updraftplus/admin.php:1251
    Stack trace:
    #0 /home/www/domain.com/wp-content/plugins/updraftplus/admin.php(281): UpdraftPlus_Admin->disk_space_check(36700160)
    #1 /home/www/domain.com/wp-content/plugins/updraftplus/admin.php(580): UpdraftPlus_Admin->setup_all_admin_notices_global('s3generic')
    #2 /home/www/domain.com/wp-content/plugins/updraftplus/admin.php(38): UpdraftPlus_Admin->admin_init()
    #3 /home/www/domain.com/wp-content/plugins/updraftplus/admin.php(8): UpdraftPlus_Admin->__construct()
    #4 /home/www/domain.com/wp-content/plugins/updraftplus/updraftplus.php(104): include_once('/home/www/domai...')
    #5 /home/www/domain.com/wp-content/plugins/updraftplus/class-updraftplus.php(508): updraft_try_include_file('admin.php', 'include_once')
    #6 /home/www/domain.com/wp-includes/class-wp-hook.php(324): UpdraftPlus->admin_menu('')
    #7 /home/www/domain.com/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters('', Array)
    #8 /home/www/domain.com/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
    #9 /home/www/domain.com/wp-admin/includes/menu.php(161): do_action('admin_menu', '')
    #10 /home/www/domain.com/wp-admin/menu.php(417): require_once('/home/www/domai...')
    #11 /home/www/domain.com/wp-admin/admin.php(158): require('/home/www/domai...')
    #12 /home/www/domain.com/wp-admin/plugins.php(10): require_once('/home/www/domai...')
    #13 {main}
      thrown

    Nothing is written to the PHP error log when the scheduled backup is running. Only when I try to access the backend, this is added:

    [23-Dec-2023 17:29:19 UTC] PHP Fatal error:  Uncaught Error: Call to undefined function disk_free_space() in /home/www/domain.com/wp-content/plugins/updraftplus/admin.php:1251
    Stack trace:
    #0 /home/www/domain.com/wp-content/plugins/updraftplus/admin.php(281): UpdraftPlus_Admin->disk_space_check(36700160)
    #1 /home/www/domain.com/wp-content/plugins/updraftplus/admin.php(580): UpdraftPlus_Admin->setup_all_admin_notices_global('s3generic')
    #2 /home/www/domain.com/wp-content/plugins/updraftplus/admin.php(38): UpdraftPlus_Admin->admin_init()
    #3 /home/www/domain.com/wp-content/plugins/updraftplus/admin.php(8): UpdraftPlus_Admin->__construct()
    #4 /home/www/domain.com/wp-content/plugins/updraftplus/updraftplus.php(104): include_once('/home/www/domai...')
    #5 /home/www/domain.com/wp-content/plugins/updraftplus/class-updraftplus.php(508): updraft_try_include_file('admin.php', 'include_once')
    #6 /home/www/domain.com/wp-includes/class-wp-hook.php(324): UpdraftPlus->admin_menu('')
    #7 /home/www/domain.com/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters('', Array)
    #8 /home/www/domain.com/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
    #9 /home/www/domain.com/wp-admin/includes/menu.php(161): do_action('admin_menu', '')
    #10 /home/www/domain.com/wp-admin/menu.php(417): require_once('/home/www/domai...')
    #11 /home/www/domain.com/wp-admin/admin.php(158): require('/home/www/domai...')
    #12 /home/www/domain.com/wp-admin/plugins.php(10): require_once('/home/www/domai...')
    #13 {main}
      thrown in /home/www/domain.com/wp-content/plugins/updraftplus/admin.php on line 1251

    Unless there is another log that UpdraftPlus creates somewhere else, this is all I can give you log-wise.

    Plugin Support vupdraft

    (@vupdraft)

    Hi,

    Apologies for the delay, I think you might have a plugin conflict. Can you deactivate your other plugins and try running a backup and then check if the backup runs, if it does, can you reactivate your plugins one by one until you find the offending one?

    Thread Starter TryAllTheThings

    (@roots84)

    I’m quoting myself:

    Even with all plugins except UpdraftPlus disabled, I run into this issue. As soon as UpdraftPlus is disabled, everything works as it should. I even switched to the default theme (although it shouldn’t matter for the backend anyway) the issue persisted.

    The offending plugin is UpdraftPlus.

    Plugin Support vupdraft

    (@vupdraft)

    Apologies, can you post your full backup log using a tool such as pastebin.com

    Can you try adding the following to your wp-config.php

    define(‘UPDRAFTPLUS_SKIP_CPANEL_QUOTA_CHECK’, true);

    Thread Starter TryAllTheThings

    (@roots84)

    I provided you all the logs I got in my previous posts. They contain just the “header” for each backup run.

    0000.005 (0) Opened log file at time: Sat, 09 Dec 2023 13:53:30 +0000 on https://www.domain.com
    0000.009 (0) UpdraftPlus WordPress backup plugin (https://updraftplus.com): 1.23.13 WP: 6.4.2 PHP: 8.0.30 (apache2handler, Linux host.domain.com 5.10.0-23-amd64 #1 SMP Debian 5.10.179-1 (2023-05-12) x86_64) MySQL: 10.10.5-MariaDB-1:10.10.5+maria~deb11 (max packet size=1073741824) WPLANG: de_DE_formal Server: Apache safe_mode: 0 max_execution_time: 900 memory_limit: 1024M (used: 169.1M | 180M) multisite: N openssl: OpenSSL 1.1.1n  15 Mar 2022 mcrypt: Y LANG: C ZipArchive::addFile: Y

    Adding ‘UPDRAFTPLUS_SKIP_CPANEL_QUOTA_CHECK’ does not change the error message or fix the issue.

    Plugin Support vupdraft

    (@vupdraft)

    I can see the headers form the backups but even after rechecking the thread, I don’t see a full backup log

    Thread Starter TryAllTheThings

    (@roots84)

    Like I wrote already a couple of times: This is all that is inside the backup logs. There is nothing else following the “header”.

    Plugin Support vupdraft

    (@vupdraft)

    Apologies, I thought your were omitting the rest of your log as you have only posted the header for the successful backup (there should be a full log file for this)

    Can you ask your host your host enable that function since it’s part of the PHP core?https://www.php.net/manual/en/function.disk-free-space.php

    I think your web hosting company has removed this particular function. On earlier php versions, removing the function just caused it to return an empty result; but from PHP 8.0, it throws an error. Your hosting should really be able to enable this function for you without you having to update though.

    I notice you are on php version 8.0.20, have you recently updated to this from an earlier version?

    I will ask one of our developers to take a look at this and see if we can update the plugin to handle this exception

    Plugin Support vupdraft

    (@vupdraft)

    Hi,

    We have been trying to replicate this. We do not get a fatal error even when this function is disabled. Can you ask your hosting for details of why updating the php version fixes this and ask them what they believe the underlying cause is?

    Thread Starter TryAllTheThings

    (@roots84)

    Can you ask your host your host enable that function since it’s part of the PHP core?https://www.php.net/manual/en/function.disk-free-space.php

    As per the webhoster, no changes were made and the PHP function was disabled for a long time already. They have no interest in enabling it. I couldn’t get any other information or clarification from them.

    But from what I understand it shouldn’t matter if this function is enabled or not since you have error handling for this in place.

    ?Can you ask your hosting for details of why updating the php version fixes this and ask them what they believe the underlying cause is?

    They told me they had the same issue with UpdraftPlus with other customers as well, and “fixed” it by changing PHP to version 8.1. Couldn’t get any more information from them besides repeating this over and over.

    Meanwhile, I was able to “fix” the issue for one site by disabling UpdraftPlus via FTP and re-enabling it via the WordPress plugin management. No code or configuration changes were made.

    On another site (on the same server), I could “fix” the issue by disabling UpdraftPlus via FTP, updating it to the latest version (1.23.16) and enabling it again.

    The only idea I got for this issue is something within WordPress itself, as both sites did an automatic update as soon as the error was fixed by disabling UpdraftPlus.

    Plugin Support vupdraft

    (@vupdraft)

    Hi,

    You are correct, I disabled the function in my php.ini and there was error handling there and I did not get a fatal error.

    Who is your hosting with?

    Thread Starter TryAllTheThings

    (@roots84)

    Who is your hosting with?

    Not really a webhoster. Just at IT company offering hosting services as well while just renting the server somewhere else. Complicated story.

    Two sites were fixed by the method described earlier. For the third site I switched to PHP 8.1 and the issue was gone as well. Configuration for PHP 8.1 was almost identical to 8.0, so I have no clue where this issue came from and why it magically solves itself.

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘[Bug?] UpdraftPlus breaks Backend – Call to undefined function disk_free_space()’ is closed to new replies.