Skip to content

500 error returned - when generating static site with RankMath plugin activated #824

@jhatmaker

Description

@jhatmaker

Plugin - Caused unhandled exception

Describe the bug
On a fresh install of WP with WP2Static and RankMath (free) activated, (using the SiteMap options in RankMath), the Generate static site will fail (browser reports a 500 error) and the log file will report an unhandled ClientException.

To Reproduce
Steps to reproduce the behavior:

  1. Install/Activate RankMath
  2. Make sure the options to include Posts, Pages, and Categories are turned on in Rank Math (if you turn off these options WP2Static will process normally, if any of the 3 options are on, WP2Static will fail).
  3. Select WP2Static -> Run and Press "Generate static site"
  4. See error

Expected behavior
WP2Static should not have an unhandled exception that causes the generate to fail.

Screenshots
If applicable, add screenshots to help explain your problem.
image
image
image
image

Environment (please complete the following information):

  • Hosting OS: Linux 0c15ac11f18a 5.10.25-linuxkit #1 SMP Tue Mar 23 09:27:39 UTC 2021 x86_64 GNU/Linux
  • (standard wordpress docker image)
  • Web server setup: Docker, apache, wordpress
  • Local host / Docker instance

Log files (please complete the following information):

Please ensure no sensitive information in your log files, then attach to your issue.

  • WP2Static Logs (found on WP dashboard > WP2Static > Logs)
2021-10-09 00:25:05: Unable to fetch URL contents
2021-10-09 00:25:05: Starting to detect WordPress site URLs.
2021-10-09 00:25:05: Starting URL detection
2021-10-09 00:25:05: Running WP2Static in Headless mode
2021-10-09 00:25:05: Running full workflow from UI
  • Server logs (PHP and webserver error logs)
Fatal error: Uncaught WP2StaticGuzzleHttp\Exception\ClientException: Client error: `GET http://wplocal.internal//wp-sitemap.xml` resulted in a `404 Not Found` response:
<!doctype html>
<html lang="en-US" >
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width (truncated...)
in /var/www/html/wp-content/plugins/wp2static/vendor/leonstafford/wp2staticguzzle/src/Exception/RequestException.php:113
Stack trace:
#0 /var/www/html/wp-content/plugins/wp2static/vendor/leonstafford/wp2staticguzzle/src/Middleware.php(69): WP2StaticGuzzleHttp\Exception\RequestException::create(Object(WP2StaticGuzzleHttp\Psr7\Request), Object(WP2StaticGuzzleHttp\Psr7\Response), NULL, Array, NULL)
#1 /var/www/html/wp-content/plugins/wp2static/vendor/leonstafford/wp2staticpromises/src/Promise.php(204): WP2StaticGuzzleHttp\Middleware::WP2StaticGuzzleHttp\{closure}(Object(WP2StaticGuzzleHttp\Psr7\Response))
#2 /var/www/html/wp-content/plugins/wp2static/vendor/leonstafford/wp2staticpromises/src/Promise.php(153): WP2StaticGuzzle in /var/www/html/wp-content/plugins/wp2static/src/DetectSitemapsURLs.php on line 160

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions