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

cURL error 28: Operation timed out after 10000 milliseconds with 0 bytes received #147

Open
manzu opened this issue Apr 1, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@manzu
Copy link

manzu commented Apr 1, 2023

Wordpress REST API seems to fail because cURL times out after 10 seconds.
I noticed some comments that timeouts are broken because FrankenPHP uses ZTS? (probably for performance reasons?
)
I tried editing the Caddyfile main block and adding a timeouts directive in the frankenphp block but it doesn't seem to affect the error.

Can someone point me in a solvable direction?

@withinboredom
Copy link
Collaborator

Can you run curl with -vvv and drop the output here? It would help narrow down where it gets stuck at.

@manzu
Copy link
Author

manzu commented Apr 2, 2023

well @withinboredom it's a wordpress call around https://github.com/WordPress/WordPress/blob/master/wp-admin/includes/class-wp-site-health.php#L2093

I've tried setting CURLOPT_VERBOSE to true in https://github.com/WordPress/WordPress/blob/master/wp-includes/Requests/src/Transport/Curl.php#L203 but all I get (in the STDERR of the frankenphp container) is:

/app/public# 2023/04/02 20:29:45.674	INFO	http.log.access.log0	handled request	{"request": {"remote_ip": "172.17.0.2", "remote_port": "50324", "proto": "HTTP/1.1", "method": "GET", "host": "domain.name", "uri": "/wp-admin/", "headers": {"Accept": ["text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"], "Accept-Language": ["en-GB,en;q=0.9"], "Cookie": [], "X-Forwarded-Host": ["lucianstuparu.ro"], "X-Forwarded-Proto": ["https"], "User-Agent": ["Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.3 Safari/605.1.15"], "Accept-Encoding": ["gzip, deflate, br"], "X-Forwarded-For": ["104.28.106.146"]}}, "user_id": "", "duration": 2.586082552, "size": 125049, "status": 200, "resp_headers": {"X-Powered-By": ["PHP/8.2.0"], "Expires": ["Wed, 11 Jan 1984 05:00:00 GMT"], "Cache-Control": ["no-cache, must-revalidate, max-age=0"], "Referrer-Policy": ["strict-origin-when-cross-origin"], "X-Frame-Options": ["SAMEORIGIN"], "Content-Type": ["text/html; charset=UTF-8"], "Server": ["Caddy"]}}
*   Trying ip_address:443...
* Connected to domain.name (ip_address) port 443 (#0)
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*  CAfile: /etc/ssl/certs/ca-certificates.crt
*  CApath: /etc/ssl/certs
* SSL connection using TLSv1.3 / TLS_AES_128_GCM_SHA256
* ALPN, server accepted to use http/1.1
* Server certificate:
*  subject: CN=domain.name
*  start date: Mar 22 15:46:28 2023 GMT
*  expire date: Jun 20 15:46:27 2023 GMT
*  issuer: C=US; O=Let's Encrypt; CN=R3
*  SSL certificate verify ok.
> GET /wp-json/wp/v2/types/post?context=edit HTTP/1.1
Host: domain.name
User-Agent: WordPress/6.2; https://domain.name
Accept: */*
Accept-Encoding: deflate, gzip, br
Cache-Control: no-cache
X-WP-Nonce: 592b45dffe
Cookie: wordpress_sec_e3637abc6a432c3b9a9ebbdc62fee51d=<cookie content>; wordpress_sec_b5aa9253db72164d3a0b6527e8100f22=<cookie content>; tk_ai=jetpack:yW8ZZmGajuaG93yfLi+uotq8; wordpress_logged_in_e3637abc6a432c3b9a9ebbdc62fee51d=<cookie content>; wordpress_test_cookie=WP Cookie check; wp-settings-1=libraryContent=browse&editor=html&hidetb=0; wp-settings-time-1=1679520322; wordpress_logged_in_b5aa9253db72164d3a0b6527e8100f22=<cookie content>
Connection: close

* Operation timed out after 10001 milliseconds with 0 bytes received
* Closing connection 0

@withinboredom
Copy link
Collaborator

Hmmm ... looking at the output, it looks like you received headers, so that means we are definitely getting a reply of some sort.

Some experiments to try:

  • I'm wondering if you disable output buffering in PHP if you'll get a response?
  • I also notice that you're connecting with HTTP 1.1, it might be worth trying with 2 (try with the --http2 option).

Do any other endpoints work? In other words, could it be that this endpoint takes more than 10s to reply and a timeout is too small somewhere?

@dunglas
Copy link
Owner

dunglas commented Apr 3, 2023

Could it be related to dunglas/frankenphp-wordpress#8?

@manzu
Copy link
Author

manzu commented Apr 3, 2023

yes @dunglas it is, but i’m not sure it’s from the wordpress version of frankenphp. that’s why i posted here

@dunglas dunglas added the bug Something isn't working label Dec 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants