# Manually Clear DistributedCache

**URL:** https://meta.discourse.org/t/manually-clear-distributedcache/55074
**Category:** Support
**Created:** [January 2, 2017, 9:38pm UTC](https://meta.discourse.org/t/manually-clear-distributedcache/55074 "2017-01-02T21:38:11Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![will\_io](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/will_io/32/147541_2.png) [@will\_io](https://meta.discourse.org/u/will_io)
#### Post date: [January 2, 2017, 9:38pm UTC](https://meta.discourse.org/t/manually-clear-distributedcache/55074/1 "2017-01-02T21:38:11Z")

</div>

Here is my current problem:

I rebuilt my discourse install using “stable” in `app.yml` but I did not wish to upgrade to the latest stable. So I rebuilt again using the intended older version. The current problem is that the site customizations are rendering `require('discourse-common/lib/raw-handlebars').template()` in the production source code when there is no such file in my install. This leads me to believe that the DistributedCache needs to be cleared. However, that is only an assumption. I would need to do this through the rails console I believe.

Currently getting a white screen due to the _Uncaught Error: Could not find module discourse-common/lib/raw-handlebars_ error and I, of course, cannot log in through the interface to get to the admin interface.

Help and or suggestions? Thank you.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [January 2, 2017, 10:51pm UTC](https://meta.discourse.org/t/manually-clear-distributedcache/55074/2 "2017-01-02T22:51:53Z")

</div>

Have you tried [safe mode](https://meta.discourse.org/t/53504?silent=true)?

> [@Using Safe Mode to troubleshoot issues with themes and plugins](https://meta.discourse.org/t/how-to-use-discourse-safe-mode/53504):
>
> bookmark This guide explains how to use Discourse’s [Safe Mode](https://meta.discourse.org/t/53504?silent=true) to troubleshoot issues with themes and plugins. person_raising_hand Required user level: All users Discourse offers a “JavaScript [Safe Mode](https://meta.discourse.org/t/53504?silent=true)” that allows any user to isolate the root cause of JavaScript issues caused by plugins, themes, or theme components. This feature is particularly useful for troubleshooting problems on your Discourse site. Accessing [Safe Mode](https://meta.discourse.org/t/53504?silent=true) To access [Safe Mode](https://meta.discourse.org/t/53504?silent=true), follow these steps: Open a new browse…

---

<div class="post-metadata">

### Author: ![will\_io](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/will_io/32/147541_2.png) [@will\_io](https://meta.discourse.org/u/will_io)
#### Post date: [January 2, 2017, 10:58pm UTC](https://meta.discourse.org/t/manually-clear-distributedcache/55074/3 "2017-01-02T22:58:53Z")

</div>

My discourse install is older than 1.7 so I do not have this option.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [January 2, 2017, 11:00pm UTC](https://meta.discourse.org/t/manually-clear-distributedcache/55074/4 "2017-01-02T23:00:02Z")

</div>

So uninstall all plugins non-bundled plugins.

---

<div class="post-metadata">

### Author: ![will\_io](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/will_io/32/147541_2.png) [@will\_io](https://meta.discourse.org/u/will_io)
#### Post date: [January 2, 2017, 11:05pm UTC](https://meta.discourse.org/t/manually-clear-distributedcache/55074/5 "2017-01-02T23:05:33Z")

</div>

It’s not a plugin though. I believe the javascript error is coming from the cache set in `app/models/site_customization.rb`.

Have a look at the latest version and compare it to older versions. You’ll see the site customization headers are prepended with “raw-handlebars” which is what I am describing. My current install does not have this so the fact that it is rendering the assumption is that my distributed cache for “site\_customization” needs to be cleared.

[https://github.com/discourse/discourse/blob/master/app/models/site\_customization.rb](https://github.com/discourse/discourse/blob/master/app/models/site_customization.rb)

---

<div class="post-metadata">

### Author: ![will\_io](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/will_io/32/147541_2.png) [@will\_io](https://meta.discourse.org/u/will_io)
#### Post date: [January 3, 2017, 1:08am UTC](https://meta.discourse.org/t/manually-clear-distributedcache/55074/6 "2017-01-03T01:08:08Z")

</div>

For future stumbling discourse installations experiencing this obscure problem:

1. `ssh into discourse server`
2. `cd var/discourse`
3. `./launcher enter app`
4. `redis-cli flushall`
5. `exit`
6. `./launcher rebuild app`

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [April 15, 2019, 7:47pm UTC](https://meta.discourse.org/t/manually-clear-distributedcache/55074/7 "2019-04-15T19:47:33Z")

</div>



---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [April 15, 2019, 10:33pm UTC](https://meta.discourse.org/t/manually-clear-distributedcache/55074/8 "2019-04-15T22:33:04Z")

</div>

Note, distributed cache is now versioned and tied to the actual git hash of the currently deployed discourse.

I can not think of any reason you would need to manually clear it.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [April 15, 2019, 10:33pm UTC](https://meta.discourse.org/t/manually-clear-distributedcache/55074/9 "2019-04-15T22:33:07Z")

</div>


