# 로그에 여러 "ERROR: relation" 발생: 원인이 무엇이며 신경 쓸 필요가 있나요?

**URL:** https://meta.discourse.org/t/various-error-relation-in-logs-what-is-it-and-should-i-care/164092
**Category:** Support
**Created:** [9월 15, 2020, 2:30오후 UTC](https://meta.discourse.org/t/various-error-relation-in-logs-what-is-it-and-should-i-care/164092 "2020-09-15T14:30:43Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [9월 15, 2020, 2:30오후 UTC](https://meta.discourse.org/t/various-error-relation-in-logs-what-is-it-and-should-i-care/164092/1 "2020-09-15T14:30:43Z")

</div>

로그에 이러한 오류가 여러 개 있습니다:

```plaintext
Job exception: PG::UndefinedTable: ERROR: relation "application_requests" does not exist LINE 1: SELECT "application_requests"."id" FROM "application_request...

```

```plaintext
ActiveRecord::StatementInvalid (PG::UndefinedTable: ERROR: relation "user_auth_tokens" does not exist LINE 1: SELECT "user_auth_tokens".* FROM "user_auth_tokens" WHERE ((...

```

이것에 대해 걱정해야 할까요?

다행히 포럼은 정상적으로 작동하고 있습니다.  
vBulletin을 개발용 Discourse로 마이그레이션한 후, 해당 개발용 Discourse에서 백업을 만들어 표준 설치 환경에 성공적으로 복원했습니다.  
개발 버전에서는 이러한 오류가 발생하지 않는 것 같습니다. 오류나 치명적 오류가 없습니다.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [9월 15, 2020, 2:49오후 UTC](https://meta.discourse.org/t/various-error-relation-in-logs-what-is-it-and-should-i-care/164092/2 "2020-09-15T14:49:06Z")

</div>

다음 명령을 실행해야 할 수도 있습니다.

```
rake db:migrate 

```

마이그레이션이 성공하지 못하게 만드는 데이터베이스 문제가 있을 수도 있습니다.

---

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [9월 15, 2020, 3:15오후 UTC](https://meta.discourse.org/t/various-error-relation-in-logs-what-is-it-and-should-i-care/164092/3 "2020-09-15T15:15:47Z")

</div>

감사합니다, 한번 시도해볼게요 🙂

---

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [9월 16, 2020, 5:33오후 UTC](https://meta.discourse.org/t/various-error-relation-in-logs-what-is-it-and-should-i-care/164092/4 "2020-09-16T17:33:14Z")

</div>

명령어를 실행해 보았지만 문제가 해결되지 않는 것 같습니다.  
다음과 같이 진행했습니다: 명령어 실행, 전체 백업 생성, 해당 백업 복원 시도(같은 서버와 다른 서버 모두).  
실제로 이 오류 메시지는 복원 과정에서 생성됩니다.

백업을 생성하고 복원을 시도했습니다: Discourse 인터페이스의 복원 로그는 “unpacking” 단계에서 멈추지만, 잠시 기다린 후 로그아웃되고 정상적으로 작동하는 복원된 버전의 포럼에 접속되어 있습니다.  
그 후 Discourse 로그에는 다음 오류가 표시됩니다:

```plaintext
Job exception: PG::UndefinedTable: ERROR: relation "application_requests" does not exist LINE 1: SELECT "application_requests"."id" FROM "application_request...
ActiveRecord::StatementInvalid (PG::UndefinedTable: ERROR: relation "user_auth_tokens" does not exist LINE 1: SELECT "user_auth_tokens".* FROM "user_auth_tokens" WHERE ((...

```

개발용 Discourse에서도 동일한 현상이 발생했으며, 오류와 예외의 수는 달랐습니다. 포럼은 정상적으로 작동했습니다.

* * *

그래서 (개발용 Discourse에서) 가져온 사용자만 포함된 포럼의 이전 버전을 복원했습니다.

오류 로그는 이번에도 “restore successful” 단계까지 가지 못했습니다(그 전에 멈춤). 하지만 역시 적절히 로그아웃되고 정상 작동하는 Discourse에 접속되었습니다. 복원 중 발생한 오류는 약간 달랐습니다:

```plaintext
Job exception: PG::UndefinedTable: ERROR: relation "topics" does not exist LINE 1: UPDATE "topics" SET "pinned_at" = NULL, "pinned_globally" = ... ^
7:18 pm
Job exception: PG::UndefinedTable: ERROR: relation "scheduler_stats" does not exist LINE 1: UPDATE "scheduler_stats" SET "duration_ms" = 22741, "live_sl... ^

```

그러니까… 제가 무엇을 해야 할지 확실하지 않습니다. 이러한 복원 후 포럼은 작동하지만, 복원 중에 생성된 오류들이 걱정됩니다.
