Error 504 on static site generation (WP2Static)

未关闭
#787 10 条评论 2 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
php
领域
backend

调研方向

从 WP-CLI wp2static full_workflow 输出和对 admin-ajax.php 的请求开始,然后检查指向 vendor/leonstafford/wp2staticguzzle/src/Handler/CurlFactory.php:210 的 URL 构造过程。重现反向代理设置,并追踪生成的 URL 包含 customer-care-solution.comhttp 的原因;完成的标准是静态生成在没有格式错误的主机或致命 cURL 错误的情况下完成。

由索引模型根据 Issue 内容生成。

描述

bug

Hey there.

The static site generation used to work fine but i am not able to run it from a few hours.

I get this error:

504 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.
More information of the error may be logged in your browsers console. 

And this is what I get in the console:

load-scripts.php?c=0&load[chunk_0]=jquery-core,jquery-migrate,utils&ver=5.7.1:5 JQMIGRATE: Migrate is installed, version 3.3.2
load-scripts.php?c=0&load[chunk_0]=jquery-core,jquery-migrate,utils&ver=5.7.1:2 POST https://customer-care-solution.com/wp-admin/admin-ajax.php?_fs_blog_admin=true 500
send @ load-scripts.php?c=0&load[chunk_0]=jquery-core,jquery-migrate,utils&ver=5.7.1:2
ajax @ load-scripts.php?c=0&load[chunk_0]=jquery-core,jquery-migrate,utils&ver=5.7.1:2
s.ajax.s.ajax @ load-scripts.php?c=0&load[chunk_0]=jquery-core,jquery-migrate,utils&ver=5.7.1:5
(anonymous) @ admin.php?page=wp2static:566
dispatch @ load-scripts.php?c=0&load[chunk_0]=jquery-core,jquery-migrate,utils&ver=5.7.1:2
v.handle @ load-scripts.php?c=0&load[chunk_0]=jquery-core,jquery-migrate,utils&ver=5.7.1:2
admin.php?page=wp2static:547 
admin.php?page=wp2static:548 <p>There has been a critical error on this website.</p><p><a href="https://wordpress.org/support/article/faq-troubleshooting/">Learn more about troubleshooting WordPress.</a></p>

Tried wp-cil

$ wp wp2static full_workflow
[2021-05-01T14:34:53+05:30] Starting to detect WordPress site URLs.
[2021-05-01T14:34:55+05:30] Detection complete. 4435 URLs added to Crawl Queue.
[2021-05-01T14:34:55+05:30] Starting crawling
[2021-05-01T14:34:55+05:30] Starting to crawl detected URLs.
[2021-05-01T14:34:55+05:30] Using CrawlCache.
[2021-05-01T14:35:00+05:30] 404 for URL /blog/page/1/
[2021-05-01T14:35:00+05:30] 404 for URL /blog/page/2/
[2021-05-01T14:35:03+05:30] 404 for URL /favicon.ico
[2021-05-01T14:35:08+05:30] 404 for URL /sitemap.xml
[2021-05-01T14:35:59+05:30] Crawling progress: 300 crawled, 3887 skipped (cached).
PHP Fatal error:  Uncaught WP2StaticGuzzleHttp\Exception\ConnectException: cURL error 6: Could not resolve host: customer-care-solution.comhttp (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://customer-care-solution.comhttp/customer-care-solution.com/wp-content/plugins/all-in-one-wp-migration/lib/view/assets/css/backups.min.css in /usr/html/wp-content/plugins/wp2static/vendor/leonstafford/wp2staticguzzle/src/Handler/CurlFactory.php:210
Stack trace:
#0 /usr/html/wp-content/plugins/wp2static/vendor/leonstafford/wp2staticguzzle/src/Handler/CurlFactory.php(158): WP2StaticGuzzleHttp\Handler\CurlFactory::createRejection()
leonstafford/lokl#1 /usr/html/wp-content/plugins/wp2static/vendor/leonstafford/wp2staticguzzle/src/Handler/CurlFactory.php(110): WP2StaticGuzzleHttp\Handler\CurlFactory::finishError()
leonstafford/lokl#2 /usr/html/wp-content/plugins/wp2static/vendor/leonstafford/wp2staticguzzle/src/Handler/CurlHandler.php(47): WP2StaticGuzzleHttp\Handler\CurlFactory::finish()
leonstafford/lokl#3 /usr/html/wp-content/plugins/wp2static/vendor/leonstafford/wp2stati in /usr/html/wp-content/plugins/wp2static/vendor/leonstafford/wp2staticguzzle/src/Handler/CurlFactory.php on line 210
Fatal error: Uncaught WP2StaticGuzzleHttp\Exception\ConnectException: cURL error 6: Could not resolve host: customer-care-solution.comhttp (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://customer-care-solution.comhttp/customer-care-solution.com/wp-content/plugins/all-in-one-wp-migration/lib/view/assets/css/backups.min.css in /usr/html/wp-content/plugins/wp2static/vendor/leonstafford/wp2staticguzzle/src/Handler/CurlFactory.php:210
Stack trace:
#0 /usr/html/wp-content/plugins/wp2static/vendor/leonstafford/wp2staticguzzle/src/Handler/CurlFactory.php(158): WP2StaticGuzzleHttp\Handler\CurlFactory::createRejection()
leonstafford/lokl#1 /usr/html/wp-content/plugins/wp2static/vendor/leonstafford/wp2staticguzzle/src/Handler/CurlFactory.php(110): WP2StaticGuzzleHttp\Handler\CurlFactory::finishError()
leonstafford/lokl#2 /usr/html/wp-content/plugins/wp2static/vendor/leonstafford/wp2staticguzzle/src/Handler/CurlHandler.php(47): WP2StaticGuzzleHttp\Handler\CurlFactory::finish()
leonstafford/lokl#3 /usr/html/wp-content/plugins/wp2static/vendor/leonstafford/wp2stati in /usr/html/wp-content/plugins/wp2static/vendor/leonstafford/wp2staticguzzle/src/Handler/CurlFactory.php on line 210
Error: There has been a critical error on this website.Learn more about troubleshooting WordPress. There has been a critical error on this website.

In the line PHP Fatal error: Uncaught WP2StaticGuzzleHttp\Exception\ConnectException: cURL error 6: Could not resolve host: customer-care-solution.comhttp (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://customer-care-solution.comhttp/customer-care-solution.com/wp-content/plugins/all-in-one-wp-migration/lib/view/assets/css/backups.min.css in /usr/html/wp-content/plugins/wp2static/vendor/leonstafford/wp2staticguzzle/src/Handler/CurlFactory.php:210 Stack trace:

Why is http being appended to customer-care-solution.com? And how do I solve this?

My setup:

  1. Lokl site with a reverse proxy running on https.
  2. Static site accessible on customer-care-solution.com.
  3. Modified host files on my computer to point to dynamic WordPress site.
主要语言
PHP
星标
1.5k
派生
292
PR 合并指标
30 天内没有已合并 PR

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

elementor/wp2static 的其他 Issue

查看 elementor/wp2static 的全部 Issue

相似的 Issue

更多 PHP Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。