#59842 closed defect (bug) (fixed)
WordPress 6.4 wp_remote_get (cURL error 28: Operation timed out)
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 6.4.1 | Priority: | normal |
| Severity: | critical | Version: | 6.4 |
| Component: | General | Keywords: | has-patch dev-reviewed commit |
| Focuses: | Cc: |
Description (last modified by )
Hello,
WordPress 6.4 update caused wp_remote_get to give "cURL error 28: Operation timed out" errors.
I tested on two fresh WordPress installations.
How to reproduce:
functions.php:
$request = wp_remote_get( 'https://example.com/test.json' ); var_dump($request);
WordPress 6.4:
object(WP_Error)#4571 (3) { ["errors"]=> array(1) { ["http_request_failed"]=> array(1) { [0]=> string(95) "cURL error 28: Operation timed out after 5001 milliseconds with 2050 out of 2766 bytes received" } } ["error_data"]=> array(0) { } ["additional_data":protected]=> array(0) { } }
WordPress 6.3.2:
valid json data in 1 sec
PHP 7.4
Change History (18)
#1
@
2 years ago
#2
@
2 years ago
- Keywords has-patch added
- Severity changed from normal to critical
- Version set to 6.4
This issue should be critical. 6.4 updated the Requests library version which included a breaking change for anyone running on a host with curl version 7.29 (at least).
#3
@
2 years ago
Copied from https://github.com/WordPress/Requests/issues/838#issuecomment-1802386711:
Given the impact, this should be hotfixed right away in WP Core (not waiting for a Requests release) and then we need to talk to the WP systems team to see how we can get that hotfix onto the running systems. I assume that this might be something that can be fixed at the server level for api.wordpress.org.
This ticket was mentioned in Slack in #core-upgrade-install by pbiron. View the logs.
2 years ago
This ticket was mentioned in Slack in #meta by hellofromtonya. View the logs.
2 years ago
This ticket was mentioned in Slack in #core by hellofromtonya. View the logs.
2 years ago
#7
@
2 years ago
*BACKUP FIRST*
If you need to bulk update Curl.php for multiple WordPress instances:
fix_wp_curl.sh:
/bin/bash
# Define the pattern to search for and the replacement string
search_for="if (\$this->version < self::CURL_7_22_0 && !isset(\$headers\['Connection'\])) {"
replace_with="if (!isset(\$headers['Connection'])) {"
# Define the path to the Curl.php files relative to the WordPress installations
relative_path="wp-includes/Requests/src/Transport/Curl.php"
# Find all Curl.php files under the specified directory
# Usually, WordPress installations are under /var/www/vhosts/ in Plesk
find /var/www/vhosts/ -type f -name "Curl.php" | while read file; do
# Check if the file contains the string we want to replace
if grep -q "$search_for" "$file"; then
# Take a backup of the original file
cp "$file" "$file.bak"
# Replace the string
sed -i "s/$search_for/$replace_with/" "$file"
# Output the file path that was changed
echo "Modified: $file"
else
# Output the file path that was not changed because the pattern was not found
echo "Pattern not found, not modified: $file"
fi
done
# Script complete message
echo "All matching instances have been updated."
#8
@
2 years ago
- Milestone changed from Awaiting Review to 6.4.1
Moving into 6.4.1.
Currently being discussed in Make/Core slack #core channel.
#10
@
2 years ago
A hotfix release for Requests was published: https://github.com/WordPress/Requests/releases/tag/v2.0.9
#11
@
2 years ago
- Owner set to desrosj
- Resolution set to fixed
- Status changed from new to closed
In 57086:
#12
@
2 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
Reopen for backport considersation
More info:
If the json file is bigger than 2048 bytes:
cURL error 28: Operation timed out after 5001 milliseconds with 2050 out of 2051 bytes received