# Uploaded avatars and Gravatar not working with subfolder installation

**URL:** https://meta.discourse.org/t/uploaded-avatars-and-gravatar-not-working-with-subfolder-installation/38114
**Category:** Bug
**Created:** [1월 18, 2016, 2:18오후 UTC](https://meta.discourse.org/t/uploaded-avatars-and-gravatar-not-working-with-subfolder-installation/38114 "2016-01-18T14:18:07Z")
**Posts on this page:** 16
**Page:** 1

<div class="post-metadata">

### Author: ![Strikki\_Strik](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/strikki_strik/32/121984_2.png) [@Strikki\_Strik](https://meta.discourse.org/u/Strikki_Strik)
#### Post date: [1월 18, 2016, 2:18오후 UTC](https://meta.discourse.org/t/uploaded-avatars-and-gravatar-not-working-with-subfolder-installation/38114/1 "2016-01-18T14:18:07Z")

</div>

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).

 ![](https://global.discourse-cdn.com/meta/original/3X/b/7/b7400c1c575ed9788e31133723de8337cea56e6a.png)  
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

 ![](https://global.discourse-cdn.com/meta/original/3X/2/1/218ed2b315bda86b2b3073e536838967e1c3b29e.png)  
But than, after page reload, picture fall back to silhouette of gray fellow.

You can reproduce this behavior on [this site](http://nsr24.com/social/en/)

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [1월 18, 2016, 2:25오후 UTC](https://meta.discourse.org/t/uploaded-avatars-and-gravatar-not-working-with-subfolder-installation/38114/2 "2016-01-18T14:25:30Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Strikki\_Strik](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/strikki_strik/32/121984_2.png) [@Strikki\_Strik](https://meta.discourse.org/u/Strikki_Strik)
#### Post date: [1월 18, 2016, 2:38오후 UTC](https://meta.discourse.org/t/uploaded-avatars-and-gravatar-not-working-with-subfolder-installation/38114/3 "2016-01-18T14:38:10Z")

</div>

I check [the site](https://www.sitepoint.com/community/) 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](http://sitepoint.com)? Can you share insides of it?🙂

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [1월 18, 2016, 6:33오후 UTC](https://meta.discourse.org/t/uploaded-avatars-and-gravatar-not-working-with-subfolder-installation/38114/4 "2016-01-18T18:33:12Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Strikki\_Strik](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/strikki_strik/32/121984_2.png) [@Strikki\_Strik](https://meta.discourse.org/u/Strikki_Strik)
#### Post date: [1월 18, 2016, 6:53오후 UTC](https://meta.discourse.org/t/uploaded-avatars-and-gravatar-not-working-with-subfolder-installation/38114/5 "2016-01-18T18:53:40Z")

</div>

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”?

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [1월 18, 2016, 7:09오후 UTC](https://meta.discourse.org/t/uploaded-avatars-and-gravatar-not-working-with-subfolder-installation/38114/6 "2016-01-18T19:09:50Z")

</div>

We’re on 1.5.0.beta6, I think.

---

<div class="post-metadata">

### Author: ![Strikki\_Strik](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/strikki_strik/32/121984_2.png) [@Strikki\_Strik](https://meta.discourse.org/u/Strikki_Strik)
#### Post date: [1월 18, 2016, 9:39오후 UTC](https://meta.discourse.org/t/uploaded-avatars-and-gravatar-not-working-with-subfolder-installation/38114/7 "2016-01-18T21:39:45Z")

</div>

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.

 ![](https://global.discourse-cdn.com/meta/original/3X/d/c/dc10a7394ceff0c6fd763f0110315b86f8c737d3.png)

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

 ![](https://global.discourse-cdn.com/meta/original/3X/9/e/9ea21467ea34e80363d3620485ce3ea9885ab56a.png)

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.

 ![](https://global.discourse-cdn.com/meta/original/3X/a/c/ace6381884e80ab6e4948850f78f87927af207ce.png)

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [1월 18, 2016, 11:46오후 UTC](https://meta.discourse.org/t/uploaded-avatars-and-gravatar-not-working-with-subfolder-installation/38114/8 "2016-01-18T23:46:43Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Strikki\_Strik](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/strikki_strik/32/121984_2.png) [@Strikki\_Strik](https://meta.discourse.org/u/Strikki_Strik)
#### Post date: [1월 19, 2016, 8:24오전 UTC](https://meta.discourse.org/t/uploaded-avatars-and-gravatar-not-working-with-subfolder-installation/38114/9 "2016-01-19T08:24:30Z")

</div>

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](https://github.com/discourse/discourse/blob/master/docs/INSTALL-cloud.md) and apply subfolder setup from [this howto](https://meta.discourse.org/t/subfolder-support-with-docker/30507).

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…

---

<div class="post-metadata">

### Author: ![Strikki\_Strik](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/strikki_strik/32/121984_2.png) [@Strikki\_Strik](https://meta.discourse.org/u/Strikki_Strik)
#### Post date: [1월 19, 2016, 1:26오후 UTC](https://meta.discourse.org/t/uploaded-avatars-and-gravatar-not-working-with-subfolder-installation/38114/10 "2016-01-19T13:26:11Z")

</div>

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!

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [1월 19, 2016, 10:48오후 UTC](https://meta.discourse.org/t/uploaded-avatars-and-gravatar-not-working-with-subfolder-installation/38114/11 "2016-01-19T22:48:15Z")

</div>

How should we handle this @neil?

---

<div class="post-metadata">

### Author: ![neil](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neil/32/102150_2.png) [@neil](https://meta.discourse.org/u/neil)
#### Post date: [1월 19, 2016, 10:51오후 UTC](https://meta.discourse.org/t/uploaded-avatars-and-gravatar-not-working-with-subfolder-installation/38114/12 "2016-01-19T22:51:22Z")

</div>

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

---

<div class="post-metadata">

### Author: ![neil](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neil/32/102150_2.png) [@neil](https://meta.discourse.org/u/neil)
#### Post date: [1월 20, 2016, 9:07오후 UTC](https://meta.discourse.org/t/uploaded-avatars-and-gravatar-not-working-with-subfolder-installation/38114/13 "2016-01-20T21:07:23Z")

</div>

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.

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

```

Maybe you forgot to do that too @Strikki_Strik?

---

<div class="post-metadata">

### Author: ![Strikki\_Strik](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/strikki_strik/32/121984_2.png) [@Strikki\_Strik](https://meta.discourse.org/u/Strikki_Strik)
#### Post date: [1월 20, 2016, 10:36오후 UTC](https://meta.discourse.org/t/uploaded-avatars-and-gravatar-not-working-with-subfolder-installation/38114/14 "2016-01-20T22:36:02Z")

</div>

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!

---

<div class="post-metadata">

### Author: ![Strikki\_Strik](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/strikki_strik/32/121984_2.png) [@Strikki\_Strik](https://meta.discourse.org/u/Strikki_Strik)
#### Post date: [1월 21, 2016, 12:19오전 UTC](https://meta.discourse.org/t/uploaded-avatars-and-gravatar-not-working-with-subfolder-installation/38114/15 "2016-01-21T00:19:33Z")

</div>

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` ☹

Thank you very much to point this out!👍

I think this thread may be closed

---

<div class="post-metadata">

### Author: ![neil](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neil/32/102150_2.png) [@neil](https://meta.discourse.org/u/neil)
#### Post date: [1월 21, 2016, 1:39오전 UTC](https://meta.discourse.org/t/uploaded-avatars-and-gravatar-not-working-with-subfolder-installation/38114/16 "2016-01-21T01:39:04Z")

</div>


