How to use Discourse Safe Mode


(Sam Saffron) #1

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.


Admin Plugin page is blank - Error: There is no route named adminPlugins.index
DEPRECATION: Support for the `ember-legacy-views` addon will end soon
Lightbox not showing up on uploaded images after update
How to change default Discourse theme via CLI?
I'm getting an error 4 error 2 warning
Site fails to load with js errors
Mobile Header expanding after tapping hamburger menu
Image displayed incorrectly on Mobile due to theme settings
Compatibility with IE11?
Preview of post not loading because force https was not set
Category unlike any other category
Custom JS in head makes messages not work
Retort plugin is breaking my Discourse
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)
Unable to upgrade Discourse or plugins, can't view error log
Topics list scrolling buggy after upgrade
How to disable a plugin when admin plugin page is not loading
New topic and reply not working
Why is Discourse sometimes not loading?
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
Installed bad plugin and now stuck with white screen
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
Error in CSS - theme_variables.scss
Blank topics after import?
Intermittent New Topic/ Reply button problem? Clues on what's happening?
Problems clicking topic links in IE11
Login failure after upgrade
FATAL: upgrade brought down the forum
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)
Blank pages every now and then
Setting up a private category
How to increase site speed
Avatar settings not visible
Discourse Preview Not Working
Compose window data entry section is shrunk to about 10 pixel height
Discourse Preview Not Working
Discourse Preview Not Working
Anonymous profile viewing fails
Custom hamburger menu links
Is discourse presence plugin compatible with ember 2.4?
No content displayed on front category page after upgrade
Occasional page loads with no post content due to plugins
After Upgrade - The login Form is not opening the Provider's dialog
LDAP Setup for Discourse
Approving user gets a 403 forbidden error
Users header on topic list is displayed as [object Object]
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?
You were logged out when creating a topic
Unable to expand profile
(Rafael dos Santos Silva) #2

What about:

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

Because disable all is inside disable unofficial.


(Jay Pfaffman) #3

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


(Rafael dos Santos Silva) #4

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


(Jay Pfaffman) #5

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?


(Sam Saffron) #6

: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


(Jay Pfaffman) #7

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.


(Andy at Focallocal) #9

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


(Rafael dos Santos Silva) #11

Discuss Action works for me.


(Andy at Focallocal) #12

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


(Andy at Focallocal) #13

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?


(Andy at Focallocal) #14

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


(Rafael dos Santos Silva) #15

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.


(Andy at Focallocal) #16

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


(Mittineague) #17

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?


#18

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.


#19

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.


#20

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 :


(Daniela) #21

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