Avatars not always showing up after refresh

(Franz) #1

This is possibly not strictly Discourse-related, but since I followed the Discourse on Digital Ocean tutorial rather scrupulously, I figured there might be other people with the same problem, and who can hopefully provide some hints at resolving it.

I’m administrating a Discourse instance at https://forum.appleseedhq.net/ (note: HTTPS). When I refresh the page (by pressing F5 or CTRL-F5), it often happens that the avatar images do not appear correctly (the images don’t load), and there are many such errors in the console:

Failed to load resource: net::ERR_CONNECTION_CLOSED

Eventually all the avatar images end up loading correctly, usually after many refreshes.

The problem happens both on Chrome 39 and Firefox 31.

Any idea what’s going on? Could it be SSL-related?

[SOLVED] Errors loading avatars with HTTPS enabled
(Régis Hanol) #2

Are there any errors related to avatars in /logs?

(Franz) #3

Nothing related to avatars, as far as I can tell:

(Franz) #4

Still having this issue, you can try for yourself here: https://forum.appleseedhq.net/. If anyone has any clue / direction for investigation, I’m all ears!

(blaumeer) #5

I experience this issue from time to time, but have attributed it to a browser cache issue. Anyway, I sometimes find error logs like this:

Errno::ENOENT (No such file or directory - public/uploads/letter_avatars/2/G/164_199_145/45.png)

(Franz) #6

This forum is the only site where that issue happens, which makes me think it’s either host or Discourse related…

No such errors in my logs…

(Eric Vantillard) #7

Same here. After ssl enabling my discourse instance and restarting it.

No errors in logs and the http fir the image return 200.

example here : https://discourse.sophiebarat.fr/user_avatar/discourse.sophiebarat.fr/evantill/25/2.png

to make my avatar work again :

  • change it to default avatar and save.
  • select gravatar and click the refresh button.
  • save my preferences.

here the recovered image : https://discourse.sophiebarat.fr/user_avatar/discourse.sophiebarat.fr/evantill/25/7.png

Is there some option to rebuild all avatars ?

(Franz) #8

Quick question to the Discourse developers: are avatars on the main page loaded through Ajax requests?

(Régis Hanol) #9

No, they aren’t. But we do generate thumbnails on the fly if needed.

(Jakob Borg) #10

For what it’s worth I see the same on my forums, which are all on SSL and the regular Docker install. In normal usage, avatars work fine. Forcing a reload in the browser will leave most avatars as “broken image” symbols. Refreshing again brings back most of them. Refreshing a third time usually clears things up. I’ve mostly interpreted it as a rate limiting or load related issue; when the browser sends requests for too many avatars at the same time, it breaks. When most are cached, it’s fine.

(Jeff Atwood) #11

Hmm can we repro this @sam?

(Eric Vantillard) #12

How can we help on this topic ?

(Franz) #13

I would really like to see this bug fixed.

I’m happy to provide full access to my Discourse instance to trusted members of the Discourse community in order to repro/investigate/fix this issue.

(Jeff Atwood) #14

How do I repro it? I visited

and refreshed that page 10-20 times using f5 and ctrl+f5 and I am not seeing any missing avatars?

(Franz) #15

It doesn’t always happen. Right now it’s not happening for me either. It consistently happened half an hour ago though. Maybe try in half an hour? Just F5 I guess.

(Franz) #16

Just did a simple F5 refresh and it happened:

(Jeff Atwood) #17

Aha, me too:

I suggest rebuilding your container:

  • log in via SSH
  • cd /var/discourse
  • git pull
  • ./launcher rebuild app

(Franz) #18

cd /var/docker I suppose.

Were there any changes related to this problem recently? For what it’s worth, I’ve been having this issue since I switched to Discourse this spring.

(Jeff Atwood) #19

That implies you aren’t on V1.0 – part of the V1.0 howto is to rename that folder. But I see from version in the HTML that you are…

(Franz) #20

I must have missed this step then :slight_smile: I switched to V1 when it became available. I’m running 1.1.0.beta6b at the moment.

Just rebuilt the container, let’s see if this fixes the problem…

Thanks for the help.