elementor / wp2static

WordPress static site generator for security, performance and cost benefits
https://wp2static.com
The Unlicense
1.39k stars 258 forks source link

Error appears at the end of crawling #898

Closed Olwyne closed 1 year ago

Olwyne commented 1 year ago

Describe the bug On WP2Static 7.2, the following error appears at the end of crawling :

PHP Fatal error:  Uncaught TypeError: WP2Static\Crawler::WP2Static\{closure}(): Argument #1 ($reason) must be of type WP2StaticGuzzleHttp\Exception\RequestException, WP2StaticGuzzleHttp\Exception\ConnectException given in /var/www/cdv-refonte/wordpress/wp-content/plugins/wp2static/src/Crawler.php:235
Stack trace:
#0 [internal function]: WP2Static\Crawler->WP2Static\{closure}(Object(WP2StaticGuzzleHttp\Exception\ConnectException), 10, Object(WP2StaticGuzzleHttp\Promise\Promise))
#1 /var/www/cdv-refonte/wordpress/wp-content/plugins/wp2static/vendor/leonstafford/wp2staticpromises/src/EachPromise.php(191): call_user_func(Object(Closure), Object(WP2StaticGuzzleHttp\Exception\ConnectException), 10, Object(WP2StaticGuzzleHttp\Promise\Promise))
#2 /var/www/cdv-refonte/wordpress/wp-content/plugins/wp2static/vendor/leonstafford/wp2staticpromises/src/Promise.php(204): WP2StaticGuzzleHttp\Promise\EachPromise->WP2StaticGuzzleHttp\Promise\{closure}(Object(WP2StaticGuzzleHttp\Exception\ConnectException))
#3 /var/www/cdv-refonte/wordpress/wp-content/plugins/wp2static/vendor/leonstafford/wp2staticpromises/src/Promise.php(153): WP2StaticGuzzleHttp\Promise\Promise::callHandler(2, Object(WP2StaticGuzzleHttp\Exception\ConnectException), NULL)
#4 /var/www/cdv-refonte/wordpress/wp-content/plugins/wp2static/vendor/leonstafford/wp2staticpromises/src/TaskQueue.php(48): WP2StaticGuzzleHttp\Promise\Promise::WP2StaticGuzzleHttp\Promise\{closure}()
#5 /var/www/cdv-refonte/wordpress/wp-content/plugins/wp2static/vendor/leonstafford/wp2staticguzzle/src/Handler/CurlMultiHandler.php(158): WP2StaticGuzzleHttp\Promise\TaskQueue->run()
#6 /var/www/cdv-refonte/wordpress/wp-content/plugins/wp2static/vendor/leonstafford/wp2staticguzzle/src/Handler/CurlMultiHandler.php(183): WP2StaticGuzzleHttp\Handler\CurlMultiHandler->tick()
#7 /var/www/cdv-refonte/wordpress/wp-content/plugins/wp2static/vendor/leonstafford/wp2staticpromises/src/Promise.php(248): WP2StaticGuzzleHttp\Handler\CurlMultiHandler->execute(true)
#8 /var/www/cdv-refonte/wordpress/wp-content/plugins/wp2static/vendor/leonstafford/wp2staticpromises/src/Promise.php(224): WP2StaticGuzzleHttp\Promise\Promise->invokeWaitFn()
#9 /var/www/cdv-refonte/wordpress/wp-content/plugins/wp2static/vendor/leonstafford/wp2staticpromises/src/Promise.php(269): WP2StaticGuzzleHttp\Promise\Promise->waitIfPending()
#10 /var/www/cdv-refonte/wordpress/wp-content/plugins/wp2static/vendor/leonstafford/wp2staticpromises/src/Promise.php(226): WP2StaticGuzzleHttp\Promise\Promise->invokeWaitList()
#11 /var/www/cdv-refonte/wordpress/wp-content/plugins/wp2static/vendor/leonstafford/wp2staticpromises/src/Promise.php(62): WP2StaticGuzzleHttp\Promise\Promise->waitIfPending()
#12 /var/www/cdv-refonte/wordpress/wp-content/plugins/wp2static/vendor/leonstafford/wp2staticpromises/src/EachPromise.php(115): WP2StaticGuzzleHttp\Promise\Promise->wait()
#13 /var/www/cdv-refonte/wordpress/wp-content/plugins/wp2static/vendor/leonstafford/wp2staticpromises/src/Promise.php(248): WP2StaticGuzzleHttp\Promise\EachPromise->WP2StaticGuzzleHttp\Promise\{closure}(true)
#14 /var/www/cdv-refonte/wordpress/wp-content/plugins/wp2static/vendor/leonstafford/wp2staticpromises/src/Promise.php(224): WP2StaticGuzzleHttp\Promise\Promise->invokeWaitFn()
#15 /var/www/cdv-refonte/wordpress/wp-content/plugins/wp2static/vendor/leonstafford/wp2staticpromises/src/Promise.php(62): WP2StaticGuzzleHttp\Promise\Promise->waitIfPending()
#16 /var/www/cdv-refonte/wordpress/wp-content/plugins/wp2static/src/Crawler.php(246): WP2StaticGuzzleHttp\Promise\Promise->wait()
#17 /var/www/cdv-refonte/wordpress/wp-content/plugins/wp2static/src/Crawler.php(95): WP2Static\Crawler->crawlSite('/var/www/cdv-re...')
#18 /var/www/cdv-refonte/wordpress/wp-includes/class-wp-hook.php(308): WP2Static\Crawler::wp2staticCrawl('/var/www/cdv-re...', 'wp2static')
#19 /var/www/cdv-refonte/wordpress/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters('', Array)
#20 /var/www/cdv-refonte/wordpress/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#21 /var/www/cdv-refonte/wordpress/wp-content/plugins/wp2static/src/Controller.php(821): do_action('wp2static_crawl', '/var/www/cdv-re...', 'wp2static')
#22 /var/www/cdv-refonte/wordpress/wp-content/plugins/wp2static/src/CLI.php(714): WP2Static\Controller::wp2staticCrawl()
#23 [internal function]: WP2Static\CLI->crawl(Array, Array)
#24 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/CommandFactory.php(100): call_user_func(Array, Array, Array)
#25 [internal function]: WP_CLI\Dispatcher\CommandFactory::WP_CLI\Dispatcher\{closure}(Array, Array)
#26 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/Subcommand.php(491): call_user_func(Object(Closure), Array, Array)
#27 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(419): WP_CLI\Dispatcher\Subcommand->invoke(Array, Array, Array)
#28 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(442): WP_CLI\Runner->run_command(Array, Array)
#29 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1256): WP_CLI\Runner->run_command_and_exit()
#30 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/LaunchRunner.php(28): WP_CLI\Runner->start()
#31 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/bootstrap.php(78): WP_CLI\Bootstrap\LaunchRunner->process(Object(WP_CLI\Bootstrap\BootstrapState))
#32 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/wp-cli.php(32): WP_CLI\bootstrap()
#33 phar:///usr/local/bin/wp/php/boot-phar.php(11): include('phar:///usr/loc...')
#34 /usr/local/bin/wp(4): include('phar:///usr/loc...')
#35 {main}
  thrown in /var/www/cdv-refonte/wordpress/wp-content/plugins/wp2static/src/Crawler.php on line 235
