New letter avatars are sometimes blank


(pjv) #1

Lots of moving parts here, so this is probably more of a request for pointers on where to look to figure out what the problem is. Here is the symptom visually:

I am using Wordpress SSO (via the PrimeTime SSO Plugin, poke @etc ) as well as the wp-discourse plugin (though not using SSO through that plugin because it doesn’t work for me) and I created a new test user in wordpress and then logged in from Discourse as that test user. The letter avatar for the test user shows as in the picture above, i.e. there is no letter.

When I first set up and connected Discourse with WP, using my WP admin account, the avatar created in Discourse was fine for that user:

Having taken a cursory look through the avatar creation code (and not being a ruby dev at all), my first thought was that maybe there is some sequence of events in a wordpress SSO login for a new user where it is trying to create the avatar before it knows the user’s name? Obviously since the first user worked, it doesn’t always happen. I’m sorry but I have no idea what difference there might have been in the sequence of events between the user that worked and the one that didn’t.

I also have the Discourse preference set called “sso overrides avatar”, thinking that if our existing users happened to have an avatar set already in their wordpress profile that it would be good to import it. But looking at the code of the PrimeTime SSO plugin, it looks to me like they are not implementing avatars as part of the SSO payload. In any case, neither my original admin user nor the new test user had wordpress avatars defined.

So, with all that background here are a couple specific questions:

  1. Where should I look to try to figure out how/why this might be happening?
  2. Is there any way on the Discourse side to force a “re-creation” of the letter avatar for a specific user?

(Adam Capriola) #2

I just noticed I’ve been getting the sporadic blank avatar too:

I also use SSO but I don’t have sso overrides avatar enabled. I’m not sure when this started – I’m only noticing now because I changed the welcome message sender from system back to myself recently and am seeing the avatars in my messages. (No one with a blank avatar has posted on my forums yet.)


(John Muhl) #3

It’s also happening to new users on http://try.discourse.org/


(pjv) #4

If that’s the case, maybe I should move this topic into the “Bug” category.


(etc) #5

@pjv Note: I responded to the github ticket.


(Sam Saffron) #6

I wonder if this is new and related to our recent image magick upgrade. Regardless will have a look today.


(Sam Saffron) #7

Yeah @elberet pretty sure this happened cause the image magick we now have installed is missing fonts. Will figure out how to fix.

convert -list font is coming back blank.

Used to be:

/# convert -list font

