Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

警告! (重启) Caddy 失败,是不是letsencrypt坏了? #1386

Open
woshichenghaibo opened this issue Dec 16, 2024 · 6 comments
Open

警告! (重启) Caddy 失败,是不是letsencrypt坏了? #1386

woshichenghaibo opened this issue Dec 16, 2024 · 6 comments

Comments

@woshichenghaibo
Copy link

安装 Caddy 成功.

-------------- VLESS-H2-TLS-chushen.fu.bi.json -------------
协议 (protocol) = vless
地址 (address) = chushen.fu.bi
端口 (port) = 443
用户ID (id) = 7e9e2080-44ab-4206-8b72-faf660155a38
传输协议 (network) = h2
伪装域名 (host) = chushen.fu.bi
路径 (path) = /7e9e2080-44ab-4106-8b72-faf660155a38
传输层安全 (TLS) = tls
------------- 链接 (URL) -------------
vless://[email protected]:443?encryption=none&security=tls&type=h2&host=chushen.fu.bi&path=%2F7e9e2080-44ab-4106-8b72-faf660155a38#233boy-h2-chushen.fu.bi
------------- END -------------
关注(tg): https://t.me/tg2333
文档(doc): https://233boy.com/v2ray/v2ray-script/
推广(ads): 机场推荐(V2Ray services): https://getjms.com/

root@le:~# Job for caddy.service failed because a timeout was exceeded.
See "systemctl status caddy.service" and "journalctl -xe" for details.

警告! (重启) Caddy 失败

检测到运行失败, 自动执行测试运行.

V2Ray 正在运行, 跳过测试

测试运行 Caddy ..

