# 데이터 탐색기 플러그인의 일부 쿼리에서 발생하는 내부 서버 오류

**URL:** https://meta.discourse.org/t/internal-server-error-for-some-queries-in-data-explorer-plugin/251410
**Category:** Support
**Tags:** data-explorer
**Created:** [1월 11, 2023, 12:55오후 UTC](https://meta.discourse.org/t/internal-server-error-for-some-queries-in-data-explorer-plugin/251410 "2023-01-11T12:55:00Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Roi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/roi/32/130587_2.png) [@Roi](https://meta.discourse.org/u/Roi)
#### Post date: [1월 11, 2023, 12:55오후 UTC](https://meta.discourse.org/t/internal-server-error-for-some-queries-in-data-explorer-plugin/251410/1 "2023-01-11T12:55:00Z")

</div>

여기([Telegram Notifications Plugin (discourse-telegram-notifications) - #185 by Roi](https://meta.discourse.org/t/telegram-notifications-plugin-discourse-telegram-notifications/60483/185))에서 언급했듯이, 데이터 탐색기에서 일부 쿼리를 사용할 때 오류가 발생합니다.

> [@david](#):
>
> [데이터 탐색기 플러그인](https://meta.discourse.org/t/data-explorer-plugin/32566)에 대한 쿼리입니다:
> 
> ```plaintext
> SELECT user_id, updated_at, value from user_custom_fields
> WHERE name = 'telegram_chat_id'
> 
> ```

> [@Roi](#):
>
> 이 문장을 새 데이터 탐색기 쿼리에 복사하면 `Internal Server Error`(내부 서버 오류)가 발생합니다.
> 
> 데이터베이스에서 해당 문장을 직접 실행하면 정상적으로 동작합니다.
> 
> 이상하네요. 사용 가능한 표준 쿼리 중 몇 가지를 시도해 봤는데, 일부는 정상적으로 작동했지만 다른 쿼리에서는 동일한 오류가 발생했습니다.

Discourse 설치 시 포함된 다른 쿼리에서도 `Internal Server Error`가 발생합니다. 예를 들어:

- 지난 한 주 동안 가장 많은 메시지를 보낸 사람은 누구인가요?
- 가장 많이 '좋아요’를 누른 항목들

다른 쿼리는 정상적으로 작동합니다.

그리고 언급했듯이, 텔레그램 쿼리를 데이터베이스에서 직접 실행하면 이 경우에도 정상적으로 작동합니다.

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [1월 11, 2023, 1:07오후 UTC](https://meta.discourse.org/t/internal-server-error-for-some-queries-in-data-explorer-plugin/251410/2 "2023-01-11T13:07:49Z")

</div>

사이트의 `/logs`를 확인해서 오류에 대한 더 자세한 정보가 있는지 봐 주시겠어요?

---

<div class="post-metadata">

### Author: ![Roi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/roi/32/130587_2.png) [@Roi](https://meta.discourse.org/u/Roi)
#### Post date: [1월 11, 2023, 1:13오후 UTC](https://meta.discourse.org/t/internal-server-error-for-some-queries-in-data-explorer-plugin/251410/3 "2023-01-11T13:13:50Z")

</div>

네. 도움이 되나요? 복사해서 가져왔는데, 브라우저에서는 더 많은 내용이 보입니다.

```plaintext
Message (15 copies reported)

ActiveModel::MissingAttributeError (missing attribute: admin)
app/models/concerns/roleable.rb:14:in `staff?'
lib/plugin/instance.rb:297:in `public_send'
lib/plugin/instance.rb:297:in `block (2 levels) in add_to_class'
(eval):7:in `_fast_attributes'
app/controllers/application_controller.rb:414:in `block in with_resolved_locale'
app/controllers/application_controller.rb:414:in `with_resolved_locale'
lib/middleware/omniauth_bypass_middleware.rb:74:in `call'
lib/content_security_policy/middleware.rb:12:in `call'
lib/middleware/anonymous_cache.rb:366:in `call'
config/initializers/100-quiet_logger.rb:20:in `call'
config/initializers/100-silence_logger.rb:29:in `call'
lib/middleware/enforce_hostname.rb:24:in `call'
lib/middleware/request_tracker.rb:228:in `call'

Backtrace

activemodel (7.0.3.1) lib/active_model/attribute.rb:226:in `value'
activemodel (7.0.3.1) lib/active_model/attribute_set/builder.rb:43:in `fetch_value'
activerecord (7.0.3.1) lib/active_record/attribute_methods/read.rb:38:in `_read_attribute'
activemodel (7.0.3.1) lib/active_model/attribute_methods.rb:277:in `admin'
app/models/concerns/roleable.rb:14:in `staff?'
plugins/discourse-animated-avatars/plugin.rb:90:in `block (2 levels) in activate!'
lib/plugin/instance.rb:297:in `public_send'
lib/plugin/instance.rb:297:in `block (2 levels) in add_to_class'
activesupport (7.0.3.1) lib/active_support/core_ext/object/try.rb:15:in `public_send'
activesupport (7.0.3.1) lib/active_support/core_ext/object/try.rb:15:in `try'

Env

HTTP HOSTS: www.sidemount-forum.com

```

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [1월 11, 2023, 1:19오후 UTC](https://meta.discourse.org/t/internal-server-error-for-some-queries-in-data-explorer-plugin/251410/4 "2023-01-11T13:19:41Z")

</div>

그 백트레이스를 보면 애니메이션 아바타 플러그인과 관련이 있을 수 있는데, 정말 이상하네요! (cc @featheredtoast - 혹시 아이디어가 있으신가요?)

사이트와 모든 플러그인이 최신 버전으로 업데이트되어 있는지 확인해 주시겠어요?

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [1월 11, 2023, 1:21오후 UTC](https://meta.discourse.org/t/internal-server-error-for-some-queries-in-data-explorer-plugin/251410/5 "2023-01-11T13:21:34Z")

</div>

참고로, 이 버그를 재현하기 위해 방금 Animated Avatars 플러그인을 설치했는데 - [Incompatibility between Cakeday,Data-Explorer and Animated Avatar plugins - #3 by JammyDodger](https://meta.discourse.org/t/incompatibility-between-cakeday-and-animated-avatar-plugins/250255/3) - 테스트 사이트에서는 ‘Top 100 Likers’ 쿼리를 실행할 수 없었습니다(하지만 Meta에서는 실행 가능합니다).

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [1월 11, 2023, 1:23오후 UTC](https://meta.discourse.org/t/internal-server-error-for-some-queries-in-data-explorer-plugin/251410/6 "2023-01-11T13:23:25Z")

</div>

오, 흥미롭네요. 같은 원인인 것 같습니다. 이 내용은 다른 주제에서 계속 논의합시다:

> [@Cakeday, Data-Explorer 및 Animated Avatar 플러그인 간 호환성 문제](https://meta.discourse.org/t/incompatibility-between-cakeday-data-explorer-and-animated-avatar-plugins/250255?u=david):
>
> I have both of these plugins installed. The URL to view anniversaries (/cakeday/anniversaries/today) gives this error: play_button Complete logs: I tried to dig into the exact issue here, to me the most relevant lines are here: app/models/concerns/roleable.rb:14:in `staff?' plugins/discourse-animated-avatars/plugin.rb:90:in `block (2 levels) in activate!' ... plugins/discourse-animated-avatars/plugin.rb:94:in `block (2 levels) in activate!' ... app/controllers/application\_controller.rb:519:…

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [1월 11, 2023, 1:23오후 UTC](https://meta.discourse.org/t/internal-server-error-for-some-queries-in-data-explorer-plugin/251410/7 "2023-01-11T13:23:29Z")

</div>