Path: /etc/ImageMagick/type-ghostscript.xml
  Font: AvantGarde-Book
    family: AvantGarde
    style: Normal
    stretch: Normal
    weight: 400
    glyphs: /usr/share/fonts/type1/gsfonts/a010013l.pfb
  Font: AvantGarde-BookOblique
    family: AvantGarde
    style: Oblique
    stretch: Normal
    weight: 400
    glyphs: /usr/share/fonts/type1/gsfonts/a010033l.pfb
  Font: AvantGarde-Demi
    family: AvantGarde
    style: Normal
    stretch: Normal
    weight: 600
    glyphs: /usr/share/fonts/type1/gsfonts/a010015l.pfb
  Font: AvantGarde-DemiOblique
    family: AvantGarde
    style: Oblique
    stretch: Normal
    weight: 600
    glyphs: /usr/share/fonts/type1/gsfonts/a010035l.pfb
  Font: Bookman-Demi
    family: Bookman
    style: Normal
    stretch: Normal
    weight: 600
    glyphs: /usr/share/fonts/type1/gsfonts/b018015l.pfb
  Font: Bookman-DemiItalic
    family: Bookman
    style: Italic
    stretch: Normal
    weight: 600
    glyphs: /usr/share/fonts/type1/gsfonts/b018035l.pfb
  Font: Bookman-Light
    family: Bookman
    style: Normal
    stretch: Normal
    weight: 300
    glyphs: /usr/share/fonts/type1/gsfonts/b018012l.pfb
  Font: Bookman-LightItalic
    family: Bookman
    style: Italic
    stretch: Normal
    weight: 300
    glyphs: /usr/share/fonts/type1/gsfonts/b018032l.pfb
  Font: Courier
    family: Courier
    style: Normal
    stretch: Normal
    weight: 400
    glyphs: /usr/share/fonts/type1/gsfonts/n022003l.pfb
  Font: Courier-Bold
    family: Courier
    style: Normal
    stretch: Normal
    weight: 700
    glyphs: /usr/share/fonts/type1/gsfonts/n022004l.pfb
  Font: Courier-BoldOblique
    family: Courier
    style: Oblique
    stretch: Normal
    weight: 700
    glyphs: /usr/share/fonts/type1/gsfonts/n022024l.pfb
  Font: Courier-Oblique
    family: Courier
    style: Oblique
    stretch: Normal
    weight: 400
    glyphs: /usr/share/fonts/type1/gsfonts/n022023l.pfb
  Font: fixed
    family: Helvetica
    style: Normal
    stretch: Normal
    weight: 400
    glyphs: /usr/share/fonts/type1/gsfonts/n019003l.pfb
  Font: Helvetica
    family: Helvetica
    style: Normal
    stretch: Normal
    weight: 400
    glyphs: /usr/share/fonts/type1/gsfonts/n019003l.pfb
  Font: Helvetica-Bold
    family: Helvetica
    style: Normal
    stretch: Normal
    weight: 700
    glyphs: /usr/share/fonts/type1/gsfonts/n019004l.pfb
  Font: Helvetica-BoldOblique
    family: Helvetica
    style: Italic
    stretch: Normal
    weight: 700
    glyphs: /usr/share/fonts/type1/gsfonts/n019024l.pfb
  Font: Helvetica-Narrow
    family: Helvetica Narrow
    style: Normal
    stretch: Condensed
    weight: 400
    glyphs: /usr/share/fonts/type1/gsfonts/n019043l.pfb
  Font: Helvetica-Narrow-Bold
    family: Helvetica Narrow
    style: Normal
    stretch: Condensed
    weight: 700
    glyphs: /usr/share/fonts/type1/gsfonts/n019044l.pfb
  Font: Helvetica-Narrow-BoldOblique
    family: Helvetica Narrow
    style: Oblique
    stretch: Condensed
    weight: 700
    glyphs: /usr/share/fonts/type1/gsfonts/n019064l.pfb
  Font: Helvetica-Narrow-Oblique
    family: Helvetica Narrow
    style: Oblique
    stretch: Condensed
    weight: 400
    glyphs: /usr/share/fonts/type1/gsfonts/n019063l.pfb
  Font: Helvetica-Oblique
    family: Helvetica
    style: Italic
    stretch: Normal
    weight: 400
    glyphs: /usr/share/fonts/type1/gsfonts/n019023l.pfb
  Font: NewCenturySchlbk-Bold
    family: NewCenturySchlbk
    style: Normal
    stretch: Normal
    weight: 700
    glyphs: /usr/share/fonts/type1/gsfonts/c059016l.pfb
  Font: NewCenturySchlbk-BoldItalic
    family: NewCenturySchlbk
    style: Italic
    stretch: Normal
    weight: 700
    glyphs: /usr/share/fonts/type1/gsfonts/c059036l.pfb
  Font: NewCenturySchlbk-Italic
    family: NewCenturySchlbk
    style: Italic
    stretch: Normal
    weight: 400
    glyphs: /usr/share/fonts/type1/gsfonts/c059033l.pfb
  Font: NewCenturySchlbk-Roman
    family: NewCenturySchlbk
    style: Normal
    stretch: Normal
    weight: 400
    glyphs: /usr/share/fonts/type1/gsfonts/c059013l.pfb
  Font: Palatino-Bold
    family: Palatino
    style: Normal
    stretch: Normal
    weight: 700
    glyphs: /usr/share/fonts/type1/gsfonts/p052004l.pfb
  Font: Palatino-BoldItalic
    family: Palatino
    style: Italic
    stretch: Normal
    weight: 700
    glyphs: /usr/share/fonts/type1/gsfonts/p052024l.pfb
  Font: Palatino-Italic
    family: Palatino
    style: Italic
    stretch: Normal
    weight: 400
    glyphs: /usr/share/fonts/type1/gsfonts/p052023l.pfb
  Font: Palatino-Roman
    family: Palatino
    style: Normal
    stretch: Normal
    weight: 400
    glyphs: /usr/share/fonts/type1/gsfonts/p052003l.pfb
  Font: Symbol
    family: Symbol
    style: Normal
    stretch: Normal
    weight: 400
    glyphs: /usr/share/fonts/type1/gsfonts/s050000l.pfb
  Font: Times-Bold
    family: Times
    style: Normal
    stretch: Normal
    weight: 700
    glyphs: /usr/share/fonts/type1/gsfonts/n021004l.pfb
  Font: Times-BoldItalic
    family: Times
    style: Italic
    stretch: Normal
    weight: 700
    glyphs: /usr/share/fonts/type1/gsfonts/n021024l.pfb
  Font: Times-Italic
    family: Times
    style: Italic
    stretch: Normal
    weight: 400
    glyphs: /usr/share/fonts/type1/gsfonts/n021023l.pfb
  Font: Times-Roman
    family: Times
    style: Normal
    stretch: Normal
    weight: 400
    glyphs: /usr/share/fonts/type1/gsfonts/n021003l.pfb

