localhost:6379의 Redis에 연결 중 오류 발생 (Errno::EADDRNOTAVAIL)

CentOS 8에 "Docker version 20.10.5, build 55c4c88"을 사용하여 Discourse를 설치한 후 사이트는 실행되고 있지만, /draft.json에 대한 DELETE 요청이 항상 시간 초과됩니다.

Apache를 실행 중이며, Apache 리버스 프록시와 HAProxy를 모두 시도해 보았으나 동작은 동일합니다.

어떤 관련이 있는지 확실하지는 않지만, unicorn.stdout.log 파일에 다음과 같은 오류가 많이 발생하고 있습니다:

==> ./shared/standalone/log/rails/unicorn.stdout.log <==

2021-03-18T10:02:25.138Z pid=108 tid=ocs ERROR: Error fetching job: Error connecting to Redis on localhost:6379 (Errno::EADDRNOTAVAIL)

Starting up 1 supervised sidekiqs

Loading Sidekiq in process id 119

2021-03-18T10:40:09.682Z pid=119 tid=orn ERROR: Error fetching job: Error connecting to Redis on localhost:6379 (Errno::EADDRNOTAVAIL)

2021-03-18T10:40:09.684Z pid=119 tid=ohf ERROR: Error fetching job: Error connecting to Redis on localhost:6379 (Errno::EADDRNOTAVAIL)

2021-03-18T10:40:09.685Z pid=119 tid=owv ERROR: Error fetching job: Error connecting to Redis on localhost:6379 (Errno::EADDRNOTAVAIL)

2021-03-18T10:40:09.683Z pid=119 tid=oob ERROR: Error fetching job: Error connecting to Redis on localhost:6379 (Errno::EADDRNOTAVAIL)

2021-03-18T10:40:09.683Z pid=119 tid=omr ERROR: Error fetching job: Error connecting to Redis on localhost:6379 (Errno::EADDRNOTAVAIL)

Starting up 1 supervised sidekiqs

Loading Sidekiq in process id 121

Redis가 /var/discourse/shared/standalone/log/var-log/redis 경로에 어떤 오류를 기록합니까?

"current"의 내용은 다음과 같습니다:

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

로그는 문제가 없어 보입니다. Discourse 인스턴스를 탐색할 때 여전히 문제가 발생하고 있나요?

여전히 게시글, 초대, 그리고 void된 게시글 수정 사항을 삭제할 수 없습니다.

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 내부의 소프트웨어까지 도달해야 하는데, 내부에서 이 문제의 원인이 될 수 있는 것이 있을까요?

Mar 20 01:47:46 id22302.example.com haproxy[43043]: 176.243.177.232:61760 [20/Mar/2021:01:47:16.622] http-in discourse_socket/server3 0/0/0/30004/30034 408 71 - - CD-- 3/3/2/2/0 0/0 "DELETE /draft.json HTTP/1.1"

Mar 20 01:47:46 id22302.example.com haproxy[43043]: 176.243.177.232:61760 [20/Mar/2021:01:47:16.622] http-in discourse_socket/server3 0/0/0/30004/30034 408 71 - - CD-- 3/3/2/2/0 0/0 "DELETE /draft.json HTTP/1.1"

Mar 20 01:48:09 id22302.example.com haproxy[43043]: 176.243.177.232:61505 [20/Mar/2021:01:47:43.921] http-in discourse_socket/server3 0/0/0/25081/25081 200 396 - - ---- 2/2/1/1/0 0/0 "POST /message-bus/742b0b89384944a7b6376e2d6978889d/poll HTTP/1.1"

Mar 20 01:48:09 id22302.example.com haproxy[43043]: 176.243.177.232:61505 [20/Mar/2021:01:47:43.921] http-in discourse_socket/server3 0/0/0/25081/25081 200 396 - - ---- 2/2/1/1/0 0/0 "POST /message-bus/742b0b89384944a7b6376e2d6978889d/poll HTTP/1.1"

Mar 20 01:48:12 id22302.example.com haproxy[43043]: 176.243.177.232:61887 [20/Mar/2021:01:47:42.886] http-in discourse_socket/server3 0/0/0/30007/30037 408 71 - - CD-- 2/2/1/1/0 0/0 "DELETE /draft.json HTTP/1.1"

Mar 20 01:48:12 id22302.example.com haproxy[43043]: 176.243.177.232:61887 [20/Mar/2021:01:47:42.886] http-in discourse_socket/server3 0/0/0/30007/30037 408 71 - - CD-- 2/2/1/1/0 0/0 "DELETE /draft.json HTTP/1.1"

