Avatar not showing up though avatar_url is correct

(Kai Middleton) #1

I’m running Discourse in a container and using SSO to login from a parent node/expressjs webapp. The SSO login is working correctly, and passing the right avatar_url to Discourse, but Discourse is not displaying the user’s avatar – it just displays a letter such as “K” if the user is kai. Here is some info from the production.log file.

In particular, this URL has a valid gif image:

My friend suggested that the server I’m using is providing https via a self signed cert, though I see no error in production.log or unicorn.stderr.log or production_errors.log.

More from production.log:

nonce: 23235234f235225d5567
name: Kai Advisor
username: Kai Advisor
email: kai+advisor@gmail.com
external_id: 59a0970c9fc69410a5743801
admin: false
moderator: false
Redirected to
Completed 302 Found in 74ms (ActiveRecord: 18.4ms)
Started GET "/forum/" for at 2017-09-17 23:54:07 +0000
Processing by ListController#latest as HTML
  Rendered list/list.erb within layouts/application (1.3ms)
  Rendered layouts/_head.html.erb (1.9ms)
  Rendered common/_discourse_stylesheet.html.erb (0.1ms)
  Rendered common/_special_font_face.html.erb (0.1ms)
  Rendered application/_header.html.erb (0.1ms)
  Rendered common/_discourse_javascript.html.erb (0.3ms)
Completed 200 OK in 70ms (Views: 6.7ms | ActiveRecord: 21.1ms)

(Kane York) #2

Discourse needs to be able to access the Avatar URL to download it, so it must not be in internal IP space (or you must correctly set up routing).

(Kai Middleton) #3 isn’t the actual server URL. I’m using an Amazon instance. is just an example. E.g. I’ve also changed the actual email address.

(Felix Freiberger) #4

Is the site setting SSO overrides avatar enabled? Are these new accounts or logins to existing accounts?

(Kai Middleton) #5

Yes, I do have “sso overrides avatar” checked.

I also have these checked:
sso overrides bio
sso overrides email
sso overrides username
sso overrides name

and also the following:
disable: email editable
disable: automatically download gravatars
disable: allow uploaded avatars
enable: enable_sso
enable: sso_secret
enable: sso_url

(Felix Freiberger) #6

I’m guessing here, but… could you try enabling that?

(Kai Middleton) #7

Hm. Hi, thanks for that – I enabled “allow uploaded avatars”. Didn’t work. I created an entirely new user in my node/express app, then logged in to the forum. But again, the avatar appeared as a capital K, not the picture stored at the avatar_url location. I go to production.log (as described above), test the avatar_url manually, and it shows the proper image.

(Felix Freiberger) #8

Hm, I’m out of ideas for now, sorry. Maybe snooping around here can generate a few new ideas:

(Dany) #9

I got the exact same problem. First i thought it was because my url didn’t included the image format (ex : .jpg) but even with the image extention included still doesn’t work.

Did you manage to find a solution ?

Official Single-Sign-On for Discourse (sso)