elementor / wp2static

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

Plugin fails to execute #841

Open shikata-ga-nai opened 2 years ago

shikata-ga-nai commented 2 years ago

On a fresh VPS I imported a wordpress website, purchased and installed the plugin.

When I try to run it, the UI says 500 error code returned from server. Please check your server's error logs or try increasing your max_execution_time limit in PHP if this consistently fails after the same duration.

and the logs on the server show this:

[Tue Nov 30 18:09:20.531046 2021] [php:error] [pid 6785] [client 172.225.105.5:21023] PHP Fatal error: Uncaught WP2StaticGuzzleHttp\\Exception\\TooManyRedirectsException: Will not follow more than 1 redirects in /var/www/html/wp-content/plugins/wp2static/vendor/leonstafford/wp2staticguzzle/src/RedirectMiddleware.php:147\nStack trace:\n#0 /var/www/html/wp-content/plugins/wp2static/vendor/leonstafford/wp2staticguzzle/src/RedirectMiddleware.php(88): WP2StaticGuzzleHttp\\RedirectMiddleware->guardMax()\n#1 /var/www/html/wp-content/plugins/wp2static/vendor/leonstafford/wp2staticguzzle/src/RedirectMiddleware.php(73): WP2StaticGuzzleHttp\\RedirectMiddleware->checkRedirect()\n#2 /var/www/html/wp-content/plugins/wp2static/vendor/leonstafford/wp2staticpromises/src/FulfilledPromise.php(41): WP2StaticGuzzleHttp\\RedirectMiddleware->WP2StaticGuzzleHttp\\{closure}()\n#3 /var/www/html/wp-content/plugins/wp2static/vendor/leonstafford/wp2staticpromises/src/TaskQueue.php(48): WP2StaticGuzzleHttp\\Promise\\FulfilledPromise::WP2StaticGuzzleHttp\\Promise\\{closure}()\n#4 /var/www/html/wp-content/plugins/wp2static/vendor/leonstafford/wp2staticpromises/src/Promise.php(248): WP2StaticGuzzleHttp\\Promise\\TaskQueue->run()\n#5 /var/www/html/wp-content/plugins/wp2static/vendor/leonstafford/wp2staticpromises/src/Promise.php(224): WP2StaticGuzzleHttp\\Promise\\Promise->invokeWaitFn()\n#6 /var/www/html/wp-content/plugins/wp2static/vendor/leonstafford/wp2staticpromises/src/Promise.php(62): WP2StaticGuzzleHttp\\Promise\\Promise->waitIfPending()\n#7 /var/www/html/wp-content/plugins/wp2static/vendor/leonstafford/wp2staticguzzle/src/Client.php(123): WP2StaticGuzzleHttp\\Promise\\Promise->wait()\n#8 /var/www/html/wp-content/plugins/wp2static/src/Crawler.php(222): WP2StaticGuzzleHttp\\Client->send()\n#9 /var/www/html/wp-content/plugins/wp2static/src/Crawler.php(110): WP2Static\\Crawler->crawlURL()\n#10 /var/www/html/wp-content/plugins/wp2static/src/Crawler.php(71): WP2Static\\Crawler->crawlSite()\n#11 /var/www/html/wp-includes/class-wp-hook.php(303): WP2Static\\Crawler::wp2staticCrawl()\n#12 /var/www/html/wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters()\n#13 /var/www/html/wp-includes/plugin.php(470): WP_Hook->do_action()\n#14 /var/www/html/wp-content/plugins/wp2static/src/Controller.php(755): do_action()\n#15 /var/www/html/wp-content/plugins/wp2static/src/Controller.php(636): WP2Static\\Controller::wp2staticCrawl()\n#16 /var/www/html/wp-content/plugins/wp2static/src/Controller.php(745): WP2Static\\Controller::wp2staticHeadless()\n#17 /var/www/html/wp-includes/class-wp-hook.php(301): WP2Static\\Controller::wp2staticRun()\n#18 /var/www/html/wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters()\n#19 /var/www/html/wp-includes/plugin.php(470): WP_Hook->do_action()\n#20 /var/www/html/wp-admin/admin-ajax.php(187): do_action()\n#21 {main}\n thrown in /var/www/html/wp-content/plugins/wp2static/vendor/leonstafford/wp2staticguzzle/src/RedirectMiddleware.php on line 147, referer: http://161.35.216.81/wp-admin/admin.php?page=wp2static

john-shaffer commented 2 years ago

The redirect limit was raised by #826. You can try either making the change in https://github.com/leonstafford/wp2static/pull/826/commits/3c9b7ce0e5c8d9a773ed3d91d9145e012901113e yourself, or using the latest code from git.

shikata-ga-nai commented 2 years ago

Hey @john-shaffer ! thank you, that fix allowed the plugin to run a bit longer :) But now it throws same error in UI, UI logs show this: 2021-12-01 08:41:54: 404 for URL /http:/161.35.216.81/wp-includes/wlwmanifest.xml 2021-12-01 08:41:54: 404 for URL /http:/161.35.216.81/wp-includes/theme.json 2021-12-01 08:41:54: 404 for URL /http:/161.35.216.81/wp-includes/theme-i18n.json 2021-12-01 08:41:54: 404 for URL /http:/161.35.216.81/wp-includes/js/zxcvbn.min.js 2021-12-01 08:41:54: 404 for URL /http:/161.35.216.81/wp-includes/js/zxcvbn-async.min.js 2021-12-01 08:41:54: 404 for URL /http:/161.35.216.81/wp-includes/js/zxcvbn-async.js

