WordPress.org

Make WordPress Core

Opened 14 months ago

Closed 13 months ago

Last modified 13 months ago

#38226 closed defect (bug) (fixed)

"cURL error 23: Failed writing body" when updating plugins or themes

Reported by: SergeyBiryukov Owned by: dd32
Milestone: 4.7.1 Priority: normal
Severity: normal Version: 4.6
Component: HTTP API Keywords: has-patch commit
Focuses: Cc:

Description

After upgrading to 4.6, some users reported an error when upgrading plugins or themes:

Download failed. cURL error 23: Failed writing body (624 != 811)

Apparently it happens if mbstring.func_overload is enabled and body length is calculated incorrectly.

Previously, this was solved by using mbstring_binary_safe_encoding()/reset_mbstring_encoding(), see [25348].

However, [37428] removed those calls, and it seems like Requests is not mbstring-aware.

Attachments (1)

38226.patch (847 bytes) - added by SergeyBiryukov 14 months ago.

Download all attachments as: .zip

Change History (10)

#1 @SergeyBiryukov
14 months ago

38226.patch restores mbstring_binary_safe_encoding()/reset_mbstring_encoding() calls.

Needs testing on the affected installs.

Last edited 14 months ago by SergeyBiryukov (previous) (diff)

#2 @dd32
14 months ago

  • Component changed from Upgrade/Install to HTTP API

#4 @SergeyBiryukov
14 months ago

Got at least one report that the patch does resolve the issue.

Found another thread on the English forums, commented there:
https://wordpress.org/support/topic/after-update-to-46-keep-getting-curl-error-23/page/2/#post-8157376

This ticket was mentioned in Slack in #forums by yui. View the logs.


14 months ago

#7 @SergeyBiryukov
14 months ago

  • Keywords commit added; needs-testing removed

#8 @dd32
13 months ago

  • Owner set to dd32
  • Resolution set to fixed
  • Status changed from new to closed

In 38894:

HTTP: Call mbstring_binary_safe_encoding() before making a request with Requests to avoid issues with mbstring.func_overload.

Props SergeyBiryukov.
Fixes #38226.

#9 @dd32
13 months ago

In 38895:

HTTP: Call mbstring_binary_safe_encoding() before making a request with Requests to avoid issues with mbstring.func_overload.

Props SergeyBiryukov.
Merges [38894] to the 4.6 branch.
Fixes #38226.

Note: See TracTickets for help on using tickets.