wp-media / backwpup

BackWPup - WordPress Backup Plugin
https://backwpup.com
GNU General Public License v2.0
88 stars 37 forks source link

Wordpress ERROR: Exception caught in Error: Call to undefined function GuzzleHttp\Psr7\uri_for() #113

Open the1bit opened 3 years ago

the1bit commented 3 years ago

Hi,

I have been using your tool for ages. And some weeks ago my backup job fails every time with the following error: ERROR: Exception caught in Error: Call to undefined function GuzzleHttp\Psr7\uri_for()

Accordingly, I have no backup now. :-(

Steps to reproduce the behavior:

  1. Click Run job now
  2. Wait some minutes then you can see it fails
  3. No backup

Expected behavior Run without error and do backup

System (please complete the following information):

Detailed error log:

[INFO] BackWPup 3.8.0; A project of Inpsyde GmbH
[INFO] WordPress 5.7.1
[INFO] Log Level: Normal
[INFO] BackWPup job: Weekly Backup
[INFO] Logfile is: backwpup_log_daf44a_2021-04-27_20-37-37.html
[INFO] Backup file is: 2021-04-27_20-37-37_6FZH2WCQ01.tar.gz
[27-Apr-2021 20:37:38] 1. Try to backup database …
[27-Apr-2021 20:37:39] Connected to database on myprod.mysql.database.azure.com
[27-Apr-2021 20:37:41] Added database dump "backup.sql.gz" with 1,75 MB to backup file list
[27-Apr-2021 20:37:41] Database backup done!
[27-Apr-2021 20:37:41] 1. Trying to make a list of folders to back up …
[27-Apr-2021 20:39:14] Added "wp-config.php" to backup file list
[27-Apr-2021 20:39:14] 3309 folders to backup.
[27-Apr-2021 20:39:14] 1. Trying to generate a file with installed plugin names …
[27-Apr-2021 20:39:15] Added plugin list file "pluginlist.2021-04-27.txt.gz" with 2,13 KB to backup file list.
[27-Apr-2021 20:39:15] 1. Trying to generate a manifest file …
[27-Apr-2021 20:39:15] Added manifest.json file with 5,36 KB to backup file list.
[27-Apr-2021 20:39:32] 1. Trying to create backup archive …
[27-Apr-2021 20:39:32] Compressing files as TarGz. Please be patient, this may take a moment.
[27-Apr-2021 20:45:38] Backup archive created.
[27-Apr-2021 20:45:38] Archive size is 87,03 MB.
[27-Apr-2021 20:45:38] 19577 Files with 264,92 MB in Archive.
[27-Apr-2021 20:45:38] 1. Trying to send backup file to S3 Service …
[27-Apr-2021 20:45:40] ERROR: Exception caught in Error: Call to undefined function GuzzleHttp\Psr7\uri_for()
[27-Apr-2021 20:45:54] 2. Trying to send backup file to S3 Service …
[27-Apr-2021 20:45:54] ERROR: Exception caught in Error: Call to undefined function GuzzleHttp\Psr7\uri_for()
[27-Apr-2021 20:46:06] 3. Trying to send backup file to S3 Service …
[27-Apr-2021 20:46:06] ERROR: Exception caught in Error: Call to undefined function GuzzleHttp\Psr7\uri_for()
[27-Apr-2021 20:46:08] ERROR: Step aborted: too many attempts!
[27-Apr-2021 20:46:08] 1. Try sending backup to a Microsoft Azure (Blob) …
[27-Apr-2021 20:46:09] ERROR: Exception caught in Error: Call to undefined function GuzzleHttp\choose_handler()
[27-Apr-2021 20:46:17] 2. Try sending backup to a Microsoft Azure (Blob) …
[27-Apr-2021 20:46:17] ERROR: Exception caught in Error: Call to undefined function GuzzleHttp\choose_handler()
[27-Apr-2021 20:46:21] 3. Try sending backup to a Microsoft Azure (Blob) …
[27-Apr-2021 20:46:21] ERROR: Exception caught in Error: Call to undefined function GuzzleHttp\choose_handler()
[27-Apr-2021 20:46:28] ERROR: Step aborted: too many attempts!
[27-Apr-2021 20:46:28] 1. Trying to check database …
[27-Apr-2021 20:46:30] Database check done!
[27-Apr-2021 20:46:30] ERROR: Job has ended with errors in 533 seconds. You must resolve the errors for correct execution.
JonnyTech commented 3 years ago

Important missing detail: what version of PHP is running on the Wordpress server?

the1bit commented 3 years ago

Hi,

You are right.

PHP version: 7.2

JonnyTech commented 3 years ago

You seem to be hitting issue #94, try downgrading any other instances of GuzzleHttp to v6.5.5.

the1bit commented 3 years ago

Could you please help me how I can do it? Thx

JonnyTech commented 3 years ago

Which wordpress plugins have you installed?

the1bit commented 3 years ago

There are several ones. Latest was the online invoice maker for Woocommerce.

JonnyTech commented 3 years ago

I cannot help you unless you list full names of all installed plug-ins.

the1bit commented 3 years ago

Plugin Name: Integration for Billingo & WooCommerce Version: 2.5.0

the1bit commented 3 years ago

I checked the plugin related files. I cannot find GuzzleHttp but I found BuzzleHttp.

Additionally I found the choose_handler part in vendor/buzzlehttp/buzzle/src/functions.php:

function choose_handler()
{
    $handler = null;
    if (function_exists('curl_multi_exec') && function_exists('curl_exec')) {
        $handler = Proxy::wrapSync(new CurlMultiHandler(), new CurlHandler());
    } elseif (function_exists('curl_exec')) {
        $handler = new CurlHandler();
    } elseif (function_exists('curl_multi_exec')) {
        $handler = new CurlMultiHandler();
    }

    if (ini_get('allow_url_fopen')) {
        $handler = $handler
            ? Proxy::wrapStreaming($handler, new StreamHandler())
            : new StreamHandler();
    } elseif (!$handler) {
        throw new \RuntimeException('BuzzleHttp requires cURL, the '
            . 'allow_url_fopen ini setting, or a custom HTTP handler.');
    }

    return $handler;
}

and this in vendor/buzzlehttp/buzzle/src/HandlerStack.php

public static function create(callable $handler = null)
    {
        $stack = new self($handler ?: choose_handler());
        $stack->push(Middleware::httpErrors(), 'http_errors');
        $stack->push(Middleware::redirect(), 'allow_redirects');
        $stack->push(Middleware::cookies(), 'cookies');
        $stack->push(Middleware::prepareBody(), 'prepare_body');

        return $stack;
    } 
JonnyTech commented 3 years ago

Looking at the plug-in page: https://wordpress.org/plugins/integration-for-billingo-woocommerce/

This plugin has been closed as of August 14, 2018 and is not available for download. This closure is permanent. Reason: Author Request.

The last commit was 4 years ago. I suggest finding a newer alternative plug-in.

But that may not be your issue since BuzzleHttp is not referenced in your error logs.

Do you have any other plug-ins installed?

JonnyTech commented 3 years ago

Ah, I found the correct link for your plug-in - could this be the issue: https://wordpress.org/support/topic/2-0-2-a-guzzlehttp-verzioja-breaking-change-et-tartalmaz/

the1bit commented 3 years ago

Hi,

I have found the latest version of this plugin. https://plugins.trac.wordpress.org/browser/billingo/tags/2.5.0?order=name

I upgraded for it, but it uses the same method so the backup still fail.

richardpackham commented 3 years ago

I am having the same error. have you found a solution for this yet?