And apache error logs show: [Wed Dec 01 08:41:57.993848 2021] [php:error] [pid 10543] [client 104.28.106.248:45731] PHP Fatal error: Uncaught WP2StaticGuzzleHttp\\Exception\\ConnectException: cURL error 6: Could not resolve host: 161.35.216.81http (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for http://161.35.216.81http/161.35.216.81/wp-content/plugins/advanced-custom-fields/assets/build/css/acf-dark.css in /var/www/html/wp-content/plugins/wp2static/vendor/leonstafford/wp2staticguzzle/src/Handler/CurlFactory.php:210\nStack trace:\n#0 /var/www/html/wp-content/plugins/wp2static/vendor/leonstafford/wp2staticguzzle/src/Handler/CurlFactory.php(158): WP2StaticGuzzleHttp\\Handler\\CurlFactory::createRejection()\n#1 /var/www/html/wp-content/plugins/wp2static/vendor/leonstafford/wp2staticguzzle/src/Handler/CurlFactory.php(110): WP2StaticGuzzleHttp\\Handler\\CurlFactory::finishError()\n#2 /var/www/html/wp-content/plugins/wp2static/vendor/leonstafford/wp2staticguzzle/src/Handler/CurlHandler.php(47): WP2StaticGuzzleHttp\\Handler\\CurlFactory::finish()\n#3 /var/www/html/wp-content/plugins/wp2static/vendor/leonstafford/wp2staticguzzle/src/Handler/Proxy.php(28): WP2StaticGuzzleHttp\\Handler\\CurlHandler->__invoke()\n#4 /var/www/html/wp-content/plugins/wp2static/vendor/leonstafford/wp2staticguzzle/src/Handler/Proxy.php(48): WP2StaticGuzzleHttp\\Handler\\Proxy::WP2StaticGuzzleHttp\\Handler\\{closure}()\n#5 /var/www/html/wp-content/plugins/wp2static/vendor/leonstafford/wp2staticguzzle/src/PrepareBodyMiddleware.php(35): WP2StaticGuzzleHttp\\Handler\\Proxy::WP2StaticGuzzleHttp\\Handler\\{closure}()\n#6 /var/www/html/wp-content/plugins/wp2static/vendor/leonstafford/wp2staticguzzle/src/Middleware.php(31): WP2StaticGuzzleHttp\\PrepareBodyMiddleware->__invoke()\n#7 /var/www/html/wp-content/plugins/wp2static/vendor/leonstafford/wp2staticguzzle/src/RedirectMiddleware.php(71): WP2StaticGuzzleHttp\\Middleware::WP2StaticGuzzleHttp\\{closure}()\n#8 /var/www/html/wp-content/plugins/wp2static/vendor/leonstafford/wp2staticguzzle/src/Middleware.php(61): WP2StaticGuzzleHttp\\RedirectMiddleware->__invoke()\n#9 /var/www/html/wp-content/plugins/wp2static/vendor/leonstafford/wp2staticguzzle/src/HandlerStack.php(75): WP2StaticGuzzleHttp\\Middleware::WP2StaticGuzzleHttp\\{closure}()\n#10 /var/www/html/wp-content/plugins/wp2static/vendor/leonstafford/wp2staticguzzle/src/Client.php(331): WP2StaticGuzzleHttp\\HandlerStack->__invoke()\n#11 /var/www/html/wp-content/plugins/wp2static/vendor/leonstafford/wp2staticguzzle/src/Client.php(107): WP2StaticGuzzleHttp\\Client->transfer()\n#12 /var/www/html/wp-content/plugins/wp2static/vendor/leonstafford/wp2staticguzzle/src/Client.php(123): WP2StaticGuzzleHttp\\Client->sendAsync()\n#13 /var/www/html/wp-content/plugins/wp2static/src/Crawler.php(222): WP2StaticGuzzleHttp\\Client->send()\n#14 /var/www/html/wp-content/plugins/wp2static/src/Crawler.php(110): WP2Static\\Crawler->crawlURL()\n#15 /var/www/html/wp-content/plugins/wp2static/src/Crawler.php(71): WP2Static\\Crawler->crawlSite()\n#16 /var/www/html/wp-includes/class-wp-hook.php(303): WP2Static\\Crawler::wp2staticCrawl()\n#17 /var/www/html/wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters()\n#18 /var/www/html/wp-includes/plugin.php(470): WP_Hook->do_action()\n#19 /var/www/html/wp-content/plugins/wp2static/src/Controller.php(755): do_action()\n#20 /var/www/html/wp-content/plugins/wp2static/src/Controller.php(636): WP2Static\\Controller::wp2staticCrawl()\n#21 /var/www/html/wp-content/plugins/wp2static/src/Controller.php(745): WP2Static\\Controller::wp2staticHeadless()\n#22 /var/www/html/wp-includes/class-wp-hook.php(301): WP2Static\\Controller::wp2staticRun()\n#23 /var/www/html/wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters()\n#24 /var/www/html/wp-includes/plugin.php(470): WP_Hook->do_action()\n#25 /var/www/html/wp-admin/admin-ajax.php(187): do_action()\n#26 {main}\n thrown in /var/www/html/wp-content/plugins/wp2static/vendor/leonstafford/wp2staticguzzle/src/Handler/CurlFactory.php on line 210, referer: http://161.35.216.81/wp-admin/admin.php?page=wp2static

I see that URLs somehow are messed up

john-shaffer commented 2 years ago

Thank you for the detail here. That looks similar to #715 and #677.

Do you also have docker involved? Can you post the results of your WP2Static Diagnostics page (/wp-admin/admin.php?page=wp2static-diagnostics)?

LeviathanViktor commented 2 years ago

Hey @john-shaffer ! Here're the diagnostics page screenshots: First Second