テーマとプラグインの問題をトラブルシューティングするためのセーフモードの使用

:bookmark: このガイドでは、Discourse のセーフモードを使用して、テーマやプラグインに関する問題をトラブルシューティングする方法を説明します。

:person_raising_hand: 必要なユーザーレベル:すべてのユーザー

Discourse では、「JavaScript セーフモード」を提供しており、これにより任意のユーザーが、プラグイン、テーマ、またはテーマコンポーネントによって引き起こされる JavaScript 問題の根本原因を特定できます。この機能は、Discourse サイトの問題をトラブルシューティングする際に特に役立ちます。

セーフモードへのアクセス

セーフモードにアクセスするには、以下の手順に従ってください。

  1. 新しいブラウザタブを開きます。

  2. 以下の URL をアドレスバーに入力し、[your-site-name](http://discourse.example.com) を実際の Discourse サイトのドメインに置き換えます。

    http://discourse.example.com/safe-mode
    

    例えば、Discourse デモサイトのセーフモード URL は以下の通りです。
    https://try.discourse.org/safe-mode

  3. 「Enter Safe Mode」ボタンをクリックします。

セーフモードのオプション

セーフモードに入る際、以下のオプションから選択できます。

  • テーマとテーマコンポーネントを無効化する
  • 非公式のクライアントサイドプラグインのカスタマイズを無効化する
  • すべてのクライアントサイドプラグインのカスタマイズを無効化する
  • JavaScript の非推奨事項をエラーとして発生させる

デフォルトでは、最初の 3 つのオプションが選択されています。「非推奨エラー」オプションはデフォルトでチェックされておらず、主に今後の Discourse アップデートとの互換性をテストするプラグインおよびテーマ開発者に役立ちます。サイト上の問題を引き起こしている特定のコンポーネントを特定するために、異なる組み合わせでセーフモードを複数回実行できます。

セーフモードの使用

  1. セーフモードページで希望のオプションを選択します。
  2. 「Enter Safe Mode」をクリックして選択を適用します。
  3. セーフモードが有効になっていることを示すバナーが表示されます。
  4. サイトを閲覧し、選択したコンポーネントが無効化された状態で問題が継続するかどうかを確認します。

セーフモードからの退出

セーフモードから退出するには、ブラウザタブを閉じるだけです。

重要な注意点

サイトのセーフモードリンクを共有する際は、新しいタブで開くか、直接アドレスバーに追加する必要があることに注意してください。そうしないと正しく動作しない場合があります。

:warning: 現在、セーフモードはプラグインの JavaScript 部分のみを無効化します。プラグインのサーバーサイド部分を無効化するには、プラグインをコメントアウトしてコンテナを再構築する必要があります。

トラブルシューティング

初期のセーフモード選択ページが読み込めない場合は、以下の URL にアクセスしてみてください。これによりページをスキップしてセーフモードを直接読み込むことができます。

https://discourse.example.com/?safe_mode=no_themes,no_plugins

例:https://try.discourse.org/?safe_mode=no_themes,no_plugins

利用可能な safe_mode クエリパラメータの値は no_themesno_unofficial_pluginsno_pluginsdeprecation_errors です。これらはカンマで結合して使用できます。

「いいね!」 73
Admin Plugin page is blank - Error: There is no route named adminPlugins.index
502 and then empty forum after `./launcher rebuild app`
Upgraded last night and login button no longer works
Content of messages not showing up
"About" pages crashing our Discourse
Topic Preview Broken (due to Google PageSpeed Module)
Uncaught Errors
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
Website looks different on different browsers
How to disable a component without access to site?
Cannot create new topics (already disabled plugins)
How to increase site speed
Disable plugins without restarting?
A "safe mode" to easily disable all third party plugins
Beginner's guide to using Discourse Themes
Global notice doesn’t show
Incorrect initial order when user sorts topic list
Unable to expand profile
Disable plugin without downtime?
Mobile Header expanding after tapping hamburger menu
Discourse 2.3.0.beta10 Release Notes
Lightbox not showing up on uploaded images after update
Vimeo onebox not working
Pasting tables from spreadsheets no longer working after 2.3 upgrade
Contains_dtoc in Grey Amber theme header
Site fails to load with js errors
No content displayed on front category page after upgrade
Notifications are acting strange
Occasional page loads with no post content due to plugins
Discourse 2.5.0.beta2 Release Notes
LDAP Setup for Discourse
Unable to add/edit tags
Category unlike any other category
Unable to save wiki update
Infinite scroll not working in "Latest" on Mobile
Disappearing posts in 2.1.0.beta2
Post content not showing up
In-post links to topics - no longer update to the initial posts title
Issue with menu, admin
Excerpts truncating at 50 characters
How to change default Discourse theme via CLI?
Mentions reported wrongly as replies in notifications list
Bad JS customizations - how to fix in the backend?
Send Invites button should not be visible if local logins are disabled
Topic-footer buttons are disappearing
Blank pages, 500 errors and no logs
[2.1.0b6] New topic button is moving behind burger on click
Google, Twitter and Facebook Logins not working due to ad blocker
Can't See Posts When Logged Out
After latest admin/upgrade my Admin dashboard won't load
My install was broken because I upgraded but did not upgrade plugins
Bulk edit icon not showing?
Quoting is not working anymore
Some user see a blank page when opening a topic
Admin Trouble Creating a Category
Browser Back Button issue
Topic mismatch troubleshooting
Edit icon not activating after edits
I don't see the staff wrench on posts
Forum does not work for users on iOS
Category autocomplete stopped working on our site?
UI not loading after git pull update
Gui for querying category of solved or unsolved topics
Image displayed incorrectly on Mobile due to theme settings
Preview of post not loading because force https was not set
Reordering Categories Produces Error 422
Limit on Number of Child Categories?
Issue in user summary
Lightbox for images comes by default?
Having an issue with images' width getting cut off on desktop
Issue with the page title in Arabic?
Latest update broke my forum
Registration modal/popup not showing up for private instance
Iframes Not Working
Discourse unresponsive in Chrome
Topics tagged with `info` have strange appearance
Logins redirects to missing notifications page
Discourse broken after upgrade
Topic Will Close A Few Seconds After The Last Reply
Issues with index page infinite scrolling?
How might we better structure #howto?
Hashtags with numbers in parentheses appearing everywhere on Discourse site
After updating to 2.8.0.beta8, nothing shows as "read" anymore
Breaking Mobile view check after Discourse update to 2.5.0.beta7
Dashboard empty since upgradeto 2.5.0
Can’t create new category
Login form missing entirely from Discourse instance
Blank website after update
Content won't load after update
Category link failed after updating today
Error 500 on category page and homepage after upgrade to 2.6
Mouse click is not working in my forum after recent update
Screen black out bug on modal
Social share components do not appear
Admin panel does not work
Totally blank upgrades page
Accidentally overwrote application.hbs || Enter safe mode
Latest beta update (2.7.0b7) gone wrong
Some topic category boxes are missing
Need help reverting forums. I made a mistake
Pups::ExecError: su postgres -c 'psql discourse -c "alter schema public owner to discourse;"' failed with return
Can not access Discourse - blank page
Site broken after update
The "Save Changes" button is very low on my user preferences interface page
Phantom signups (two users with the same account after migration)
Homepage (sub)category display - lots of whitespace
Category Image Formatting
Update problem help pls
Bug on topic interface after an update || Resolved
Scroll jank when scrolling up
504 Gateway Timeout for some reports
Trust level 1 users cannot Invite
Error: Something went wrong - "Error while processing route: discovery.categories"
Loading groups gives internal server error
UI not rendering in Chrome/Firefox due to CloudFlare rocket loader
Private Message Can't Be Reached with private messaging disabled
How many category moderators are shown on about page?
What on earth is causing this?
While loading a new component on the site, the site is down
IP Lookup UI is broken
My forum is stuck on the loading screen
Safe-mode failed with a plugin
After upgrading to discourse 3.. can only access to admin using safe-mode
BBCode `url` tags break if wrapped text ends in URL with component after host
Fedoras Discourse instance made some troubles. Could the support please give some feedback
Minimizing Maintenance on Theme Customizations
Hide topic timeline
Forum stuck on the loading home screen
MacOs users on old version can´t read posts
Easy Responsive Footer Plug-in bug issues
Inline formatting used when "preformatted text" formatting applied to multi-line selection
Moving the server
Entire site is a blank page after upgrade
Collapse Button Not Working on Profile Page (Mobile)
Discourse forum wont load any pages whatsoever
`white-space` CSS property of clipboard data not respected when pasting in rich text editor
Discourse broken after moving servers
Dragging highlighted texts causes Chrome freeze
Client-side vs. server-side?
Client-side vs. server-side?
While loading a new component on the site, the site is down
Can't get Ruby to update so ./launcher rebuild app keeps failing
Base_path not being substituted in some cases
Edit CSS/HTML of custom theme not appearing
Finding Discourse RSS feeds
500 Error when posting, moment.tz runtime error
Some DMs are not visible
Air Theme Latest Update - Crash
Dashboard New Posts statistics broken
Made some changes I cannot revert
Floating search box cannot be closed when device goes from horizontal to vertical
I'm getting errors when I switch categories too quickly
Inline “preformatted text” formatting used when multi-line selection doesn't contain hard break
Coincidental Markdown in formatted content pasted to rich text editor rendered on publish
Category settings broken
Spurious notification when navigating away from review queue after adding note
Links produced by the Composer link modal break when they contain a ' (%27)
TypeError when submitting a flag with custom content (require_message flags)
OpenClaw plugin for Discourse integration
Case study of an amateur plugin author
500 error on category view mobile due to knowledge base plugin
A topic doesn't open with recent upgrade due to a plugin
Only loading HEAD after upgrading docker, due to Babble plugin
Category Icons
Server errors in 2.5.0.beta3
Weird Formatting Bug in old Microsoft Edge
Topic replies are not displaying in chronological order?
My Discourse site is not loading due to misconfigured CSP
Missing scroll bar slider, in Finnish Localization
Category link failed after updating today
Discourse and Uncaught ReferenceError: ClipboardJS is not defined
The order of characters when typing in the floating search widget is reversed
Using Cloudflare for HTTPS, empty preview pane in edit page
Writing an effective bug report
Avatar settings not visible with SSO
Emoticon button not working anymore (because of babble plugin)
Stable broken due to discourse-spoiler-alert
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

なぜかこれらのリンクは新しいタブまたはウィンドウで開いた場合にのみ機能します。最初のリンクは「oops」ページに、2番目のリンクはホームページに移動します。しかし、セーフモードバナーは表示されません。2番目のリンクは、ユーザーにセーフモードを試してもらうためにリンクを送信した場合に問題を引き起こす可能性があります。ユーザーがリンクをクリックしても、セーフモードなしでサイトを使用し続けます。

この情報は#how-toに追加すべきかもしれません。

「いいね!」 4

よく見つけました。どちらのリンクも壊れています。最初のリンクには「?」が、2番目のリンクには「%2C」の代わりにカンマが必要です。

「いいね!」 2

どこに「?」が必要ですか?
例としてリンクを共有していただけますか?

「いいね!」 1

すみません、最初のものも間違っていました。内部ナビゲーションは機能しませんが、新しいウィンドウでは機能します。
Discourse Meta

他のものも間違っていました! Discourse Meta - Discourseの公式サポートフォーラム
は、同じページでのナビゲーションとしては機能しません。

私の間違いです。何かが壊れていますが、URLではありません。

「いいね!」 1

インプレースで開こうとしているためだと思います。それについて議論する代わりに、try.discourse.org に切り替えました。 :slight_smile:

「いいね!」 2

管理者は、これらのリンクを共有すると問題が発生する可能性があることを引き続き知っておくべきだと思います。

たとえば、メタで問題を報告したとします。あなたは「https://meta.discourse.org/safe-mode を試すことはできますか?」と尋ねるかもしれません。すると私は、そのリンクが機能しないと答えるでしょう。
さらに悪いことに、テーマのみを無効にすることを指定したい場合、https://meta.discourse.org/?safe_mode=no_themes を試すように依頼します。私の問題は依然として存在します。本当にセーフモードを使用したとどうして確信できるのでしょうか?ユーザーとしては、リンクをクリックしたときに何か起こったので、機能したと思います。

ここに投稿した後、あなたはこれを知っています。しかし、他の管理者は、これが問題になる可能性があることに注意する必要があることをどのように知るのでしょうか?

「いいね!」 3

このセーフホームページが表示される(すべてのコンテンツが置き換えられる)性質上、このリンクを新しいタブで開く例外を設けるべきかどうか疑問に思っています。

「いいね!」 2

メモと「成功した」もののスクリーンショットを追加しました。いかがでしょうか?

「いいね!」 4

3件の投稿が新しいトピックに分割されました: Should safe mode be default off for non-staff users?