Caddy 运行失败信息:
Job for caddy.service failed because a timeout was exceeded.
See "systemctl status caddy.service" and "journalctl -xe" for details.2024/12/16 13:21:34.532 INFO using config from file{"file": "/etc/caddy/Caddyfile"}
2024/12/16 13:21:55.137 WARN No files matching import glob pattern {"pattern": "/etc/caddy/sites/*.conf"}
2024/12/16 13:22:59.875 INFO adapted config to JSON {"adapter": "caddyfile"}
2024/12/16 13:23:00.845 WARN Caddyfile input is not formatted; run 'caddy fmt --overwrite' to fix inconsistencies {"adapter": "caddyfile", "file": "/etc/caddy/Caddyfile", "line": 7}
2024/12/16 13:23:05.017 WARN admin admin endpoint disabled
2024/12/16 13:23:15.990 INFO tls.cache.maintenance started background certificate maintenance {"cache": "0xc0004ff500"}
2024/12/16 13:23:20.574 INFO http.auto_https server is listening only on the HTTPS port but has no TLS connection policies; adding one to enable TLS {"server_name": "srv0", "https_port": 443}
2024/12/16 13:23:22.136 INFO http.auto_https enabling automatic HTTP->HTTPS redirects {"server_name": "srv0"}
2024/12/16 13:23:59.909 INFO http enabling HTTP/3 listener {"addr": ":443"}
2024/12/16 13:24:18.085 INFO tls storage cleaning happened too recently; skipping for now {"storage": "FileStorage:/root/.local/share/caddy", "instance": "331db7f1-f9f3-495a-a36c-c0ac2d5aa183", "try_again": "2024/12/17 13:24:17.346", "try_again_in": 86399.592955524}
2024/12/16 13:24:22.321 INFO tls finished cleaning storage units
2024/12/16 13:24:31.188 INFO http.log server running {"name": "srv0", "protocols": ["h1", "h2", "h3"]}
2024/12/16 13:24:32.499 INFO http.log server running {"name": "remaining_auto_https_redirects", "protocols": ["h1", "h2", "h3"]}
2024/12/16 13:24:32.623 INFO http enabling automatic TLS certificate management {"domains": ["chushen.fu.bi"]}
2024/12/16 13:24:42.545 INFO autosaved config (load with --resume flag) {"file": "/root/.config/caddy/autosave.json"}
2024/12/16 13:24:53.372 INFO serving initial configuration
2024/12/16 13:24:54.541 INFO tls.obtain acquiring lock {"identifier": "chushen.fu.bi"}
2024/12/16 13:24:55.078 INFO tls.obtain lock acquired {"identifier": "chushen.fu.bi"}
2024/12/16 13:24:56.226 INFO tls.obtain obtaining certificate {"identifier": "chushen.fu.bi"}
2024/12/16 13:26:47.666 WARN http.acme_client HTTP request failed; retrying {"url": "https://acme-v02.api.letsencrypt.org/directory", "error": "performing request: Get "https://acme-v02.api.letsencrypt.org/directory\": context deadline exceeded (Client.Timeout exceeded while awaiting headers)"}
2024/12/16 13:27:50.024 WARN http.acme_client HTTP request failed; retrying {"url": "https://acme-v02.api.letsencrypt.org/directory", "error": "performing request: Get "https://acme-v02.api.letsencrypt.org/directory\": context deadline exceeded (Client.Timeout exceeded while awaiting headers)"}
2024/12/16 13:28:37.585 INFO http waiting on internal rate limiter {"identifiers": ["chushen.fu.bi"], "ca": "https://acme-v02.api.letsencrypt.org/directory", "account": ""}
2024/12/16 13:28:37.814 INFO http done waiting on internal rate limiter {"identifiers": ["chushen.fu.bi"], "ca": "https://acme-v02.api.letsencrypt.org/directory", "account": ""}
2024/12/16 13:28:37.892 INFO http using ACME account {"account_id": "https://acme-v02.api.letsencrypt.org/acme/acct/2116414035", "account_contact": []}
2024/12/16 13:28:52.742 INFO http.acme_client trying to solve challenge {"identifier": "chushen.fu.bi", "challenge_type": "tls-alpn-01", "ca": "https://acme-v02.api.letsencrypt.org/directory"}
2024/12/16 13:28:58.543 INFO tls served key authentication certificate {"server_name": "chushen.fu.bi", "challenge": "tls-alpn-01", "remote": "[2600:3000:1511:200::82]:49673", "distributed": false}
2024/12/16 13:29:04.249 INFO tls served key authentication certificate {"server_name": "chushen.fu.bi", "challenge": "tls-alpn-01", "remote": "[2600:1f14:804:fd01:1107:3fb8:575:f243]:31312", "distributed": false}
2024/12/16 13:29:04.318 INFO tls served key authentication certificate {"server_name": "chushen.fu.bi", "challenge": "tls-alpn-01", "remote": "[2600:1f16:269:da00:dd41:a06:973b:e8f9]:31988", "distributed": false}
2024/12/16 13:29:04.055 INFO tls served key authentication certificate {"server_name": "chushen.fu.bi", "challenge": "tls-alpn-01", "remote": "[2406:da18:85:1402:8da4:f455:adcb:eaca]:57560", "distributed": false}
2024/12/16 13:29:04.081 INFO tls served key authentication certificate {"server_name": "chushen.fu.bi", "challenge": "tls-alpn-01", "remote": "[2a05:d016:39f:3101:a486:c7a9:3bab:5b96]:15300", "distributed": false}
2024/12/16 13:29:24.222 INFO http.acme_client authorization finalized {"identifier": "chushen.fu.bi", "authz_status": "valid"}
2024/12/16 13:29:24.327 INFO http.acme_client validations succeeded; finalizing order {"order": "https://acme-v02.api.letsencrypt.org/acme/order/2116414035/333926052595"}
2024/12/16 13:29:33.785 INFO http.acme_client got renewal info {"names": ["chushen.fu.bi"], "window_start": "2025/02/13 12:50:27.000", "window_end": "2025/02/15 12:50:27.000", "selected_time": "2025/02/13 18:48:00.000", "recheck_after": "2024/12/16 19:29:33.561", "explanation_url": ""}
2024/12/16 13:29:35.926 INFO http.acme_client got renewal info {"names": ["chushen.fu.bi"], "window_start": "2025/02/13 12:50:27.000", "window_end": "2025/02/15 12:50:27.000", "selected_time": "2025/02/14 09:14:51.000", "recheck_after": "2024/12/16 19:29:35.926", "explanation_url": ""}
2024/12/16 13:29:35.960 INFO http.acme_client successfully downloaded available certificate chains {"count": 2, "first_url": "https://acme-v02.api.letsencrypt.org/acme/cert/04a13276213a02e20df10acbdf02415dda63"}
2024/12/16 13:29:36.723 INFO tls.obtain certificate obtained successfully {"identifier": "chushen.fu.bi", "issuer": "acme-v02.api.letsencrypt.org-directory"}
root@le:~# Job for caddy.service failed because a timeout was exceeded.ifier": "chushen.fu.bi"}

感觉这两句是主要的错误:

2024/12/16 13:26:47.666 WARN http.acme_client HTTP request failed; retrying {"url": "https://acme-v02.api.letsencrypt.org/directory", "error": "performing request: Get "https://acme-v02.api.letsencrypt.org/directory\": context deadline exceeded (Client.Timeout exceeded while awaiting headers)"}
2024/12/16 13:27:50.024 WARN http.acme_client HTTP request failed; retrying {"url": "https://acme-v02.api.letsencrypt.org/directory", "error": "performing request: Get "https://acme-v02.api.letsencrypt.org/directory\": context deadline exceeded (Client.Timeout exceeded while awaiting headers)"}

@233boy
Copy link
Owner

233boy commented Dec 17, 2024

换个域名看看,你80 443 有没有被占用?

@woshichenghaibo
Copy link
Author

换个域名看看,你80 443 有没有被占用?

之前被占用了,系统自带Apache2,我卸载后那个没再提醒占用。如果占用的话你的脚本会有提示的

那我换个别的域名看看

@woshichenghaibo
Copy link
Author

换个域名看看,你80 443 有没有被占用?

root@le:~# Job for caddy.service failed because a timeout was exceeded.
See "systemctl status caddy.service" and "journalctl -xe" for details.

我看到这个提示了,不知道该怎么解决,请指点思路,看来不是域名的问题,因为域名用别的服务器没问题

@woshichenghaibo
Copy link
Author

Job for caddy.service failed because a timeout was exceeded.
See "systemctl status caddy.service" and "journalctl -xe" for details.

我问了一下ai,ai说是证书没签下来

Possible Causes of Timeout:

There are several reasons why the connection to Let's Encrypt might be timing out:

Network Issues:
Your server's internet connection might be unstable or slow.
There could be temporary network congestion between your server and Let's Encrypt.
Firewall Restrictions:
A firewall might be blocking outgoing connections to Let's Encrypt's servers.
DNS Issues:
The DNS records for your domain (chushen.fu.bi) might not be properly configured or propagated.
Troubleshooting Steps:

Check Network Connectivity:
Verify your server has a stable internet connection.
Run a speed test or try pinging acme-v02.api.letsencrypt.org to check latency.
Review Firewall Rules:
Ensure your firewall allows outbound connections to port 443 of acme-v02.api.letsencrypt.org.
Verify DNS Configuration:
Make sure your domain name points to the correct server IP address and the DNS records have propagated globally.
You can use online tools like dig or nslookup to verify propagation.
Additional Tips:

Consider increasing the timeout value in your Caddy configuration (if supported) to provide more time for the connection.
Check the Let's Encrypt status page (https://letsencrypt.org/stats/) for any known outages.
By following these steps and checking the potential causes, you should be able to resolve the timeout issue and allow Caddy to obtain a valid SSL certificate for your domain.

@woshichenghaibo
Copy link
Author

尝试ping,结果如下,是正常的
root@le:~# ping acme-v02.api.letsencrypt.org
PING acme-v02.api.letsencrypt.org(2606:4700:60:0:f53d:5624:85c7:3a2c (2606:4700:60:0:f53d:5624:85c7:3a2c)) 56 data bytes
64 bytes from 2606:4700:60:0:f53d:5624:85c7:3a2c (2606:4700:60:0:f53d:5624:85c7:3a2c): icmp_seq=1 ttl=58 time=39.1 ms
64 bytes from 2606:4700:60:0:f53d:5624:85c7:3a2c (2606:4700:60:0:f53d:5624:85c7:3a2c): icmp_seq=2 ttl=58 time=39.0 ms
64 bytes from 2606:4700:60:0:f53d:5624:85c7:3a2c (2606:4700:60:0:f53d:5624:85c7:3a2c): icmp_seq=3 ttl=58 time=43.0 ms
64 bytes from 2606:4700:60:0:f53d:5624:85c7:3a2c (2606:4700:60:0:f53d:5624:85c7:3a2c): icmp_seq=4 ttl=58 time=39.0 ms
64 bytes from 2606:4700:60:0:f53d:5624:85c7:3a2c (2606:4700:60:0:f53d:5624:85c7:3a2c): icmp_seq=5 ttl=58 time=38.8 ms
64 bytes from 2606:4700:60:0:f53d:5624:85c7:3a2c (2606:4700:60:0:f53d:5624:85c7:3a2c): icmp_seq=6 ttl=58 time=38.9 ms
64 bytes from 2606:4700:60:0:f53d:5624:85c7:3a2c (2606:4700:60:0:f53d:5624:85c7:3a2c): icmp_seq=7 ttl=58 time=38.7 ms
64 bytes from 2606:4700:60:0:f53d:5624:85c7:3a2c (2606:4700:60:0:f53d:5624:85c7:3a2c): icmp_seq=8 ttl=58 time=43.7 ms
64 bytes from 2606:4700:60:0:f53d:5624:85c7:3a2c (2606:4700:60:0:f53d:5624:85c7:3a2c): icmp_seq=9 ttl=58 time=38.7 ms
64 bytes from 2606:4700:60:0:f53d:5624:85c7:3a2c (2606:4700:60:0:f53d:5624:85c7:3a2c): icmp_seq=10 ttl=58 time=38.7 ms
64 bytes from 2606:4700:60:0:f53d:5624:85c7:3a2c (2606:4700:60:0:f53d:5624:85c7:3a2c): icmp_seq=11 ttl=58 time=38.8 ms
^C
--- acme-v02.api.letsencrypt.org ping statistics ---
11 packets transmitted, 11 received, 0% packet loss, time 10011ms
rtt min/avg/max/mdev = 38.678/39.676/43.709/1.748 ms

@woshichenghaibo
Copy link
Author

然后在caddy的日志里面发现了no IPv4 addresses to try as fallback,是不是因为这个原因没有ssl证书的?

2024/12/17 12:25:59.427 ERROR http.acme_client challenge failed {"identifier": "chushen.fu.bi", "challenge_type": "tls-alpn-01", "problem": {"type": "urn:ietf:params:acme:error:malformed", "title": "", "detail": "Unable to contact "chushen.fu.bi" at "2605:6400:5508:3e9::feb2:9821", no IPv4 addresses to try as fallback", "instance": "", "subproblems": []}}
2024/12/17 12:26:00.616 ERROR http.acme_client validating authorization {"identifier": "chushen.fu.bi", "problem": {"type": "urn:ietf:params:acme:error:malformed", "title": "", "detail": "Unable to contact "chushen.fu.bi" at "2605:6400:5508:3e9::feb2:9821", no IPv4 addresses to try as fallback", "instance": "", "subproblems": []}, "order": "https://acme-staging-v02.api.letsencrypt.org/acme/order/176250664/21363607274", "attempt": 1, "max_attempts": 3}
2024/12/17 12:26:01.247 ERROR tls.obtain could not get certificate from issuer {"identifier": "chushen.fu.bi", "issuer": "acme-v02.api.letsencrypt.org-directory", "error": "HTTP 400 urn:ietf:params:acme:error:malformed - Unable to contact "chushen.fu.bi" at "2605:6400:5508:3e9::feb2:9821", no IPv4 addresses to try as fallback"}
2024/12/17 12:26:18.011 ERROR tls.obtain will retry {"error": "[chushen.fu.bi] Obtain: [chushen.fu.bi] solving challenge: chushen.fu.bi: [chushen.fu.bi] authorization failed: HTTP 400 urn:ietf:params:acme:error:malformed - Unable to contact "chushen.fu.bi" at "2605:6400:5508:3e9::feb2:9821", no IPv4 addresses to try as fallback (ca=https://acme-staging-v02.api.letsencrypt.org/directory)", "attempt": 2, "retrying_in": 120, "elapsed": 898.028989572, "max_duration": 2592000}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants