# Admin not accessible because of auto-minify for Cloudflare

**URL:** https://meta.discourse.org/t/admin-not-accessible-because-of-auto-minify-for-cloudflare/315594
**Category:** Self-hosting
**Created:** [July 9, 2024, 2:24pm UTC](https://meta.discourse.org/t/admin-not-accessible-because-of-auto-minify-for-cloudflare/315594 "2024-07-09T14:24:53Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Harshit\_Dave](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/harshit_dave/32/379059_2.png) [@Harshit\_Dave](https://meta.discourse.org/u/Harshit_Dave)
#### Post date: [July 9, 2024, 2:24pm UTC](https://meta.discourse.org/t/admin-not-accessible-because-of-auto-minify-for-cloudflare/315594/1 "2024-07-09T14:24:53Z")

</div>

Hello,

I was trying to create a plugin in discourse by following this page: [Developing Discourse Plugins - Part 1 - Create a basic plugin](https://meta.discourse.org/t/developing-discourse-plugins-part-1-create-a-basic-plugin/30515) and I have uploaded plugins folder on server. After that, I was not able to access admin page on discourse.

When I checked in console of the browser I am seeing below error:  
**Error: There is no route named admin**

I checked in ssh for my user’s role it has admin privileges. I tried deleting plugins folders as well from discourse but I am facing same issue.

Can anyone help me into this issue?

Thanks in advance!

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [July 9, 2024, 2:53pm UTC](https://meta.discourse.org/t/admin-not-accessible-because-of-auto-minify-for-cloudflare/315594/2 "2024-07-09T14:53:15Z")

</div>

Are you trying to be admin on your development environment or on a production environment?

If it’s production, then you can

```plaintext
cd /var/discourse
./launcher enter app
rake admin:create

```

For development, you should be able to do a `./bin/rake admin:create` from the discourse directory.

Having admin/root privileges on your server OS and in Discourse are two entirely different things.

---

<div class="post-metadata">

### Author: ![Harshit\_Dave](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/harshit_dave/32/379059_2.png) [@Harshit\_Dave](https://meta.discourse.org/u/Harshit_Dave)
#### Post date: [July 9, 2024, 2:58pm UTC](https://meta.discourse.org/t/admin-not-accessible-because-of-auto-minify-for-cloudflare/315594/3 "2024-07-09T14:58:31Z")

</div>

I tried to change the access using this command ./launcher enter app but it didn’t work for me.  
oh, I meant I have admin access in Discourse.

---

<div class="post-metadata">

### Author: ![Lhc\_fl](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lhc_fl/32/268115_2.png) [@Lhc\_fl](https://meta.discourse.org/u/Lhc_fl)
#### Post date: [July 10, 2024, 10:16am UTC](https://meta.discourse.org/t/admin-not-accessible-because-of-auto-minify-for-cloudflare/315594/4 "2024-07-10T10:16:52Z")

</div>

Do you mean you uploaded a plugin directly on your server?

Discourse must compile the plugin’s JavaScript assests firstly. You should upload the plugin to a GitHub repository, edit app.yml to add it, then `./launcher rebuild app`

Directly uploading the plugin to the plugins folder without compiling will cause the Discourse frontend to not find the compiled file and cause errors.

Also, if you have cloudflare enabled for your server, remember to turn off auto-minify and delete the cache.

> [@Discourse broken after moving servers](https://meta.discourse.org/t/discourse-broken-after-moving-servers/307476/13):
>
> Please also make sure that Cloudflare’s “auto minify” feature is disabled, and that you have purged the cache. They’ve deprecated the feature because it does not work for modern JS features (which Discourse is now using)

---

<div class="post-metadata">

### Author: ![Harshit\_Dave](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/harshit_dave/32/379059_2.png) [@Harshit\_Dave](https://meta.discourse.org/u/Harshit_Dave)
#### Post date: [July 10, 2024, 1:43pm UTC](https://meta.discourse.org/t/admin-not-accessible-because-of-auto-minify-for-cloudflare/315594/5 "2024-07-10T13:43:18Z")

</div>

Hi @Lhc_fl

Thank you so much for the help. It worked for me by turning off the auto-minify for Cloudflare.

As I am new to discourse, Hence, I don’t know much how to work with plugin. So, I was trying to add plugin in plugins folder but I tried what you suggested that worked for me by uploading plugin on GitHub and fetch it from GitHub Repository.

May I ask you one more thing, Can you please guide me how can I add custom fields or any additional fields to topic? Actually, I want to create a plugin which enhance topic functionality. I want to add custom fields for topic and store it’s data in database and render it in the topics details page.

Thanks once again!

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [July 10, 2024, 2:34pm UTC](https://meta.discourse.org/t/admin-not-accessible-because-of-auto-minify-for-cloudflare/315594/6 "2024-07-10T14:34:12Z")

</div>

> [@Harshit\_Dave](#):
>
> Can you please guide me how can I add custom fields or any additional fields to topic?

You should start a new topic for that and the question itself is too broad for a real answer, but you should have a look at [Developing Discourse Plugins - Part 1 - Create a basic plugin](https://meta.discourse.org/t/developing-discourse-plugins-part-1-create-a-basic-plugin/30515) and the rest. You’ll want to search for stuff about creating topic\_custom\_fields and adding them to the serializer. See [GitHub - discourse/all-the-plugins · GitHub](https://github.com/discourse/all-the-plugins) to get all of the plugins and then you can search those for examples.

You might say more about what you’re doing that requires the custom fields, as there could be some other way to accomplish that task without custom fields and without a plugin.

---

<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: [August 9, 2024, 2:34pm UTC](https://meta.discourse.org/t/admin-not-accessible-because-of-auto-minify-for-cloudflare/315594/7 "2024-08-09T14:34:29Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
