Uploaded avatar or gravatar not working

AI-generated summary

A user named Benuuts reported that uploaded avatars and Gravatars were not displaying, reverting to default avatars despite successful uploads to the shared folder. They confirmed running the latest Discourse version and restarting/rebuilding the container multiple times Benuuts. zogstrip asked for more details, including plugins and logs. Benuuts shared their setup: forum under /forum/foo, remapped upload folder (working for other images), and plugins discourse-edx-lti and discourse-solved. They included a log screenshot showing image-related errors and noted an identical working setup elsewhere. codinghorror warned that subfolder setups are not recommended. Benuuts acknowledged the risk but noted constraints. Eventually, Benuuts resolved the issue: the forum was in a subsubfolder (/forums/foo), and the Docker setup guide they followed missed symbolic links for the subpath. They fixed it by adding:

- mkdir -p public/forum/foo
- cd public/forum/foo && ln -s ../../uploads && ln -s ../../backups

codinghorror replied with a lighthearted note: “There is always a choice ;)” and linked a video. The root cause was a missing symlink in a non-standard subfolder configuration.

Hello,

I seem to have the exact same symptoms as How to fix user avatar? but I’m running the latest version of discourse (I tried to upgrade to fix this).

Upload works fine (file are being uploaded to the shared folder) but when the users save his profile, it goes back to the default avatar. It’s the same for gravatar.

Any idea how to solve this ? Thanks

Did you restart / rebuild your container?

Yes I did several times (and upgrade to a newer version)

Then we need more information. Do you have any non-official plugins installed? Are there any errors in logs that might be related?

Here’s my setup :

  • forum run under /forum/foo
  • upload folder is remaped (and it works fine for other images : logos, post, favicon)
  • plugins : discourse-edx-lti, discourse-solved

This is the only log related to images that I have

I have an alternate setup with an equivalent config where everything works fine…

Subfolder is not a recommended config.

Yes I aware of that but it works pretty good and sometimes you don’t have a choice…

Thanks anyway

Ok I solved it.
It was due to the forum being in a subsubfolder ie /forums/foo, I followed this guide to set up the forum but it was missing a symbolic link to reflect this subpath.

So I added :

# ...
- mkdir -p public/forum/foo
- cd public/forum/foo && ln -s ../../uploads && ln -s ../../backups

There is always a choice :wink: