# Better error pages?

**URL:** https://meta.discourse.org/t/better-error-pages/55973
**Category:** Feature
**Created:** [January 18, 2017, 4:23pm UTC](https://meta.discourse.org/t/better-error-pages/55973 "2017-01-18T16:23:06Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [January 18, 2017, 4:23pm UTC](https://meta.discourse.org/t/better-error-pages/55973/1 "2017-01-18T16:23:06Z")

</div>

I think it’s time for some more [complaint driven development](https://blog.codinghorror.com/complaint-driven-development/)!

**Complaint:** A disproportionate amount of posts here on meta are people whose discourse installs are broken.

**Tired old Solution** : We generally ask them to disable plugins and do a container rebuild. This tends to solve the problem 90%+ of the time.

* * *

Can we do better? I think so!

**Proposal** : Better error pages! We can detect if the user is an admin, and if so offer them the same suggestions we do here on meta. Try disabling your plugins. Try rebuilding your container. This seems like a no brainer for me if there are certain kinds of javascript errors (for example, can’t find module).

I would take it even further and put the advice on _all_ error pages we display, but if you’re not an admin user, hide it behind a “Are you the administrator of this Discourse? Troubleshooting Tips” link.

Thoughts?

---

<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: [January 18, 2017, 4:45pm UTC](https://meta.discourse.org/t/better-error-pages/55973/2 "2017-01-18T16:45:30Z")

</div>

I thought that [safe mode](https://meta.discourse.org/t/53504?silent=true) was going to solve these problems, but even with [safe mode](https://meta.discourse.org/t/53504?silent=true), it’s still possible for a plugin to muck up the works. How about I make a `./disable_plugins` or `./debug` script that would disable plugins and maybe even create a sanitized `app.yml` and/or log file?

---

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [January 18, 2017, 5:08pm UTC](https://meta.discourse.org/t/better-error-pages/55973/3 "2017-01-18T17:08:03Z")

</div>

> [@pfaffman](#):
>
> I thought that [safe mode](https://meta.discourse.org/t/53504?silent=true) was going to solve these problems

The issue is people don’t even know how to enable [safe mode](https://meta.discourse.org/t/53504?silent=true), or where to start debugging. They need a starting point of advice when they get an error.

---

<div class="post-metadata">

### Author: ![JagWaugh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagwaugh/32/69335_2.png) [@JagWaugh](https://meta.discourse.org/u/JagWaugh)
#### Post date: [January 18, 2017, 5:47pm UTC](https://meta.discourse.org/t/better-error-pages/55973/4 "2017-01-18T17:47:16Z")

</div>

I’ve been thinking about this the last few days as I have been running a test vm and restoring a backup from our live forum. My test vm is a bit weak knee’d, so I’m never quite sure if the reason that I can’t load the webpage is that there is a fault, or if the vm is doing stuff in the background and the web pages aren’t up yet.

./launcher logs app is useful, if you know what to grep for, but it would benefit from something like

./launcher status app showing information like

mail: (disabled, down, up, starting)  
database: (up, down, starting, errors)  
webpages: (up, down, starting, errors)  
nginx: (up, down, starting, errors)

so that one could check from a terminal if things are ok or not.

Even if all the “status app” spit out was “I’m broken” or “I’m busy starting” it would be a 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: [January 18, 2017, 11:30pm UTC](https://meta.discourse.org/t/better-error-pages/55973/5 "2017-01-18T23:30:53Z")

</div>

How would this work? They are generally getting a white page due to JS errors caused by plugins, either server side or client side. How can we generate a page in those cases?

---

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [January 18, 2017, 11:59pm UTC](https://meta.discourse.org/t/better-error-pages/55973/6 "2017-01-18T23:59:01Z")

</div>

We can’t catch 100% of the errors but we can catch many of the most common ones. For example, one of the most common ones is trying to require a module that is no longer there. We can catch that error and show the page if it happens.

Part of it would be to figure out the top 5 most common exceptions thrown by broken plugins and catch those with the error page.

---

<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: [January 19, 2017, 12:06am UTC](https://meta.discourse.org/t/better-error-pages/55973/7 "2017-01-19T00:06:10Z")

</div>

With that in mind, the top 2 come to mind for me are

1. unable to load module
2. any error with the word `deprecated` in it, as the method trying to be called doesn’t exist anymore.

Those are probably the two that have impacted me the most in the plugins I manage. I’ve tried searching a couple of the plugin topics to see what other errors have been reported, but really haven’t had much success with that approach yet.

---

<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: [January 19, 2017, 6:03pm UTC](https://meta.discourse.org/t/better-error-pages/55973/8 "2017-01-19T18:03:02Z")

</div>

3 posts were split to a new topic: [Is there a block diagram that documents how Discourse works](https://meta.discourse.org/t/is-there-a-block-diagram-that-documents-how-discourse-works/56037)

---

<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: [January 19, 2017, 6:05pm UTC](https://meta.discourse.org/t/better-error-pages/55973/9 "2017-01-19T18:05:06Z")

</div>

I wonder what mileage we can get from a global javascript js error handler.

Another fancy option may be to set a timeout upfront that gets cleared after render, if nothing is rendered after N seconds display the “help me!!! my Discourse is all mucked up page”.

---

<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: [May 2, 2017, 7:55am UTC](https://meta.discourse.org/t/better-error-pages/55973/10 "2017-05-02T07:55:10Z")

</div>

I think this was mostly resolved by the [Safe Mode](https://meta.discourse.org/t/53504?silent=true) that @sam added in 1.7? At least for the commonest case of “rando third party plugin broke my site” anyway.

---

<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: [February 14, 2022, 1:12am UTC](https://meta.discourse.org/t/better-error-pages/55973/11 "2022-02-14T01:12:30Z")

</div>

We have made a lot of improvements over the years, @david introduced a theme error panel which is soon to be expanded to support a deprecation error panel.

We have [safe mode](https://meta.discourse.org/t/53504?silent=true) as well which handles a very large amount of issues.

I would not say the issue in the OP is completely behind us, but we have made huge amounts of progress over the years.
