wagtail / wagtail.org

Wagtail’s official marketing website

Home Page:https://wagtail.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Account profile picture breaks when it is changed from default image

vossisboss opened this issue · comments

When I upload a new profile picture, the image doesn't change and it appears as broken image link throughout the rest of the website. I've tried using a smaller image and a different file format, but got the same results.

Here is a screenshot of what happens on the account profile page when I upload the photo:

Screen Shot 2022-07-13 at 4 27 28 PM

And here are some screenshots of what is displayed instead of the photo in key places:

Screen Shot 2022-07-13 at 4 27 35 PM

Screen Shot 2022-07-13 at 4 28 10 PM

I tried to replicate the issue in my local installation of the website but it appears to be functioning properly in that instance. In the local environment, the image displays properly on the account profile page like this:

Screen Shot 2022-07-13 at 4 30 19 PM

So it appears that the issue is only in the production environment yet I'm not sure where to check for errors related to images. Would love to hear any suggestions to help track this down.

Can you replicate this with bakerydemo? or a simple wagtail start instance?

I'll give it a try when @zerolab and see what happens. I assume you would roll back the Wagtail version to the one we're currently using on production?

Yes. looks like prod is on 2.16. So it may be an issue with the instance, rather than Wagtail 2.16 as we would've had bug reports by now 🤔

@zerolab So rolling back the Bakery to 2.16 is more trouble than it's worth to test this (would have to undo things related to wagtail.admin.panels, etc.).

Did a fresh wagtail start sit and the image uploaded fine.

Screen Shot 2022-07-14 at 9 19 20 AM

So it looks like this is an issue with the instance. I suppose now is as good as time as any to see if I have the permissions to access our Heroku logs...

@zerolab I do have access to our logs. There were no obvious errors when I tried adding my image again and when I replicated the issue by creating a new user. Granted, I'm not as familiar with the activity on our production app, so if the error is a more subtle one, I'm not likely to spot it right away.

Screen Shot 2022-07-14 at 10 14 58 AM

I looked in the inspector and it appears that the image file exists. It's just not being loaded and I'm not sure why.

Screen Shot 2022-07-14 at 10 41 13 AM

The only other places I can think to check is to confirm whether the file is actually appearing in our AWS storage bucket and/or whether the issue can be replicated on our dev instance. I don't currently have access to either of those. Should I pursue access? Or team up with someone who has it?

P.S. I also checked this issue in different browsers and it is broken in Chrome, Firefox and Safari.

that looks like an S3 permissions issue to me. One to speak with sysadmin about

Ah. I'll file a ticket in Codebase then and see if someone has any insights on that front. I'll close this out after I hear back. Thanks @zerolab !

Yep definitely an issue with the hosting infrastructure, as opposed to something in the application itself.

Will keep this issue open to track, but moving discussion internal.

The problem was that avatar_images/ wasn't accessible to the world, which is where Wagtail stores its avatar images:

https://github.com/wagtail/wagtail/blob/716bf92c2dc2da2aca5e8f5aa6768b5b087cd4b0/wagtail/users/models.py#L10-L17

Ideally avatars would reuse the rendition logic, which would not only resize them, but also serve them from a location which was already accessible. See also wagtail/wagtail#755

I've deployed a configuration change, and tested the avatar images now appear:

image

Thank you for tracking this down @RealOrangeOne !