NginX Proxy Manager?で画像を編集しようとするとエラーが発生します

2.9.0.beta4で編集後に投稿を保存しようとするとエラーが発生します。エラーは500エラーで、見たところ下書きを保存できないようです。以前はこのバージョンでファイル所有権のエラーが発生していました。投稿と下書きの両方が保存されているパスを教えていただけますか。そうすれば、所有権と保護を確認できます。

これはあまりにも単純な答えのように思われるので、もし私が誤解していたら申し訳ありませんが、もしあなたが Discourse Data Explorer を使用しているのであれば、投稿は posts テーブルにあり、下書きは drafts テーブルにあります。

何が機能していないのか、さらに詳しい情報を提供してくれるブラウザコンソールにエラーはありますか?

エクスプローラープラグインは使用していません。インライングラフィックを含むドキュメントを編集すると、このようになるようです。おそらく、それらが保存されているフォルダーの保護設定が正しくないのではないでしょうか?どこにあるかご存知ですか?

「いいね!」 1

@JammyDodger が言及したように、Discourse のデータの大部分は postgres データベースに保存されているため、一部の Discourse の機能にのみ影響する「ファイルの所有権」の問題が発生する可能性は低いです。

標準的なインストールでは、アップロードは /var/discourse/shared/standalone/... に保存されます。そのディレクトリはその後、docker コンテナ内にマウントされます。そこに権限の問題がある可能性があります :+1:

確実にするために、500 エラーの原因はサイトのエラーログに表示されるはずです。管理者としてログインしたら、/logs にアクセスして最近の赤いエラーを探してください。

「いいね!」 4

ウェブサイトから標準的なインストールを実行しました。コンテナ内では、/var には ./discourse が含まれていません。しかし、./www は含まれています。/var/www/discourse は存在します。その中のすべては discourse によって所有されており、共有フォルダやスタンドアロンフォルダはありません。

コンテナ外には /var/discourse/shared/standalone フォルダがあります。Docker インストールであるため、コンテナ外に Docker はありません。

「いいね!」 1

^^エラーログに何か表示されていますか?

/logs がありません。/var/discourse/shared/standalone/log/var-log フォルダと /var/log フォルダがあります。どちらのフォルダにも多数の .gz ファイルが含まれています。

管理者としてログインすると、ブラウザで https://{your forum}}/logs にアクセスできるようになります。

ありがとうございます!知りませんでした。投稿を編集していて500エラーが発生し、ログを確認しました。


保存をクリックした瞬間にエラーが発生します。

「info」タブと「backtrace」タブの全体をコピー&ペーストしてもらえますか?(backtraceの最も役立つ部分は、そのスクリーンショットでは切り取られている上部です)

既存の投稿を編集して500エラーを発生させた直後の情報タブはこちらです。

Hi @vmsman :slightly_smiling_face: お元気ですか?

もしよろしければ、「info」と「backtrace」の全文を、重要な部分がすべて見えるように、ここMetaのコードブロックにコピー&ペーストしていただけますか?

例として、私のテストサイトからの別のエラーを以下に示します。

Message (35 copies reported)

Failed to warm up pretty text: JavaScript was terminated (either by timeout or explicitly)

Backtrace

lib/discourse.rb:772:in `rescue in after_fork'
lib/discourse.rb:768:in `after_fork'
/var/www/discourse/lib/demon/base.rb:217:in `establish_app'
/var/www/discourse/lib/demon/base.rb:147:in `block in run'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.4.7/lib/active_support/fork_tracker.rb:10:in `block in fork'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.4.7/lib/active_support/fork_tracker.rb:8:in `fork'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.4.7/lib/active_support/fork_tracker.rb:8:in `fork'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.4.7/lib/active_support/fork_tracker.rb:27:in `fork'
/var/www/discourse/lib/demon/base.rb:144:in `run'
/var/www/discourse/lib/demon/base.rb:140:in `start'

I found something significant. When I edit an existing post I see a message in red indicating that drafts are offline.

Hopefully this is what you need. The 500 error appears to generate a #<Net::OpenTimeout: execution expired>