Path: System Fonts
  Font: Century-Schoolbook-Bold
    family: Century Schoolbook
    style: Normal
    stretch: Normal
    weight: 700
    glyphs: /usr/share/fonts/type1/gsfonts/c059016l.pfb
  Font: Century-Schoolbook-Bold-Italic
    family: Century Schoolbook
    style: Italic
    stretch: Normal
    weight: 700
    glyphs: /usr/share/fonts/type1/gsfonts/c059036l.pfb
  Font: Century-Schoolbook-Italic
    family: Century Schoolbook
    style: Italic
    stretch: Normal
    weight: 400
    glyphs: /usr/share/fonts/type1/gsfonts/c059033l.pfb
  Font: Century-Schoolbook-Roman
    family: Century Schoolbook
    style: Normal
    stretch: Normal
    weight: 500
    glyphs: /usr/share/fonts/type1/gsfonts/c059013l.pfb
  Font: DejaVu-Sans-Bold
    family: DejaVu Sans
    style: Normal
    stretch: Normal
    weight: 700
    glyphs: /usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf
  Font: DejaVu-Sans-Book
    family: DejaVu Sans
    style: Normal
    stretch: Normal
    weight: 400
    glyphs: /usr/share/fonts/truetype/dejavu/DejaVuSans.ttf
  Font: DejaVu-Sans-Mono-Bold
    family: DejaVu Sans Mono
    style: Normal
    stretch: Normal
    weight: 700
    glyphs: /usr/share/fonts/truetype/dejavu/DejaVuSansMono-Bold.ttf
  Font: DejaVu-Sans-Mono-Book
    family: DejaVu Sans Mono
    style: Normal
    stretch: Normal
    weight: 400
    glyphs: /usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf
  Font: DejaVu-Serif-Bold
    family: DejaVu Serif
    style: Normal
    stretch: Normal
    weight: 700
    glyphs: /usr/share/fonts/truetype/dejavu/DejaVuSerif-Bold.ttf
  Font: DejaVu-Serif-Book
    family: DejaVu Serif
    style: Normal
    stretch: Normal
    weight: 400
    glyphs: /usr/share/fonts/truetype/dejavu/DejaVuSerif.ttf
  Font: Dingbats-Regular
    family: Dingbats
    style: Normal
    stretch: Normal
    weight: 400
    glyphs: /usr/share/fonts/type1/gsfonts/d050000l.pfb
  Font: Nimbus-Mono-Bold
    family: Nimbus Mono
    style: Normal
    stretch: Normal
    weight: 700
    glyphs: /usr/share/fonts/type1/gsfonts/n022004l.pfb
  Font: Nimbus-Mono-Bold-Oblique
    family: Nimbus Mono
    style: Oblique
    stretch: Normal
    weight: 700
    glyphs: /usr/share/fonts/type1/gsfonts/n022024l.pfb
  Font: Nimbus-Mono-Regular
    family: Nimbus Mono
    style: Normal
    stretch: Normal
    weight: 400
    glyphs: /usr/share/fonts/type1/gsfonts/n022003l.pfb
  Font: Nimbus-Mono-Regular-Oblique
    family: Nimbus Mono
    style: Oblique
    stretch: Normal
    weight: 400
    glyphs: /usr/share/fonts/type1/gsfonts/n022023l.pfb
  Font: Nimbus-Roman-No9-Medium
    family: Nimbus Roman No9
    style: Normal
    stretch: Normal
    weight: 700
    glyphs: /usr/share/fonts/type1/gsfonts/n021004l.pfb
  Font: Nimbus-Roman-No9-Medium-Italic
    family: Nimbus Roman No9
    style: Italic
    stretch: Normal
    weight: 700
    glyphs: /usr/share/fonts/type1/gsfonts/n021024l.pfb
  Font: Nimbus-Roman-No9-Regular
    family: Nimbus Roman No9
    style: Normal
    stretch: Normal
    weight: 400
    glyphs: /usr/share/fonts/type1/gsfonts/n021003l.pfb
  Font: Nimbus-Roman-No9-Regular-Italic
    family: Nimbus Roman No9
    style: Italic
    stretch: Normal
    weight: 400
    glyphs: /usr/share/fonts/type1/gsfonts/n021023l.pfb
  Font: Nimbus-Sans-Bold
    family: Nimbus Sans
    style: Normal
    stretch: Normal
    weight: 700
    glyphs: /usr/share/fonts/type1/gsfonts/n019004l.pfb
  Font: Nimbus-Sans-Bold-Condensed
    family: Nimbus Sans
    style: Normal
    stretch: Condensed
    weight: 700
    glyphs: /usr/share/fonts/type1/gsfonts/n019044l.pfb
  Font: Nimbus-Sans-Bold-Condensed-Italic
    family: Nimbus Sans
    style: Italic
    stretch: Condensed
    weight: 700
    glyphs: /usr/share/fonts/type1/gsfonts/n019064l.pfb
  Font: Nimbus-Sans-Bold-Italic
    family: Nimbus Sans
    style: Italic
    stretch: Normal
    weight: 700
    glyphs: /usr/share/fonts/type1/gsfonts/n019024l.pfb
  Font: Nimbus-Sans-Regular
    family: Nimbus Sans
    style: Normal
    stretch: Normal
    weight: 400
    glyphs: /usr/share/fonts/type1/gsfonts/n019003l.pfb
  Font: Nimbus-Sans-Regular-Condensed
    family: Nimbus Sans
    style: Normal
    stretch: Condensed
    weight: 400
    glyphs: /usr/share/fonts/type1/gsfonts/n019043l.pfb
  Font: Nimbus-Sans-Regular-Condensed-Italic
    family: Nimbus Sans
    style: Italic
    stretch: Condensed
    weight: 400
    glyphs: /usr/share/fonts/type1/gsfonts/n019063l.pfb
  Font: Nimbus-Sans-Regular-Italic
    family: Nimbus Sans
    style: Italic
    stretch: Normal
    weight: 400
    glyphs: /usr/share/fonts/type1/gsfonts/n019023l.pfb
  Font: Standard-Symbols-Regular
    family: Standard Symbols
    style: Normal
    stretch: Normal
    weight: 400
    glyphs: /usr/share/fonts/type1/gsfonts/s050000l.pfb
  Font: URW-Bookman-Demi-Bold
    family: URW Bookman
    style: Normal
    stretch: Normal
    weight: 700
    glyphs: /usr/share/fonts/type1/gsfonts/b018015l.pfb
  Font: URW-Bookman-Demi-Bold-Italic
    family: URW Bookman
    style: Italic
    stretch: Normal
    weight: 700
    glyphs: /usr/share/fonts/type1/gsfonts/b018035l.pfb
  Font: URW-Bookman-Light
    family: URW Bookman
    style: Normal
    stretch: Normal
    weight: 400
    glyphs: /usr/share/fonts/type1/gsfonts/b018012l.pfb
  Font: URW-Bookman-Light-Italic
    family: URW Bookman
    style: Italic
    stretch: Normal
    weight: 400
    glyphs: /usr/share/fonts/type1/gsfonts/b018032l.pfb
  Font: URW-Chancery-Medium-Italic
    family: URW Chancery
    style: Italic
    stretch: Normal
    weight: 500
    glyphs: /usr/share/fonts/type1/gsfonts/z003034l.pfb
  Font: URW-Gothic-Book
    family: URW Gothic
    style: Normal
    stretch: Normal
    weight: 300
    glyphs: /usr/share/fonts/type1/gsfonts/a010013l.pfb
  Font: URW-Gothic-Book-Oblique
    family: URW Gothic
    style: Oblique
    stretch: Normal
    weight: 300
    glyphs: /usr/share/fonts/type1/gsfonts/a010033l.pfb
  Font: URW-Gothic-Demi
    family: URW Gothic
    style: Normal
    stretch: Normal
    weight: 600
    glyphs: /usr/share/fonts/type1/gsfonts/a010015l.pfb
  Font: URW-Gothic-Demi-Oblique
    family: URW Gothic
    style: Oblique
    stretch: Normal
    weight: 600
    glyphs: /usr/share/fonts/type1/gsfonts/a010035l.pfb
  Font: URW-Palladio-Bold
    family: URW Palladio
    style: Normal
    stretch: Normal
    weight: 700
    glyphs: /usr/share/fonts/type1/gsfonts/p052004l.pfb
  Font: URW-Palladio-Bold-Italic
    family: URW Palladio
    style: Italic
    stretch: Normal
    weight: 700
    glyphs: /usr/share/fonts/type1/gsfonts/p052024l.pfb
  Font: URW-Palladio-Italic
    family: URW Palladio
    style: Italic
    stretch: Normal
    weight: 400
    glyphs: /usr/share/fonts/type1/gsfonts/p052023l.pfb
  Font: URW-Palladio-Roman
    family: URW Palladio
    style: Normal
    stretch: Normal
    weight: 500
    glyphs: /usr/share/fonts/type1/gsfonts/p052003l.pfb

