서버가 일부 랜덤 사용자의 summary.json 처리에 문제가 있어 502 코드를 반환하고 있습니다. 아마도 마지막 업데이트 이후에 시작되었을 것 같지만 확실하지 않습니다.
저는 Discourse 스택에 익숙하지 않아 로그를 찾는 데 어려움을 겪고 있습니다. 사용자 이름과 IP를 숨기기 위해 편집했으며, 시간은 다를 수 있지만 대부분 동일한 프로필 페이지 요청이 여러 번 반복되는 것입니다.
앱의 /var/log/nginx/error.log:
[error] 560#560: *416 upstream prematurely closed connection while reading response header from upstream, client: *.*.*.*, server: _, request: "GET /u/user/summary.json HTTP/2.0", upstream: "http://127.0.0.1:3000/u/user/summary.json", host: "forum.taucetistation.org", referrer: "https://forum.taucetistation.org/u/user"
/shared/log/rails/production_errors.log는 비어 있으며, /shared/log/rails/production.log에는 다음 내용만 포함되어 있습니다.
Started GET "/u/user/summary.json" for *.*.*.* at 2024-05-24 20:26:56 +0000
Processing by UsersController#summary as JSON
Parameters: {"username"=>"user"}
비슷한 요청들에 대해 "Completed 200 OK"가 없습니다.
Unicorn에는 관련 로그가 없는 것 같습니다(시작 시 Redis와의 연결 오류만 있고, 결국 성공한 것으로 보이며 관련이 없어 보입니다).
하지만 /var/log/postgres/current에서 긴 실행 시간을 가진 의심스러운 요청이 하나 있습니다:
2024-05-24 20:49:12.727 UTC [2919] discourse@discourse LOG: duration: 95288.368 ms execute <unnamed>: SELECT replies.user_id, COUNT(*) FROM "posts" INNER JOIN "topics" "topics_posts" ON "topics_posts"."deleted_at" IS NULL AND "topics_posts"."id" = "posts"."topic_id" JOIN posts replies ON posts.topic_id = replies.topic_id AND posts.reply_to_post_number = replies.post_number JOIN topics ON replies.topic_id = topics.id AND topics.archetype <> 'private_message' AND replies.post_type IN (1) WHERE "posts"."deleted_at" IS NULL AND (posts.post_type IN (1,4)) AND "topics"."deleted_at" IS NULL AND (topics.archetype <> 'private_message') AND "topics"."visible" = TRUE AND (topics.category_id IS NULL OR topics.category_id IN (SELECT id FROM categories WHERE NOT read_restricted OR id IN (4,8,20,46,55,60,62,67))) AND "posts"."user_id" = 5318 AND (replies.user_id <> posts.user_id) GROUP BY "replies"."user_id" ORDER BY COUNT(*) DESC LIMIT 6
2024-05-24 20:49:12.728 UTC [2919] discourse@discourse LOG: could not send data to client: Broken pipe
2024-05-24 20:49:12.729 UTC [2919] discourse@discourse FATAL: connection to client lost

