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.
I thought that safe mode was going to solve these problems, but even with safe mode, 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?
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
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?
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.
With that in mind, the top 2 come to mind for me are
unable to load module
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.
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”.
I think this was mostly resolved by the Safe Mode that @sam added in 1.7? At least for the commonest case of “rando third party plugin broke my site” anyway.
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 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.