A user pfaffman reports a bug where user avatars fail to generate after moving a Discourse site from a subdirectory (/community) to a subdomain (community.example.com) via backup/restore. The issue stems from uploads having the extension ‘unknown’, preventing thumbnail generation. pfaffman suggests the system should infer the extension from the filename instead of returning false. Attempts to fix via rake avatars:refresh, manual refresh_avatar, or Sidekiq jobs initially fail. A workaround involves manually updating the extension from the filename and then enqueuing create_avatar_thumbnails jobs for affected uploads. IAmGav notes a potential trigger in Sidekiq and references a relevant job spec. pfaffman confirms the fix works after patching extensions and regenerating thumbnails. codinghorror questions whether this is a general restore artifact or specific to this case, noting it hasn’t been widely observed. The issue remains unresolved and under-reported despite being flagged as a bug and receiving a from Jeff.
EDIT: I’m reclassifying this as a bug, so that someone who understands this better than I can take a look at it.
a bunch of uploads had “unknown” as the extension. This means that it’s impossible to generate thumbnails. I think this happened when moving a backup to a new site and then needed to regenerate the thumbnails.
I think what should happen when you try to generate thumbnails and the extension is ‘unknown’ is to replace the extension, something like
When I look at user.user_avatar.custom_upload.url and paste that URL into the browser, I get the desired avatar. It seems like I need to “rebake” the users.
user.user_avatar.custom_upload has the correct URL, but https://community.example.com/user_avatar/community.example.com/bad_user/25/321_2.png has the missing avatgar image. I need to find the way to rebuild those avatar thumbnails.
I moved a site from /community to community.example.com by doing a backup and restore
I guess we just haven’t run into this with any of our restores, because what you’re complaining about here are restore artifacts, yes? Perhaps specific to this backup and restore?