User uploaded avatars not displaying


(David Liaw) #1

This happens on meta as well and could also happen on other discourse sites, but essentially if I try to upload a square avatar it won’t display it and default back to the letter. However, if I upload a non-square avatar it will display that (after saying that it needs to be cropped).
This also happened to various users, so it isn’t just me.

I ruled out browser extensions and amazon already, so now I’m not quite sure what the issue could be.
Ideas?

I was going to include a gfy/vid but it kept bugging up so I scrapped that idea :neutral_face:


(Régis Hanol) #2

Hmm I just tried updating a square image as my avatar on try and it worked just fine. Could it be specific to the image(s) you’re trying to use?


(Jeff Atwood) #3

If you can provide the image here and give us repro steps we can test it on try.discourse.org.


(David Liaw) #4

I just tried again on here and it worked…so I’m super confused right now. It’s still not working on my own instance though, I might just start afresh since I’ve been wanting to do it for a while.

But I managed to capture the problem (I didn’t have any different images on hand):


AccomplishedFavorableGenet

I’m not getting anything in console and it appears to properly upload and get the image again, but doesn’t show up in the UI.


(Régis Hanol) #5

Are you using a CDN? Have you tried waiting for a bit before uploading another avatar?


(David Liaw) #6

I thought about it, but since I can upload rectangle images and have them shown straight away (as shown in gfy) probably rules the CDN out too. I even tested it by accessing the site without the CDN in between and tried uploading the avatar, didn’t make a difference.


(Régis Hanol) #7

Got anything in the console? Like 404 or 503?


(David Liaw) #8

Sometimes it POSTs and GETs properly, but other times it returns a 206 (Partial content).


(Mittineague) #9

Dumb question most likely, but are you sure it’s a shape problem and not a weight or dimension issue?
i.e. if presented with “crop”, did you?


(David Liaw) #10

I tried it in Chrome and found that when uploading a square image it gives me a CORS stating that there is no ‘Access-Control-Allow-Origin’ header present (and returns a 206 Status code). I think non square images work because it doesn’t go to Amazon but rather stays in Discourse’s upload directory (well at least that’s what it looks like after watching the network tab).

@codinghorror Sorry to bug you, but any ideas? iirc I read that you’re phasing out the use of Amazon, so is it worth switching back to letting Discourse handle uploads?


(Sam Saffron) #11

yes definately, move to Discoruse to handle uploads asap. have not seen the particular bug you are talking about on meta, what is an exact repro with images involved?


(David Liaw) #12

I honestly don’t know, one day it just broke for everyone that wanted to use square images (which go straight to Amazon AFAIK) and rectangular images obviously worked since they go to Discorse’s upload dir after being cropped.
I’ll just shift back to letting discourse handle it anyway since my free aws plan is also about to expire and I’m a cheap ass lol


(dirkcuys) #13

@sam what is the best way to move back to letting Discourse handle uploads?


(Sam Saffron) #14

I think

./launcher enter app
rake uploads:migrate_from_s3

should do the trick, post here and cc @zogstrip if it has any issues, once data is migrated go ahead and turn it off.


[Paid] Restore broken images uploaded to S3
(Jeff Atwood) #16