Uploaded avatars and Gravatar not working with subfolder installation

Greetings

I have a subfolder latest Discourse installation (use official how-to).

I have a Gravatar account and Discourse used to load my picture with subdomain (default) installation.
But when I made a clean new subfolder installation, Discourse no longer loads my Gravatar picture (I keep using same email).


No matter how many times I keep pressing on update button next to Gravatar.
You can check that on my email there is a Gravatar picture actually.

When I try to upload an avatar picture the following happens:
Firstly, picture uploaded, and displayed

But than, after page reload, picture fall back to silhouette of gray fellow.

You can reproduce this behavior on this site

3 Likes

We’ve seen this recently at Sitepoint too, I didn’t have time to dig into it the other day, so we reverted the user’s avatar to the system one. We’re also a sub-folder install, so there may be something going on with gravatar and sub-folder installs.

1 Like

I check the site you mention, create a new user, and from what I see both Gravatar and Uploaded pictures wokred fine.
I wander, may be it’s because of my proxy nginx (in my case Discourse resides on a distant machine and requests to it proxied via nginx)?
Do you know how Discourse installation was done on sitepoint.com? Can you share insides of it?:slight_smile:

It is hosted by the Discourse team and uses Fastly to handle sub-folder support. I simply know we’ve had several Gravatars come over as a 1x1 pixel as of late, so I wasn’t sure if it was related.

Seems your problem is a different issue.
Do you know what version of Discourse is using on Sitepoint (if it’s not the secret)?
I encounter my issue at version 1.5.0.beta8 (current latest). May be it worth to try 1.4.x without “.beta”?

We’re on 1.5.0.beta6, I think.

I’ve installed version 1.5.0.beta6 on my local computer, and reproduce 1x1 pixel blank white avatars.

But my issue remains in beta6, when I ulpoad an image, URL to it changes from /social/en/user_avatar/nsr24.com/halfstrik/120/18_1.png to /social/en/uploads/default/original/1X/400760f62da08b00a8f359f41ff6f0d5d391faad.jpeg until I do not refresh the page.

After refresh image URL reverts to /social/en/user_avatar/nsr24.com/halfstrik/120/18_1.png witch happen to be blank 1x1 pixel.

Interesting thing is if I try to load my uploaded avatar, it’s working, so the real problem is with the link, not with the image file.

You’ll need to be on latest before this can be considered a bug. Does it repro on latest?

1 Like

Yes, I use latest version of Discourse (v1.5.0.beta8) and the issue occurs on it.

Just now I reproduced this issue on clean Discourse install following this guide and apply subfolder setup from this howto.

And Gravatar started to work and survive page reloads.
Does config for run: section actually correct, is it require 4 spaces before - exec?
But image uploads still failed to work…

Seems I finally find the root of the problem:

Subfolder setup assums only one subfolder, so installations like /forum or /community works and my variant /social/en - dose not works for avatars or Gravatar.

Now I change subfolder to be /social-en and Uploaded avatars and Gravatar now work!

I think the case with nested subfolders (like /forum/es and /forum/en) need to be documented (so folks will use /forum-en instead) or, better, fixed.

Thanks for the help!

5 Likes

How should we handle this @neil?

I suspect that those are bugs in our subfolder support. They can probably be fixed… I’ll have a look.

1 Like

I just tested it and custom uploads and gravatar avatars are working on /forum/en for me. But they weren’t at first because I forgot to setup the proper sub-subfolder in public.

cd /var/www/discourse/public
mkdir -p forum/en
cd forum/en
ln -s ../../uploads

Maybe you forgot to do that too @Strikki_Strik?

3 Likes

I see, in my containers/app.yaml in - run section instead of this

`- mkdir -p public/forum/en

  • cd public/forum/en && ln -s …/uploads && ln -s …/backups`

I should do that:

`- mkdir -p public/forum/en

  • cd public/forum/en && ln -s …/…/uploads && ln -s …/…/backups`

Wait, I’ll check it, but it seems to do the trick!

2 Likes

Yep, it’s working like a charm!

That’s why I’m not a big fan of relative paths like ../../ … They easy for me to mess up… and hard to count ../'s.
But I failed to invent anything simpler with ln :frowning:

Thank you very much to point this out!:+1:

I think this thread may be closed

2 Likes