WordPress.org

Make WordPress Core

Opened 3 weeks ago

Closed 3 weeks ago

Last modified 3 weeks ago

#48379 closed defect (bug) (fixed)

Expand error codes to include all 5xx HTTP errors when retring to create image sub-sizes

Reported by: azaozz Owned by: azaozz
Milestone: 5.3 Priority: normal
Severity: normal Version: trunk
Component: Upload Keywords: has-patch commit dev-reviewed
Focuses: Cc:
PR Number:

Description

Related #47872.

After [46506] it became apparent that the server may return HTTP 504 or 508 errors when resizing of images failed. The server may be set to return other 5xx error codes too. To fix this additional requests to retry to create image sub-sizes should happen on all HTTP 5xx errors.

Attachments (1)

48379.diff (3.1 KB) - added by azaozz 3 weeks ago.

Download all attachments as: .zip

Change History (14)

#1 @azaozz
3 weeks ago

Setting this tentatively for 5.3 as it will fix the new functionality to work for all users and with most server configurations.

@azaozz
3 weeks ago

#2 @azaozz
3 weeks ago

In 48379.diff: Try to create image sub-sizes again after all HTTP 5xx errors.

This ticket was mentioned in Slack in #hosting-community by azaozz. View the logs.


3 weeks ago

#4 @mikeschroder
3 weeks ago

As reference / one example, it looks like 508 is commonly used by cPanel (see discussion on Slack), so I think at the very least we should fix that.

Upon a bit more research, looks like this isn't the only other code in the 5xx range that is used.

To cover the most cases, I agree retrying for any 5xx would be the best.

Trying to see if I can get this working on my test setup for retries that worked previously.

This ticket was mentioned in Slack in #core-media by mike. View the logs.


3 weeks ago

#6 @mikeschroder
3 weeks ago

  • Keywords has-patch needs-testing added

#7 @azaozz
3 weeks ago

  • Summary changed from Expand error codes to include all 5xx HTTP errors when retring to create imabe sub-sizes to Expand error codes to include all 5xx HTTP errors when retring to create image sub-sizes

#8 @mikeschroder
3 weeks ago

Just a quick update that this looks to work with tests so far in the media library.

This ticket was mentioned in Slack in #core by david.baumwald. View the logs.


3 weeks ago

This ticket was mentioned in Slack in #core by azaozz. View the logs.


3 weeks ago

#11 @SergeyBiryukov
3 weeks ago

  • Keywords commit dev-reviewed added; needs-testing removed

48379.diff looks good to me.

#12 @azaozz
3 weeks ago

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

In 46566:

Upload: Expand error codes to include all 5xx HTTP errors when retrying to create image sub-sizes. Some servers may be configured to set HTTP 508 or 504, or possibly other 5 errors.

Porps mikeschroder, azaozz.
Fixes #48379.

This ticket was mentioned in Slack in #core-media by mike. View the logs.


3 weeks ago

Note: See TracTickets for help on using tickets.