Fatal error: Uncaught TypeError: WP2Static\Crawler::WP2Static\{closure}(): Argument #1 ($reason) must be of type WP2StaticGuzzleHttp\Exception\RequestException, WP2StaticGuzzleHttp\Exception\ConnectException given in /var/www/cdv-refonte/wordpress/wp-content/plugins/wp2static/src/Crawler.php:235
Stack trace:
#0 [internal function]: WP2Static\Crawler->WP2Static\{closure}(Object(WP2StaticGuzzleHttp\Exception\ConnectException), 10, Object(WP2StaticGuzzleHttp\Promise\Promise))
#1 /var/www/cdv-refonte/wordpress/wp-content/plugins/wp2static/vendor/leonstafford/wp2staticpromises/src/EachPromise.php(191): call_user_func(Object(Closure), Object(WP2StaticGuzzleHttp\Exception\ConnectException), 10, Object(WP2StaticGuzzleHttp\Promise\Promise))
#2 /var/www/cdv-refonte/wordpress/wp-content/plugins/wp2static/vendor/leonstafford/wp2staticpromises/src/Promise.php(204): WP2StaticGuzzleHttp\Promise\EachPromise->WP2StaticGuzzleHttp\Promise\{closure}(Object(WP2StaticGuzzleHttp\Exception\ConnectException))
#3 /var/www/cdv-refonte/wordpress/wp-content/plugins/wp2static/vendor/leonstafford/wp2staticpromises/src/Promise.php(153): WP2StaticGuzzleHttp\Promise\Promise::callHandler(2, Object(WP2StaticGuzzleHttp\Exception\ConnectException), NULL)
#4 /var/www/cdv-refonte/wordpress/wp-content/plugins/wp2static/vendor/leonstafford/wp2staticpromises/src/TaskQueue.php(48): WP2StaticGuzzleHttp\Promise\Promise::WP2StaticGuzzleHttp\Promise\{closure}()
#5 /var/www/cdv-refonte/wordpress/wp-content/plugins/wp2static/vendor/leonstafford/wp2staticguzzle/src/Handler/CurlMultiHandler.php(158): WP2StaticGuzzleHttp\Promise\TaskQueue->run()
#6 /var/www/cdv-refonte/wordpress/wp-content/plugins/wp2static/vendor/leonstafford/wp2staticguzzle/src/Handler/CurlMultiHandler.php(183): WP2StaticGuzzleHttp\Handler\CurlMultiHandler->tick()
#7 /var/www/cdv-refonte/wordpress/wp-content/plugins/wp2static/vendor/leonstafford/wp2staticpromises/src/Promise.php(248): WP2StaticGuzzleHttp\Handler\CurlMultiHandler->execute(true)
#8 /var/www/cdv-refonte/wordpress/wp-content/plugins/wp2static/vendor/leonstafford/wp2staticpromises/src/Promise.php(224): WP2StaticGuzzleHttp\Promise\Promise->invokeWaitFn()
#9 /var/www/cdv-refonte/wordpress/wp-content/plugins/wp2static/vendor/leonstafford/wp2staticpromises/src/Promise.php(269): WP2StaticGuzzleHttp\Promise\Promise->waitIfPending()
#10 /var/www/cdv-refonte/wordpress/wp-content/plugins/wp2static/vendor/leonstafford/wp2staticpromises/src/Promise.php(226): WP2StaticGuzzleHttp\Promise\Promise->invokeWaitList()
#11 /var/www/cdv-refonte/wordpress/wp-content/plugins/wp2static/vendor/leonstafford/wp2staticpromises/src/Promise.php(62): WP2StaticGuzzleHttp\Promise\Promise->waitIfPending()
#12 /var/www/cdv-refonte/wordpress/wp-content/plugins/wp2static/vendor/leonstafford/wp2staticpromises/src/EachPromise.php(115): WP2StaticGuzzleHttp\Promise\Promise->wait()
#13 /var/www/cdv-refonte/wordpress/wp-content/plugins/wp2static/vendor/leonstafford/wp2staticpromises/src/Promise.php(248): WP2StaticGuzzleHttp\Promise\EachPromise->WP2StaticGuzzleHttp\Promise\{closure}(true)
#14 /var/www/cdv-refonte/wordpress/wp-content/plugins/wp2static/vendor/leonstafford/wp2staticpromises/src/Promise.php(224): WP2StaticGuzzleHttp\Promise\Promise->invokeWaitFn()
#15 /var/www/cdv-refonte/wordpress/wp-content/plugins/wp2static/vendor/leonstafford/wp2staticpromises/src/Promise.php(62): WP2StaticGuzzleHttp\Promise\Promise->waitIfPending()
#16 /var/www/cdv-refonte/wordpress/wp-content/plugins/wp2static/src/Crawler.php(246): WP2StaticGuzzleHttp\Promise\Promise->wait()
#17 /var/www/cdv-refonte/wordpress/wp-content/plugins/wp2static/src/Crawler.php(95): WP2Static\Crawler->crawlSite('/var/www/cdv-re...')
#18 /var/www/cdv-refonte/wordpress/wp-includes/class-wp-hook.php(308): WP2Static\Crawler::wp2staticCrawl('/var/www/cdv-re...', 'wp2static')
#19 /var/www/cdv-refonte/wordpress/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters('', Array)
#20 /var/www/cdv-refonte/wordpress/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#21 /var/www/cdv-refonte/wordpress/wp-content/plugins/wp2static/src/Controller.php(821): do_action('wp2static_crawl', '/var/www/cdv-re...', 'wp2static')
#22 /var/www/cdv-refonte/wordpress/wp-content/plugins/wp2static/src/CLI.php(714): WP2Static\Controller::wp2staticCrawl()
#23 [internal function]: WP2Static\CLI->crawl(Array, Array)
#24 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/CommandFactory.php(100): call_user_func(Array, Array, Array)
#25 [internal function]: WP_CLI\Dispatcher\CommandFactory::WP_CLI\Dispatcher\{closure}(Array, Array)
#26 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/Subcommand.php(491): call_user_func(Object(Closure), Array, Array)
#27 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(419): WP_CLI\Dispatcher\Subcommand->invoke(Array, Array, Array)
#28 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(442): WP_CLI\Runner->run_command(Array, Array)
#29 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1256): WP_CLI\Runner->run_command_and_exit()
#30 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/LaunchRunner.php(28): WP_CLI\Runner->start()
#31 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/bootstrap.php(78): WP_CLI\Bootstrap\LaunchRunner->process(Object(WP_CLI\Bootstrap\BootstrapState))
#32 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/wp-cli.php(32): WP_CLI\bootstrap()
#33 phar:///usr/local/bin/wp/php/boot-phar.php(11): include('phar:///usr/loc...')
#34 /usr/local/bin/wp(4): include('phar:///usr/loc...')
#35 {main}
  thrown in /var/www/cdv-refonte/wordpress/wp-content/plugins/wp2static/src/Crawler.php on line 235

To Reproduce Steps to reproduce the behavior:

  1. Go to your server with terminal
  2. Execute a script with this command :
    /usr/local/bin/wp package install wp-media/wp-rocket-cli
    /usr/local/bin/wp wp2static detect
    /usr/local/bin/wp wp2static crawl
    /usr/local/bin/wp wp2static post_process
  3. Wait the end of crawling
  4. See error

Expected behavior No error should appear on the logs.

Environment (please complete the following information):

yashumitsu commented 1 year ago

Here is the solution: https://github.com/WP2Static/wp2static/issues/866#issuecomment-1110734236

Olwyne commented 1 year ago

Thanks !