Mar 20 01:48:25 id22302.example.com haproxy[43043]: 176.243.177.232:62083 [20/Mar/2021:01:48:25.863] http-in discourse_socket/server3 0/0/0/122/122 200 404 - - ---- 2/2/1/1/0 0/0 "POST /topics/timings HTTP/1.1"

Mar 20 01:48:25 id22302.example.com haproxy[43043]: 176.243.177.232:62083 [20/Mar/2021:01:48:25.863] http-in discourse_socket/server3 0/0/0/122/122 200 404 - - ---- 2/2/1/1/0 0/0 "POST /topics/timings HTTP/1.1"

Mar 20 01:48:34 id22302.example.com haproxy[43043]: 176.243.177.232:61505 [20/Mar/2021:01:48:09.193] http-in discourse_socket/server3 0/0/0/25044/25044 200 396 - - ---- 2/2/0/0/0 0/0 "POST /message-bus/742b0b89384944a7b6376e2d6978889d/poll HTTP/1.1"

Mar 20 01:48:34 id22302.example.com haproxy[43043]: 176.243.177.232:61505 [20/Mar/2021:01:48:09.193] http-in discourse_socket/server3 0/0/0/25044/25044 200 396 - - ---- 2/2/0/0/0 0/0 "POST /message-bus/742b0b89384944a7b6376e2d6978889d/poll HTTP/1.1"

Mar 20 01:48:59 id22302.example.com haproxy[43043]: 176.243.177.232:61505 [20/Mar/2021:01:48:34.487] http-in discourse_socket/server3 0/0/0/25087/25087 200 396 - - ---- 1/1/0/0/0 0/0 "POST /message-bus/742b0b89384944a7b6376e2d6978889d/poll HTTP/1.1"

Mar 20 01:48:59 id22302.example.com haproxy[43043]: 176.243.177.232:61505 [20/Mar/2021:01:48:34.487] http-in discourse_socket/server3 0/0/0/25087/25087 200 396 - - ---- 1/1/0/0/0 0/0 "POST /message-bus/742b0b89384944a7b6376e2d6978889d/poll HTTP/1.1"

Mar 20 01:49:35 id22302.example.com haproxy[43043]: 176.243.177.232:62413 [20/Mar/2021:01:49:35.637] http-in discourse_socket/server3 0/0/0/87/87 200 417 - - ---- 1/1/0/0/0 0/0 "POST /message-bus/742b0b89384944a7b6376e2d6978889d/poll?dlp=t HTTP/1.1"

Mar 20 01:49:35 id22302.example.com haproxy[43043]: 176.243.177.232:62413 [20/Mar/2021:01:49:35.637] http-in discourse_socket/server3 0/0/0/87/87 200 417 - - ---- 1/1/0/0/0 0/0 "POST /message-bus/742b0b89384944a7b6376e2d6978889d/poll?dlp=t HTTP/1.1"

Mar 20 01:50:36 id22302.example.com haproxy[43043]: 176.243.177.232:62714 [20/Mar/2021:01:50:36.568] http-in discourse_socket/server3 0/0/0/81/81 200 417 - - ---- 1/1/0/0/0 0/0 "POST /message-bus/742b0b89384944a7b6376e2d6978889d/poll?dlp=t HTTP/1.1"

Mar 20 01:50:36 id22302.example.com haproxy[43043]: 176.243.177.232:62714 [20/Mar/2021:01:50:36.568] http-in discourse_socket/server3 0/0/0/81/81 200 417 - - ---- 1/1/0/0/0 0/0 "POST /message-bus/742b0b89384944a7b6376e2d6978889d/poll?dlp=t HTTP/1.1"

Mar 20 01:51:37 id22302.example.com haproxy[43043]: 176.243.177.232:62993 [20/Mar/2021:01:51:37.541] http-in discourse_socket/server3 0/0/0/78/78 200 417 - - ---- 1/1/0/0/0 0/0 "POST /message-bus/742b0b89384944a7b6376e2d6978889d/poll?dlp=t HTTP/1.1"

Mar 20 01:51:37 id22302.example.com haproxy[43043]: 176.243.177.232:62993 [20/Mar/2021:01:51:37.541] http-in discourse_socket/server3 0/0/0/78/78 200 417 - - ---- 1/1/0/0/0 0/0 "POST /message-bus/742b0b89384944a7b6376e2d6978889d/poll?dlp=t HTTP/1.1"

이것은 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)

또한 PUMA 로그에는 DELETE 요청이 표시되지 않습니다