Should be fairly simple to fix … reviewing the install script


(Jens Maier) #8

Hm, I thought I had tested this. You removed the apt-get remove imagemagick line from the script and instead no longer install imagemagick in the previous step, right? I think that’s the cause. The install step did pull in dependencies that are now missing, such as the actual font files.


(Sam Saffron) #9

yeah adding gsfonts , seems to do the trick, I don’t want to have dependencies that will just get autoremoved later.


(Jens Maier) #10

Yup, true. Weirdly enough, apt-get autoremove did not uninstall any packages when I ran it after uninstalling the old ImageMagick. :confused:

Oh, and you may want to pull in ghostscript instead of gsfonts.


(Sam Saffron) #11

hmm why would I want ghostscript? gsfonts seems to do the trick.

Trying to keep dependencies as explicit and tight as possible.


(Jens Maier) #12

Er. Yes, you’re right. Ignore me, it’s too late. I thought I had built it with support for postscript files.

Still, having ghostscript on hand might not be a bad idea, perhaps for a yet to be developed PDF preview plugin. :smile:


(Sam Saffron) #13

sure … I am fine to add it to the base image if we need it, but we got to be explicit about it.


(Sam Saffron) #14

Fixed in the latest image:

cd /var/docker
./launcher rebuild app

This also required a core change so you will have to be on tests-passed to get it:

https://github.com/discourse/discourse/commit/5d31290dbc75461ae945003e7fadae83d6c20bc9


(Sam Saffron) #15