How to use Discourse Safe Mode

Discourse has a “JavaScript Safe Mode” any user can use to isolate the root cause of a JavaScript issue.

To access safe mode go to:

http://your-site-name/safe-mode for example this is the safe mode for meta:

https://meta.discourse.org/safe-mode

To exit safe mode simply close your browser tab

When entering safe mode you can select between:

  • Disable all site customizations

  • Disable unofficial plugins

  • Disable official plugins

By default all 3 options are selected, but you can enter safe mode multiple times to isolate the culprit breaking your site.

Safe mode currently only disable the JavaScript portions of plugins, to disable the server side portion you must rebuild your container with the plugin commented out. Historically the majority of breakages were in the JavaScript portions of plugins.

39 Likes
Admin Plugin page is blank - Error: There is no route named adminPlugins.index
"About" pages crashing our Discourse
Topic-footer buttons are disappearing
In-post links to topics - no longer update to the initial posts title
Beginner's guide to using Discourse themes
I don't see the staff wrench on posts
Browser Back Button issue
Issue with menu, admin
I as admin cannot click some buttons
How to disable a component without access to site?
Disable a component via cli?
Preview of post not loading because force https was not set
Image displayed incorrectly on Mobile due to theme settings
Stable broken due to discourse-spoiler-alert
Missing Settings field input due to third party plugin or theme
Third party plugin causing blank page
Category autocomplete stopped working on our site?
Topic mismatch troubleshooting
Coloured categories not showing in latest view
Employees cannot like some posts
Notifications are acting strange
Vimeo onebox not working
Disable plugin without downtime?
Strange issue where Reply botton won't work
Akismet block user's port
Admin Trouble Creating a Category
UI not loading after git pull update
Website looks different on different browsers
Quoting is not working anymore
Double Login with v2.2.0.beta6 +35
A "safe mode" to easily disable all third party plugins
Disable plugins without restarting?
Server Error while trying to load /admin/dashboard/general.json
New post notification showing over the most recent activity
Bulk edit icon not showing?
After latest admin/upgrade my Admin dashboard won't load
Can't See Posts When Logged Out
[2.1.0b6] New topic button is moving behind burger on click
Blank pages, 500 errors and no logs
Infinite scroll not working in "Latest" on Mobile
Disappearing posts in 2.1.0.beta2
Uncaught Errors
Beginner's guide to using Discourse themes
Not seeing close button in popups
Custom hamburger menu links
LDAP Setup for Discourse
Approving user gets a 403 forbidden error
After the latest upgrade applied search results showing right aligned
The "All in" category is not working
Bad JS customizations - how to fix in the backend?
Unable to expand profile
Lightbox not showing up on uploaded images after update
How to change default Discourse theme via CLI?
Site fails to load with js errors
Mobile Header expanding after tapping hamburger menu
Compatibility with IE11?
Category unlike any other category
Upgraded last night and login button no longer works
Using Cloudflare for HTTPS, empty preview pane in edit page
Topic Preview Broken due to Google PageSpeed Module
Category selector shows up as blank
Emoticon button not working anymore (because of babble plugin)
How to disable a plugin when admin plugin page is not loading
New topic and reply not working
Front page of discourse missing content
Messaging drop down menu not working
The composer needs to be more friendly to iPad Mini
Manually Clear DistributedCache
Browser too old message when "compatibility mode" is forced in IE 11
Admin Plugin page is blank - Error: There is no route named adminPlugins.index
My site just broke after restarting server
After Recent Upgrade to 1.08? beta - No forum shows
Blank topics after import?
Problems clicking topic links in IE11
A "safe mode" to easily disable all third party plugins
:( Error while trying to load Something went wrong
Cannot create new topics (already disabled plugins)
Setting up a private category
Send Invites button should not be visible if local logins are disabled
Avatar settings not visible with SSO
Compose window data entry section is shrunk to about 10 pixel height
Anonymous profile viewing fails
After Upgrade - The login Form is not opening the Provider's dialog
No content displayed on front category page after upgrade
Occasional page loads with no post content due to plugins
How to increase site speed
Google, Twitter and Facebook Logins not working due to ad blocker
OpenID Connect Authentication Plugin
Limit on Number of Child Categories?
My install was broken because I upgraded but did not upgrade plugins
Discourse 2.3.0.beta10 Release Notes
"selected posts" action box not always visible
Running old version of component on newer Discourse causes site to fail
Contains_dtoc in Grey Amber theme header
Post content not showing up

What about:

  • Disable all site customizations
  • Disable official plugins
  • Disable unofficial plugins

Because disable all is inside disable unofficial.

1 Like

This is awesome. Can you add a note about which version this feature became available?

1 Like

I think today 1.7 beta 8 is our first release with this feature.

2 Likes

Sounds believable, but if a member of team only “thinks” that 1.7 beta 8 is when it got added, how is a mere mortal, who might be on stable, to know whether they have this feature?

:ok_woman: they could just visit the link, if it returns a 404, well … hmmm … you don’t have the feature :slight_smile: .

Officially it is a 1.7 feature, available from beta 8 and onwards

4 Likes

Self-evident for people like me and you. :slight_smile:

I’m trying to make the point that now many people are on stable or, perhaps need reason to upgrade to the most recent version (I think that someone whom I just helped hadn’t upgraded anything since his install well over a year ago), can’t know when a #howto doesn’t apply to the version that they are running.

2 Likes

“that page doesnt exist” - most recent version installed. any ideas?

http://discuss.focallocal.org/safe-mode works for me.

3 Likes

my mistake sorry. i am running the latest version, just missed the “-” in my rush

my site works with in safe mode with all the plugins off. my question is shouldn’t it be a requirement for all plugins to be able to turn them on and off in admin?

adding to that, an option to uninstall plugins from admin would make safe mode far more useful

If you use the search you will found why discussed elsewhere.

You can turn a plugin off, but if the plugin code emits an error, because it try to load a file that doesn’t exist anymore, like bable in your case, turning it off isn’t enough.

yes. i don’t like using terminal, but i’ll have to remove it there.

safe mode would be significantly more powerful if admins could delete plugins from the backend, and plugins were required to allow admins to turn them off

AFAIK, many if not most plugins have a form of “awesome_plugin_enabled” setting that can be used in control logic to some extent. I do not have as much understanding as I would like to have to know what the limitations are.

My understanding of “safe mode” (which is poor) is that it stops the plugin from being compiled as an asset. but that it does not stop it from being “readied”.

Maybe some kind of “file explorer” interface for the plugins directory would be a good approach?

Hi,

Is there a way to disable JS customizations with the console ?
I have a JS problem, I can’t sign in to my board so I can’t access to the safe mode page.

Try this URL: discourse.yourforum.com/?safe_mode=no_custom%2Cno_plugins%2Conly_official

It should skip the initial safe mode page and should load your site in safe mode directly.

7 Likes

Thanks Osama, but like I said, I have to sign in to my board in order to make modifications (login required). So I had to disable this option :

xxx@sx-19270:/var/discourse# ./launcher enter bbbbbbb
xxx@sx-19270-bbbbbbb:/var/www/discourse# bundle exec rails c
irb(main):001:0> SiteSetting.login_required = false
=> false

in order to access to the safe mode page.

You can find site settings her :

1 Like

If it happens again you can try the security link for administrators /users/admin-login to login from your email

5 Likes