53:M 18 Mar 2021 17:07:05.076 * 10 changes in 300 seconds. Saving...
53:M 18 Mar 2021 17:07:05.076 * Background saving started by pid 25018
25018:C 18 Mar 2021 17:07:05.126 * DB saved on disk
25018:C 18 Mar 2021 17:07:05.127 * RDB: 2 MB of memory used by copy-on-write
53:M 18 Mar 2021 17:07:05.177 * Background saving terminated with success
53:M 18 Mar 2021 17:12:06.097 * 10 changes in 300 seconds. Saving...
53:M 18 Mar 2021 17:12:06.098 * Background saving started by pid 25337
25337:C 18 Mar 2021 17:12:06.145 * DB saved on disk
25337:C 18 Mar 2021 17:12:06.145 * RDB: 2 MB of memory used by copy-on-write
53:M 18 Mar 2021 17:12:06.198 * Background saving terminated with success
HTTP DELETE 메서드를 사용하는 모든 호출에서 문제가 발생하는 것 같습니다. Discourse에게 DELETE 대신 POST를 사용하도록 요청할 수 있을까요? How can Discourse make POST instead of DELETE for "smart" CDN? 와 비슷한 문제인 것 같지만, 저는 CDN을 사용하지 않고 있습니다. Discourse 사이트의 안내에 따라 CentOS와 Docker를 설치한 일반 가상 서버를 사용하고 있을 뿐입니다.
Haproxy 로그 중 HTTP DELETE 요청에 대해 408 에러가 발생하고 있습니다. DELETE 요청을 "drop"하는 원인이 무엇일까요 @codinghorror? 만약 이 DELETE 요청이 haproxy까지 도달했다면 Docker 내부의 소프트웨어까지 도달해야 하는데, 내부에서 이 문제의 원인이 될 수 있는 것이 있을까요?
이것은 production.log 파일입니다. 삭제 요청은 한 번도 확인된 적이 없지만, 다른 모든 작업(게시물 열기, 수정, 저장 등)은 정상적으로 기록되고 있습니다:
Completed 200 OK in 81ms (Views: 0.2ms | ActiveRecord: 0.0ms | Allocations: 14861)
Started GET "/composer_messages?composer_action=edit&topic_id=10&post_id=13" for 176.243.226.205 at 2021-03-20 15:51:09 +0100
Processing by ComposerMessagesController#index as JSON
Parameters: {"composer_action"=>"edit", "topic_id"=>"10", "post_id"=>"13"}
Completed 200 OK in 1191ms (Views: 0.2ms | ActiveRecord: 0.0ms | Allocations: 16940)
Started POST "/presence/publish" for 176.243.226.205 at 2021-03-20 15:51:14 +0100
Processing by Presence::PresencesController#handle_message as */*
Parameters: {"state"=>"editing", "topic_id"=>"10", "post_id"=>"13"}
Completed 200 OK in 9ms (Views: 0.2ms | ActiveRecord: 0.0ms | Allocations: 3192)
Started PUT "/t/e-previsto-un-ritorno-di-freddo-nutro/10" for 176.243.226.205 at 2021-03-20 15:51:17 +0100
Processing by TopicsController#update as */*
Parameters: {"title"=>"E' previsto un ritorno di freddo, nutro?", "category_id"=>1, "slug"=>"e-previsto-un-ritorno-di-freddo-nutro", "topic_id"=>"10", "topic"=>{"title"=>"E' previsto un ritorno di freddo, nutro?", "category_id"=>1}}
Completed 200 OK in 19ms (Views: 0.2ms | ActiveRecord: 0.0ms | Allocations: 5149)
Started POST "/presence/publish" for 176.243.226.205 at 2021-03-20 15:51:17 +0100
Processing by Presence::PresencesController#handle_message as */*
Parameters: {"state"=>"closed", "topic_id"=>"10"}
Completed 200 OK in 10ms (Views: 0.2ms | ActiveRecord: 0.0ms | Allocations: 3159)
Started PUT "/posts/13" for 176.243.226.205 at 2021-03-20 15:51:17 +0100
Processing by PostsController#update as */*
Parameters: {"post"=>{"edit_reason"=>"", "cooked"=>"<p>post di test per vedere. ssss</p>", "raw"=>"post di test per vedere. ssss", "topic_id"=>"10", "raw_old"=>""}, "id"=>"13"}
Completed 200 OK in 3296ms (Views: 0.1ms | ActiveRecord: 0.0ms | Allocations: 86638)
Started GET "/t/10.json" for 176.243.226.205 at 2021-03-20 15:51:20 +0100
Processing by TopicsController#show as JSON
Parameters: {"id"=>"10"}
Completed 200 OK in 143ms (Views: 0.1ms | ActiveRecord: 0.0ms | Allocations: 52707)
Started GET "/draft.json?draft_key=topic_10" for 176.243.226.205 at 2021-03-20 15:51:27 +0100
Processing by DraftController#show as JSON
Parameters: {"draft_key"=>"topic_10"}
Completed 200 OK in 38ms (Views: 0.2ms | ActiveRecord: 0.0ms | Allocations: 4317)
Started GET "/posts/13" for 176.243.226.205 at 2021-03-20 15:51:27 +0100
Processing by PostsController#show as JSON
Parameters: {"id"=>"13"}
Completed 200 OK in 16ms (Views: 0.1ms | ActiveRecord: 0.0ms | Allocations: 5026)
Started POST "/presence/publish" for 176.243.226.205 at 2021-03-20 15:51:29 +0100
Processing by Presence::PresencesController#handle_message as */*
Parameters: {"state"=>"editing", "topic_id"=>"10", "post_id"=>"13"}
Completed 200 OK in 20ms (Views: 0.3ms | ActiveRecord: 0.0ms | Allocations: 3304)
Started GET "/posts/13" for 176.243.226.205 at 2021-03-20 15:51:38 +0100
Processing by PostsController#show as JSON
Parameters: {"id"=>"13"}
Completed 200 OK in 121ms (Views: 0.2ms | ActiveRecord: 0.0ms | Allocations: 56890)
`gem install libv8 -v '8.4.255.0' --source 'https://rubygems.org/'` 명령이 성공적으로 실행되는지 확인한 후 bundling을 수행하십시오.
Gemfile:
mini_racer가 0.3.1로 해결되었는데, 이는
libv8에 의존합니다.
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.2.15/lib/bundler/installer/parallel_installer.rb:220:in `handle_error'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.2.15/lib/bundler/installer/parallel_installer.rb:102:in `call'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.2.15/lib/bundler/installer/parallel_installer.rb:71:in `call'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.2.15/lib/bundler/installer.rb:270:in `install_in_parallel'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.2.15/lib/bundler/installer.rb:210:in `install'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.2.15/lib/bundler/installer.rb:90:in `block in run'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.2.15/lib/bundler/process_lock.rb:12:in `block in lock'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.2.15/lib/bundler/process_lock.rb:9:in `open'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.2.15/lib/bundler/process_lock.rb:9:in `lock'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.2.15/lib/bundler/installer.rb:72:in `run'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.2.15/lib/bundler/installer.rb:24:in `install'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.2.15/lib/bundler/cli/install.rb:64:in `run'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.2.15/lib/bundler/cli.rb:259:in `block in install'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.2.15/lib/bundler/settings.rb:115:in `temporary'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.2.15/lib/bundler/cli.rb:258:in `install'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.2.15/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.2.15/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.2.15/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.2.15/lib/bundler/cli.rb:30:in `dispatch'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.2.15/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.2.15/lib/bundler/cli.rb:24:in `start'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.2.15/exe/bundle:49:in `block in <top (required)>'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.2.15/lib/bundler/friendly_errors.rb:130:in `with_friendly_errors'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.2.15/exe/bundle:37:in `<top (required)>'
/usr/local/bin/bundle:23:in `load'
/usr/local/bin/bundle:23:in `<main>'
I, [2021-03-20T23:42:40.998961 #1] INFO -- : Terminating async processes
I, [2021-03-20T23:42:40.998991 #1] INFO -- : Sending INT to HOME=/var/lib/postgresql USER=postgres exec chpst -u postgres:postgres:ssl-cert -U postgres:postgres:ssl-cert /usr/lib/postgresql/13/bin/postmaster -D /etc/postgresql/13/main pid: 66
I, [2021-03-20T23:42:40.999030 #1] INFO -- : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 183
2021-03-20 23:42:40.999 UTC [66] LOG: received fast shutdown request
183:signal-handler (1616283760) Received SIGTERM scheduling shutdown...
2021-03-20 23:42:41.013 UTC [66] LOG: aborting any active transactions
2021-03-20 23:42:41.014 UTC [66] LOG: background worker "logical replication launcher" (PID 75) exited with exit code 1
2021-03-20 23:42:41.016 UTC [70] LOG: shutting down
183:M 20 Mar 2021 23:42:41.058 # User requested shutdown...
183:M 20 Mar 2021 23:42:41.058 * Saving the final RDB snapshot before exiting.
183:M 20 Mar 2021 23:42:41.061 * DB saved on disk
183:M 20 Mar 2021 23:42:41.061 # Redis is now ready to exit, bye bye...
2021-03-20 23:42:41.263 UTC [66] LOG: database system is shut down
FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle install --deployment --retry 3 --jobs 4 --verbose --without test development' failed with return #<Process::Status: pid 348 exit 5>
Location of failure: /pups/lib/pups/exec_command.rb:112:in `spawn'
exec failed with the params {"cd"=>"$home", "hook"=>"bundle_exec", "cmd"=>["su discourse -c 'bundle install --deployment --retry 3 --jobs 4 --verbose --without test development'"]}
9b0ca932a7dd52ccdd11e268910e3edcd8369c0c08f65e7f8686d542b9be473b
** FAILED TO BOOTSTRAP ** 이전의 오류 메시지를 확인하려면 위로 스크롤하십시오. 오류가 하나 이상 있을 수 있습니다.
./discourse-doctor 명령어가 문제를 진단하는 데 도움이 될 수 있습니다.
➜ discourse git:(master) ✗
@Falco 공식 설정을 다시 시도했지만, stable 대신 "tests-passed"를 사용했습니다. mini_racer gem 오류는 발생하지 않지만, 여전히 DELETE 문제가 발생합니다. nginx 로그의 tail과 콘솔이 열린 브라우저에서 확인할 수 있는 영상에 자세히 나와 있습니다.
POST 요청은 nginx 로그에 즉시 표시되지만, DELETE는 오류 발생 후에만 표시됩니다. 이는 이상한 점입니다.
Curl 명령을 실행하면 잘못된 CSRF가 반환되고, 이는 즉시 Discourse 내부 nginx 로그에 기록됩니다. 하지만 여전히 인터페이스에서 삭제가 작동하지 않으며, 제가 보낸 영상과 마찬가지로 약 35초 지연된 후에야 로그에 나타납니다.
app.yml의 호스트명을 discourse.apicolturaitalianafb.it:8880으로 설정하고 재빌드한 뒤 http://discourse.apicolturaitalianafb.it:8880으로 접속하면 정상적으로 작동하지만, 저는 그렇게 사용할 수 없습니다.
Apache를 실행 중인 프로덕션 웹사이트를 운영 중이라 이 웹사이트의 문서에 따라 haproxy 뒤에 배치해 보았지만, Discourse에서의 삭제가 작동하지 않는 문제가 발생했습니다. 대신 curl 명령은 작동합니다. Apache 리버스 프록시도 시도해 보았는데, curl은 작동하지만 Discourse에서의 삭제는 작동하지 않았습니다. Discourse를 유닉스 소켓으로 구성하고 이를 리버스 프록시하도록 설정해 보았지만 문제는 동일했습니다.
제 판단으로는 리버스 프록싱이 삭제를 “막는” 것이 아니라, Discourse의 JavaScript가 어떤 이유로 인해 올바른 HTML 삭제를 수행하지 않는 것 같습니다.