Automattic / wp-calypso

The JavaScript and API powered WordPress.com
https://developer.wordpress.com
GNU General Public License v2.0
12.39k stars 1.98k forks source link

Media not loading in Calypso and refreshing leads to site picker #92192

Open jp-imagines opened 2 weeks ago

jp-imagines commented 2 weeks ago

Quick summary

On two sites so far, all images fail to load in the Calypso media library despite the sites being public (including after toggling site privacy to Coming Soon and/or Private and back again). Thumbnails do not load in the Calypso media grid and editing an image fails to load it as well. Direct image URLs and WP Admin are unaffected.

API requests for images are returning 403s.

Also, when refreshing the page on any Calypso page for affected sites, you are redirected to the site-agnostic variant of that page and/or the site picker (e.g. refreshing at wordpress.com/media/SITE leads to wordpress.com/media).

Steps to reproduce

On affected sites:

  1. Navigate to Media (wordpress.com/media/SITE).
  2. See that media thumbnails are not loading.
  3. Click on an image and click "Edit."
  4. See that the image does not load.
  5. Copy the image's URL and visit it in your browser, or switch to WP Admin.
  6. See that all images do load.
  7. Visit any Calypso page again, and refresh the page.
  8. See that you are brought to the site picker dialog or site-agnostic Calypso page.

What you expected to happen

Images and image thumbnails should load in Calypso. Refreshing the page in Calypso should not redirect to the site picker or site-agnostic view.

What actually happened

Images do not load, with 403 errors:

OmuoTF.png

Refreshing in Calypso redirects.

Impact

Some (< 50%)

Available workarounds?

Yes, easy to implement

Platform (Simple and/or Atomic)

Atomic

Logs or notes

Unable to replicate on test sites yet, but two reports have come in back to back from different Atomic sites. Other sites on their accounts are unaffected, and one user noted this started recently.

Workaround for the media library is to use WP Admin/"classic" view instead.

jp-imagines commented 2 weeks ago

Initial report in 8401121-zd-a8c

jamiepalatnik commented 2 weeks ago

Adding my report for the second site: 8401106-zd-a8c Discussed on Slack: p1719518907527589-slack-C03TY6J1A

mrfoxtalbot commented 2 weeks ago

I checked the two pages affected and images load fine in Calypso... I am going to close this as cannot repro (a temporary shortage), but please feel free to re-open if needed.

jp-imagines commented 2 weeks ago

@mrfoxtalbot I checked again today, and had a teammate who hasn't viewed either site check as well to rule out any caching on my end, and we're both still able to replicate the issue. Details shared at p1719580196051499/1719518907.527589-slack-C03TY6J1A.

Re-opening the issue.

hacchism commented 2 weeks ago

Another case: 8400942-zd-a8c

aleone89 commented 2 weeks ago

Another case reported in: 8184284-zd-a8c

looking at the media library, there’s a lot of images in the media library, nearly 8,000 items, and there’s a few in there which is in the MB in size. Which may have an impact. in WP Admin, everything loads fine.

jartes commented 2 weeks ago

I was able to reproduce this but on simple sites. Escalated internally on p1720011429811589-slack-C02FMH4G8

@jp-imagines @aleone89 @hacchism @jamiepalatnik just a heads-up that media library images are not displayed on Support Sessions #91764

mgozdis commented 1 week ago

just a heads-up that media library images are not displayed on Support Sessions

Isn't that only if the site is Private?

With other user reports I've seen, it didn't matter if the site was Private or not. The API was returning 403 or 404 responses in Calypso, but loads fine in wp-admin. Usually the media library loads perfectly fine in Calypso in a support session as long as the site isn't Private. Private sites display this notice: itgsfY.png

sajmes commented 1 week ago

This issue appears to be happening here: 8267946-zd-a8c

druesome commented 1 week ago

In two cases that I handled, both sites were having an identity crisis. Fixing that up made the images show up again.

jamiepalatnik commented 6 days ago

There does not seem to be an identity crisis on the site from this user report: 8401106-zd-a8c

When I checked via SSP, the issue persists on the site.

supernovia commented 3 days ago

Here's one on a private site with an Explorer plan. I made the video small to blur out the site address (sorry, I should get better tools for editing) but you can see the general idea.

I'll also attach a screenshot of the console errors.

The normal wp-admin media view was fine.

https://github.com/user-attachments/assets/66ff7815-f9f3-4602-91f8-ac92623759f1

Screenshot 2024-07-14 at 2 45 40 PM

for 8481463-zd-a8c

mrfoxtalbot commented 18 hours ago

Thank you, @supernovia!

Here's one on a private site

Does the issue persist if the site is set to public or to coming soon?