2021-03-20 16:01:38 +0100 : |Puma| 176.243.226.205 - - [20/Mar/2021:16:01:38 +0100] "GET /t/e-previsto-un-ritorno-di-freddo-nutro/10 HTTP/1.1" 200 - 1.0685

2021-03-20 16:01:39 +0100 : |Puma| 176.243.226.205 - - [20/Mar/2021:16:01:39 +0100] "GET /uploads/default/optimized/1X/_129430568242d1b7f853bb13ebea28b3f6af4e7_2_32x32.png HTTP/1.1" 200 11945 0.0119

2021-03-20 16:01:39 +0100 : |Puma| 176.243.226.205 - - [20/Mar/2021 16:01:39] "POST /message-bus/557c51e14e57450c8c76ab216af0a279/poll HTTP/1.1" HIJACKED -1 0.0956

2021-03-20 16:01:42 +0100 : |Puma| 176.243.226.205 - - [20/Mar/2021:16:01:42 +0100] "POST /message-bus/557c51e14e57450c8c76ab216af0a279/poll HTTP/1.1" 200 - 0.0128

2021-03-20 16:01:43 +0100 : |Puma| 176.243.226.205 - - [20/Mar/2021 16:01:43] "POST /message-bus/557c51e14e57450c8c76ab216af0a279/poll HTTP/1.1" HIJACKED -1 0.0886

2021-03-20 16:01:54 +0100 : |Puma| 176.243.226.205 - - [20/Mar/2021:16:01:54 +0100] "GET /t/e-previsto-un-ritorno-di-freddo-nutro/10 HTTP/1.1" 200 - 0.1436

2021-03-20 16:01:55 +0100 : |Puma| 176.243.226.205 - - [20/Mar/2021:16:01:55 +0100] "GET /uploads/default/optimized/1X/_129430568242d1b7f853bb13ebea28b3f6af4e7_2_32x32.png HTTP/1.1" 200 11945 0.0383

2021-03-20 16:01:56 +0100 : |Puma| 176.243.226.205 - - [20/Mar/2021 16:01:56] "POST /message-bus/1bddd2f9aaf54ec5a589bc74c9c8a409/poll HTTP/1.1" HIJACKED -1 0.0453

2021-03-20 16:01:59 +0100 : |Puma| 176.243.226.205 - - [20/Mar/2021:16:01:59 +0100] "POST /message-bus/1bddd2f9aaf54ec5a589bc74c9c8a409/poll HTTP/1.1" 200 - 0.0129

2021-03-20 16:01:59 +0100 : |Puma| 176.243.226.205 - - [20/Mar/2021 16:01:59] "POST /message-bus/1bddd2f9aaf54ec5a589bc74c9c8a409/poll HTTP/1.1" HIJACKED -1 0.0096

2021-03-20 16:02:07 +0100 : |Puma| 176.243.226.205 - - [20/Mar/2021:16:02:07 +0100] "GET /draft.json?draft_key=topic_10 HTTP/1.1" 200 - 0.0131

2021-03-20 16:02:08 +0100 : |Puma| 176.243.226.205 - - [20/Mar/2021:16:02:08 +0100] "GET /posts/13 HTTP/1.1" 200 - 0.3559

2021-03-20 16:02:08 +0100 : |Puma| 176.243.226.205 - - [20/Mar/2021:16:02:08 +0100] "GET /composer_messages?composer_action=edit&topic_id=10&post_id=13 HTTP/1.1" 200 - 0.2087

2021-03-20 16:02:12 +0100 : |Puma| 176.243.226.205 - - [20/Mar/2021:16:02:12 +0100] "POST /presence/publish HTTP/1.1" 200 - 0.0155

2021-03-20 16:02:24 +0100 : |Puma| 176.243.226.205 - - [20/Mar/2021 16:02:24] "POST /message-bus/1bddd2f9aaf54ec5a589bc74c9c8a409/

이는 리버스 프록시가 잘못 구성되어 GET/POST 이외의 요청을 떨어뜨리고 있다는 뜻입니다. 이는 꽤 흔한 문제이며, 사용자가 이 설정을 직접 건드릴 필요가 없도록 컨테이너 내부에 미리 설정된 리버스 프록시를 함께 제공하는 이유 중 하나이기도 합니다.

HAProxy를 제거하고 컨테이너 자체로 80/443 포트에서 리스닝하도록 하면 문제가 여전히 발생합니까?

@Falco 방금 시도해 봤는데 문제가 여전히 발생합니다. 웹 서버로 Puma 자체를 사용했을 때 DELETE 요청이 드롭되는 걸까요?