/usr/local/lib/ruby/2.7.0/net/http.rb:960:in `initialize'
/usr/local/lib/ruby/2.7.0/net/http.rb:960:in `open'
/usr/local/lib/ruby/2.7.0/net/http.rb:960:in `block in connect'
/usr/local/lib/ruby/2.7.0/timeout.rb:105:in `timeout'
/usr/local/lib/ruby/2.7.0/net/http.rb:958:in `connect'
/usr/local/lib/ruby/2.7.0/net/http.rb:943:in `do_start'
/usr/local/lib/ruby/2.7.0/net/http.rb:932:in `start'
/usr/local/lib/ruby/2.7.0/net/http.rb:606:in `start'
/var/www/discourse/lib/final_destination.rb:515:in `safe_session'
/var/www/discourse/lib/final_destination.rb:455:in `safe_get'
/var/www/discourse/lib/final_destination.rb:147:in `get'
/var/www/discourse/lib/retrieve_title.rb:63:in `fetch_title'
/var/www/discourse/lib/retrieve_title.rb:7:in `crawl'
/var/www/discourse/app/jobs/regular/crawl_topic_link.rb:39:in `execute'
/var/www/discourse/app/jobs/base.rb:232:in `block (2 levels) in perform'
rails_multisite-4.0.1/lib/rails_multisite/connection_management.rb:80:in `with_connection'
/var/www/discourse/app/jobs/base.rb:221:in `block in perform'
/var/www/discourse/app/jobs/base.rb:217:in `each'
/var/www/discourse/app/jobs/base.rb:217:in `perform'
sidekiq-6.4.1/lib/sidekiq/processor.rb:196:in `execute_job'
sidekiq-6.4.1/lib/sidekiq/processor.rb:164:in `block (2 levels) in process'
sidekiq-6.4.1/lib/sidekiq/middleware/chain.rb:138:in `block in invoke'
/var/www/discourse/lib/sidekiq/pausable.rb:138:in `call'
sidekiq-6.4.1/lib/sidekiq/middleware/chain.rb:140:in `block in invoke'
sidekiq-6.4.1/lib/sidekiq/middleware/chain.rb:143:in `invoke'
sidekiq-6.4.1/lib/sidekiq/processor.rb:163:in `block in process'
sidekiq-6.4.1/lib/sidekiq/processor.rb:136:in `block (6 levels) in dispatch'
sidekiq-6.4.1/lib/sidekiq/job_retry.rb:114:in `local'
sidekiq-6.4.1/lib/sidekiq/processor.rb:135:in `block (5 levels) in dispatch'
sidekiq-6.4.1/lib/sidekiq.rb:40:in `block in <module:Sidekiq>'
sidekiq-6.4.1/lib/sidekiq/processor.rb:131:in `block (4 levels) in dispatch'
sidekiq-6.4.1/lib/sidekiq/processor.rb:257:in `stats'
sidekiq-6.4.1/lib/sidekiq/processor.rb:126:in `block (3 levels) in dispatch'
sidekiq-6.4.1/lib/sidekiq/job_logger.rb:13:in `call'
sidekiq-6.4.1/lib/sidekiq/processor.rb:125:in `block (2 levels) in dispatch'
sidekiq-6.4.1/lib/sidekiq/job_retry.rb:81:in `global'
sidekiq-6.4.1/lib/sidekiq/processor.rb:124:in `block in dispatch'
sidekiq-6.4.1/lib/sidekiq/job_logger.rb:39:in `prepare'
sidekiq-6.4.1/lib/sidekiq/processor.rb:123:in `dispatch'
sidekiq-6.4.1/lib/sidekiq/processor.rb:162:in `process'
sidekiq-6.4.1/lib/sidekiq/processor.rb:78:in `process_one'
sidekiq-6.4.1/lib/sidekiq/processor.rb:68:in `run'
sidekiq-6.4.1/lib/sidekiq/util.rb:56:in `watchdog'
sidekiq-6.4.1/lib/sidekiq/util.rb:65:in `block in safe_thread'