Discourse 공식 표준 설치에 따라 설치한 경우, 프로덕션 환경에서 Puma를 사용하지 않습니다.

모든 설치 환경에서 DELETE/PUT 동사를 사용하고 있으며 문제가 발생하지 않으므로, 이는 사용자의 설치 환경에 특이한 문제일 것으로 추정됩니다.

추측이지만, @Andrea_Giovacchini 님, 해당 도메인 앞에 WAF가 구성되어 있나요?

공식 설치 방법을 시도했지만 같은 문제가 발생하여 대안 설치 방법을 시도해 보았습니다.

이제 공식 설정 방법(discourse/docs/INSTALL-cloud.md at main · discourse/discourse · GitHub)을 다시 시도해 보았지만, ./launcher rebuild app 명령에서 다음 메시지와 함께 실패합니다(2일 전에는 실패하지 않았지만, DELETE 문제로 인해 영향을 받았었습니다).

`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는 오류 발생 후에만 표시됩니다. 이는 이상한 점입니다.

다음은 스크린 레코딩입니다:
https://drive.google.com/file/d/1SEOdZjjVkQTpqT3ZQJ7SaR-Ib2mO6m4M/view?usp=sharing

이 테스트는 HAPROXY 같은 다른 소프트웨어를 중간에 두지 않고, 포트 80에서 discourse를 직접 실행하는 방식으로 제안받은 대로 수행했습니다.

좋아요, 내일 확인해 보고 재현해 보겠습니다. 보고해 주셔서 감사합니다.

아니, "stable"은 현재 bundler의 회귀 문제로 인해 불행히도 깨져 있습니다.

향후 하루 동안 수정 작업을 진행할 예정입니다.

@Falco 문제를 재현해 보셨나요?

안녕하세요 @Andrea_Giovacchini,

우선 두 가지 다른 문제가 있습니다:

  1. 차단된 DELETE 요청 문제

  2. “stable” 브랜치를 사용하는 사용자들의 재빌드(rebuild) 오류 문제.

2번 문제는 오늘 https://meta.discourse.org/t/cant-rebuild-current-stable/183859/6?u=falco 를 통해 수정되었습니다.

1번 문제에 대해 제가 확인한 내용은 다음과 같습니다:

저는 새로 설치한 Discourse를 실행하고 있으며, 테스트용 DELETE 명령을 보내면 다음과 같은 응답을 받습니다:

curl -X DELETE https://falcoland.falco.dev/draft.json
["BAD CSRF"]%                                                

이는 해당 명령이 사용자 세션에 대한 유효한 쿠키와 함께 전송되어야 하므로 예상되는 결과입니다.

반면, 귀하의 사이트에서는:

curl -X DELETE http://apicolturaitalianawebinar.it/draft.json -v
*   Trying 213.229.86.117:80...
* Connected to apicolturaitalianawebinar.it (213.229.86.117) port 80 (#0)
> DELETE /draft.json HTTP/1.1
> Host: apicolturaitalianawebinar.it
> User-Agent: curl/7.75.0
> Accept: */*
> 
* Mark bundle as not supporting multiuse
< HTTP/1.1 404 Not Found
< Date: Mon, 22 Mar 2021 18:51:55 GMT
< Server: Apache/2.4.37 (centos) OpenSSL/1.1.1g Phusion_Passenger/6.0.4 mod_perl/2.0.11 Perl/v5.26.3
< X-Runtime: 0.001594
< X-Request-Id: ebe50251-0f06-4b71-acd0-887fb2666abb
< X-Powered-By: Phusion Passenger 6.0.4
< Content-Length: 1351
< Status: 404 Not Found
< Content-Type: text/html; charset=UTF-8
< 

Phusion Passenger에서 404 응답을 반환하고 있습니다. 이는 일반적인 Discourse 설치 환경으로 보이지 않습니다 :thinking:.

삭제 문제로 인해 더 이상 사용할 수 없어 Discourse를 종료했는데, 이제 해당 URL에서 다른 애플리케이션이 응답하고 있습니다.

아, 알겠습니다. 새 설치 환경에서 문제가 재현되지 않으므로, 이 이슈는 닫겠습니다. 문제가 다시 발생하면 재현 단계를 포함하여 새로운 주제를 만들어 주세요.

@Falco http://discourse.apicolturaitalianafb.it/ 에 다시 배포했고, 여기 문서에 따라 표준 설치를 진행해 보세요.

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 삭제를 수행하지 않는 것 같습니다.

직접 노출된 상태로 시도해 보신 신규 설치 환경은 어떤가요?