I am also seeing a ActionView::Template::Error (undefined method `stylesheet_path’ for #Stylesheet::Manager::Builder:0x00007f27b6c2f850 Did you mean? stylesheet_relpath stylesheet_fullpath) lib/stylesh

lib/stylesheet/manager.rb:246:in `block in stylesheet_details'
lib/stylesheet/manager.rb:215:in `synchronize'
lib/stylesheet/manager.rb:215:in `stylesheet_details'
lib/stylesheet/manager.rb:192:in `stylesheet_link_tag'
app/helpers/application_helper.rb:565:in `discourse_stylesheet_link_tag'
app/views/layouts/crawler.html.erb:11
actionview (6.1.4.1) lib/action_view/base.rb:247:in `public_send'
actionview (6.1.4.1) lib/action_view/base.rb:247:in `_run'
actionview (6.1.4.1) lib/action_view/template.rb:154:in `block in render'
activesupport (6.1.4.1) lib/active_support/notifications.rb:205:in `instrument'
actionview (6.1.4.1) lib/action_view/template.rb:345:in `instrument_render_template'
actionview (6.1.4.1) lib/action_view/template.rb:152:in `render'
rack-mini-profiler (2.3.3) lib/mini_profiler/profiling_methods.rb:85:in `block in profile_method'
actionview (6.1.4.1) lib/action_view/renderer/template_renderer.rb:72:in `block in render_with_layout'
activesupport (6.1.4.1) lib/active_support/notifications.rb:203:in `block in instrument'
activesupport (6.1.4.1) lib/active_support/notifications/instrumenter.rb:24:in `instrument'
activesupport (6.1.4.1) lib/active_support/notifications.rb:203:in `instrument'
actionview (6.1.4.1) lib/action_view/renderer/template_renderer.rb:70:in `render_with_layout'
actionview (6.1.4.1) lib/action_view/renderer/template_renderer.rb:55:in `render_template'
actionview (6.1.4.1) lib/action_view/renderer/template_renderer.rb:11:in `render'
actionview (6.1.4.1) lib/action_view/renderer/renderer.rb:61:in `render_template_to_object'
actionview (6.1.4.1) lib/action_view/renderer/renderer.rb:29:in `render_to_object'
actionview (6.1.4.1) lib/action_view/rendering.rb:117:in `block in _render_template'
actionview (6.1.4.1) lib/action_view/base.rb:273:in `in_rendering_context'
actionview (6.1.4.1) lib/action_view/rendering.rb:116:in `_render_template'
actionpack (6.1.4.1) lib/action_controller/metal/streaming.rb:218:in `_render_template'
actionview (6.1.4.1) lib/action_view/rendering.rb:103:in `render_to_body'
actionpack (6.1.4.1) lib/action_controller/metal/rendering.rb:52:in `render_to_body'
actionpack (6.1.4.1) lib/action_controller/metal/renderers.rb:142:in `render_to_body'
actionpack (6.1.4.1) lib/abstract_controller/rendering.rb:25:in `render'
actionpack (6.1.4.1) lib/action_controller/metal/rendering.rb:36:in `render'
actionpack (6.1.4.1) lib/action_controller/metal/instrumentation.rb:46:in `block (2 levels) in render'
/usr/local/lib/ruby/2.7.0/benchmark.rb:308:in `realtime'
activesupport (6.1.4.1) lib/active_support/core_ext/benchmark.rb:14:in `ms'
actionpack (6.1.4.1) lib/action_controller/metal/instrumentation.rb:46:in `block in render'
actionpack (6.1.4.1) lib/action_controller/metal/instrumentation.rb:86:in `cleanup_view_runtime'
activerecord (6.1.4.1) lib/active_record/railties/controller_runtime.rb:34:in `cleanup_view_runtime'
actionpack (6.1.4.1) lib/action_controller/metal/instrumentation.rb:45:in `render'
lib/topic_list_responder.rb:13:in `block (2 levels) in respond_with_list'
actionpack (6.1.4.1) lib/action_controller/metal/mime_responds.rb:214:in `respond_to'
lib/topic_list_responder.rb:9:in `respond_with_list'
app/controllers/list_controller.rb:103:in `block (2 levels) in <class:ListController>'
actionpack (6.1.4.1) lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'
actionpack (6.1.4.1) lib/abstract_controller/base.rb:228:in `process_action'
actionpack (6.1.4.1) lib/action_controller/metal/rendering.rb:30:in `process_action'
actionpack (6.1.4.1) lib/abstract_controller/callbacks.rb:42:in `block in process_action'
activesupport (6.1.4.1) lib/active_support/callbacks.rb:117:in `block in run_callbacks'
app/controllers/application_controller.rb:387:in `block in with_resolved_locale'
i18n (1.9.1) lib/i18n.rb:328:in `with_locale'
app/controllers/application_controller.rb:387:in `with_resolved_locale'
activesupport (6.1.4.1) lib/active_support/callbacks.rb:126:in `block in run_callbacks'
activesupport (6.1.4.1) lib/active_support/callbacks.rb:137:in `run_callbacks'
actionpack (6.1.4.1) lib/abstract_controller/callbacks.rb:41:in `process_action'
actionpack (6.1.4.1) lib/action_controller/metal/rescue.rb:22:in `process_action'
actionpack (6.1.4.1) lib/action_controller/metal/instrumentation.rb:34:in `block in process_action'
activesupport (6.1.4.1) lib/active_support/notifications.rb:203:in `block in instrument'
activesupport (6.1.4.1) lib/active_support/notifications/instrumenter.rb:24:in `instrument'
activesupport (6.1.4.1) lib/active_support/notifications.rb:203:in `instrument'
actionpack (6.1.4.1) lib/action_controller/metal/instrumentation.rb:33:in `process_action'
actionpack (6.1.4.1) lib/action_controller/metal/params_wrapper.rb:249:in `process_action'
activerecord (6.1.4.1) lib/active_record/railties/controller_runtime.rb:27:in `process_action'
actionpack (6.1.4.1) lib/abstract_controller/base.rb:165:in `process'
actionview (6.1.4.1) lib/action_view/rendering.rb:39:in `process'
rack-mini-profiler (2.3.3) lib/mini_profiler/profiling_methods.rb:85:in `block in profile_method'
actionpack (6.1.4.1) lib/action_controller/metal.rb:190:in `dispatch'
actionpack (6.1.4.1) lib/action_controller/metal.rb:254:in `dispatch'
actionpack (6.1.4.1) lib/action_dispatch/routing/route_set.rb:50:in `dispatch'
actionpack (6.1.4.1) lib/action_dispatch/routing/route_set.rb:33:in `serve'
actionpack (6.1.4.1) lib/action_dispatch/routing/mapper.rb:19:in `block in <class:Constraints>'
actionpack (6.1.4.1) lib/action_dispatch/routing/mapper.rb:49:in `serve'
actionpack (6.1.4.1) lib/action_dispatch/journey/router.rb:50:in `block in serve'
actionpack (6.1.4.1) lib/action_dispatch/journey/router.rb:32:in `each'
actionpack (6.1.4.1) lib/action_dispatch/journey/router.rb:32:in `serve'
actionpack (6.1.4.1) lib/action_dispatch/routing/route_set.rb:842:in `call'
lib/middleware/omniauth_bypass_middleware.rb:71:in `call'
rack (2.2.3) lib/rack/tempfile_reaper.rb:15:in `call'
rack (2.2.3) lib/rack/conditional_get.rb:27:in `call'
rack (2.2.3) lib/rack/head.rb:12:in `call'
actionpack (6.1.4.1) lib/action_dispatch/http/permissions_policy.rb:22:in `call'
lib/content_security_policy/middleware.rb:12:in `call'
lib/middleware/anonymous_cache.rb:354:in `call'
rack (2.2.3) lib/rack/session/abstract/id.rb:266:in `context'
rack (2.2.3) lib/rack/session/abstract/id.rb:260:in `call'
actionpack (6.1.4.1) lib/action_dispatch/middleware/cookies.rb:689:in `call'
actionpack (6.1.4.1) lib/action_dispatch/middleware/callbacks.rb:27:in `block in call'
activesupport (6.1.4.1) lib/active_support/callbacks.rb:98:in `run_callbacks'
actionpack (6.1.4.1) lib/action_dispatch/middleware/callbacks.rb:26:in `call'
actionpack (6.1.4.1) lib/action_dispatch/middleware/actionable_exceptions.rb:18:in `call'
actionpack (6.1.4.1) lib/action_dispatch/middleware/debug_exceptions.rb:29:in `call'
actionpack (6.1.4.1) lib/action_dispatch/middleware/show_exceptions.rb:33:in `call'
logster (2.10.1) lib/logster/middleware/reporter.rb:43:in `call'
railties (6.1.4.1) lib/rails/rack/logger.rb:37:in `call_app'
railties (6.1.4.1) lib/rails/rack/logger.rb:28:in `call'
config/initializers/100-quiet_logger.rb:23:in `call'
config/initializers/100-silence_logger.rb:31:in `call'
actionpack (6.1.4.1) lib/action_dispatch/middleware/remote_ip.rb:81:in `call'
actionpack (6.1.4.1) lib/action_dispatch/middleware/request_id.rb:26:in `call'
lib/middleware/enforce_hostname.rb:23:in `call'
rack (2.2.3) lib/rack/method_override.rb:24:in `call'
actionpack (6.1.4.1) lib/action_dispatch/middleware/executor.rb:14:in `call'
rack (2.2.3) lib/rack/sendfile.rb:110:in `call'
actionpack (6.1.4.1) lib/action_dispatch/middleware/host_authorization.rb:92:in `call'
rack-mini-profiler (2.3.3) lib/mini_profiler/profiler.rb:249:in `call'
message_bus (4.0.0) lib/message_bus/rack/middleware.rb:60:in `call'
lib/middleware/request_tracker.rb:198:in `call'
railties (6.1.4.1) lib/rails/engine.rb:539:in `call'
railties (6.1.4.1) lib/rails/railtie.rb:207:in `public_send'
railties (6.1.4.1) lib/rails/railtie.rb:207:in `method_missing'
rack (2.2.3) lib/rack/urlmap.rb:74:in `block in call'
rack (2.2.3) lib/rack/urlmap.rb:58:in `each'
rack (2.2.3) lib/rack/urlmap.rb:58:in `call'
unicorn (6.1.0) lib/unicorn/http_server.rb:634:in `process_client'
unicorn (6.1.0) lib/unicorn/http_server.rb:739:in `worker_loop'
unicorn (6.1.0) lib/unicorn/http_server.rb:547:in `spawn_missing'

気づかなかったのですが、どうやら画像をアップロードできなくなりました。新しい投稿で画像をアップロードしようとすると、「申し訳ありませんが、ファイルのアップロード中にエラーが発生しました。もう一度お試しください。」というメッセージが表示されます。そのため、古い投稿の編集や保存は500エラーが発生し、テキストのみの新しい投稿は作成できません。テキストのみの投稿は作成も削除もできます。したがって、問題は、新しい投稿でも古い投稿でも、グラフィックを含む投稿の何らかのエラーに絞られたと思います。これらのテストでは、私は管理者ユーザーです。

そこで、完全にフラストレーションが溜まったので、再構築を試みることにしました。最初に表示されるエラーは次のとおりです。

I, [2022-04-29T00:19:51.497560 #1]  INFO -- : cd /var/www/discourse & [ ! -d 'node_modules' ] || su discourse -c 'yarn install --production & yarn cache clean'
warning Skipping preferred cache folder "/home/discourse/.cache/yarn" because it is not writable.
warning Selected the next writable cache folder in the list, will be "/tmp/.yarn-cache-1000".
warning Cannot find a suitable global folder. Tried these: "/usr/local, /home/discourse/.yarn"
warning Skipping preferred cache folder "/home/discourse/.cache/yarn" because it is not writable.
warning Selected the next writable cache folder in the list, will be "/tmp/.yarn-cache-1000".

これらのエラーは興味深いものです。なぜなら、/home/discourse に 777 を設定したにもかかわらず、これらのエラーが発生するからです。
他にエラーはなく、最後のエラーは次のとおりです。

FAILED
--------------------
Pups::ExecError: cd /var/www/discourse & su discourse -c 'bundle exec rake themes:update assets:precompile' failed with return #<Process::Status: pid 716 exit 1>
Location of failure: /usr/local/lib/ruby/gems/2.7.0/gems/pups-1.1.1/lib/pups/exec_command.rb:117:in `spawn'
exec failed with the params {"cd"=>"$home", "hook"=>"assets_precompile", "cmd"=>["su discourse -c 'bundle exec rake themes:update assets:precompile'"]}
bootstrap failed with exit code 1
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one.
./discourse-doctor may help diagnose the problem.
451d4b5ee8d036df6ab8f7717019d94b66d10d261c3d1201547dad7a1722a544
==================== END REBUILD LOG ====================
Failed to rebuild app.

とにかく、./discourse-doctor を実行した後、グラフィック付きで投稿したり、グラフィック付きで投稿を編集したりできるようになりましたが、再起動すると同じエラーが再び発生しました。

まずは基本から見ていくべきだと思います。

  • これは標準的なインストールですか?
  • プラグインやカスタムテーマはインストールされていますか?
  • 再構築した際に、出力にどのようなエラーが表示されますか(つまり、最後に「詳細なエラーについては上にスクロールしてください」と表示される場合、どのようなエラーが表示されますか?コードブロックにすべてコピーしてここに貼り付けていただければ確認できます)
  • discourse-doctor はどのような変更を加えましたか/提案しましたか?また、インスタンスを「再起動」してそれらの変更が機能しなくなったのはどのような操作ですか?

これは標準的なインストールです。約2年間使用しています。
プラグインやカスタムテーマは使用していません。
再構築中に発生したエラーはすべて貼り付けました。
最初の実際のエラーは次のとおりです。

I, [2022-04-29T00:19:51.497560 #1]  INFO -- : > cd /var/www/discourse & [ ! -d 'node_modules' ] || su discourse -c 'yarn install --production & yarn cache clean'
warning Skipping preferred cache folder "/home/discourse/.cache/yarn" because it is not writable.
warning Selected the next writable cache folder in the list, will be "/tmp/.yarn-cache-1000".
warning Cannot find a suitable global folder. Tried these: "/usr/local, /home/discourse/.yarn"
warning Skipping preferred cache folder "/home/discourse/.cache/yarn" because it is not writable.
warning Selected the next writable cache folder in the list, will be "/tmp/.yarn-cache-1000".

Discourse-doctor は変更を提案せず、正常に動作しているように見えます。

500エラーがいつ発生し始めたのか正確にはわかりませんが、その頃から下書きやグラフィック付きの投稿を保存できなくなりました。フォーラムは次のURLから確認できます: https://discussion.scottibyte.com。上記の投稿には、再構築中およびdiscourse-doctor中に表示されたエラーがすべて記載されています。

次のコマンドを実行すると:

./discourse-setup rebuild

インスタンスが起動に失敗すること(上記参照)を伝えることができます。もし、次のコマンドを実行すると:

./discourse-doctor

すぐに完了すると、インスタンスは何らかの方法で少なくとも起動していますが、同じエラーが発生します。
この製品は気に入っていますが、数ヶ月ごとにランダムなエラーが発生し、修正が困難なようです。私のインストールは完全に標準的で、変更は加えていませんが、ランダムに壊れます。

「いいね!」 1

ディスクがいっぱいですか?警告が出ると思いますが。

後ほど改めてオンラインになりますが、念のため確認させてください。それはタイプミスですか?

コマンドは次のようになります。

./launcher rebuild app

いいえ、タイプミスではありません。どうやら間違ったコマンドを使っているようです。今試しています。