# Loading groups gives internal server error

**URL:** https://meta.discourse.org/t/loading-groups-gives-internal-server-error/205004
**Category:** Support
**Created:** [October 1, 2021, 7:20pm UTC](https://meta.discourse.org/t/loading-groups-gives-internal-server-error/205004 "2021-10-01T19:20:32Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![gnowgi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gnowgi/32/113853_2.png) [@gnowgi](https://meta.discourse.org/u/gnowgi)
#### Post date: [October 1, 2021, 7:20pm UTC](https://meta.discourse.org/t/loading-groups-gives-internal-server-error/205004/1 "2021-10-01T19:20:32Z")

</div>

The server is running the 2.8.0.beta6. All other features are working. Groups listing also works, but when clicking on any specific group gives the following error.

Server Error

while trying to load [/groups/.json](https://example.com/groups/%3Cgroupname%3E.json)

Error code: 500 Internal Server Error

The log tells that it is report\_js\_error

It is critical since group functionality is down. Any clue on how to fix the problem will help. Thanks in advance.

---

<div class="post-metadata">

### Author: ![gnowgi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gnowgi/32/113853_2.png) [@gnowgi](https://meta.discourse.org/u/gnowgi)
#### Post date: [October 2, 2021, 10:45am UTC](https://meta.discourse.org/t/loading-groups-gives-internal-server-error/205004/2 "2021-10-02T10:45:59Z")

</div>

The problem became more critical. Cannot read any topics now. The following error message appears:  
Sorry, we couldn’t load that topic, possibly due to a connection problem. Please try again. If the problem persists, let us know.

---

<div class="post-metadata">

### Author: ![rorycb](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rorycb/32/423647_2.png) [@rorycb](https://meta.discourse.org/u/rorycb)
#### Post date: [October 2, 2021, 10:52am UTC](https://meta.discourse.org/t/loading-groups-gives-internal-server-error/205004/3 "2021-10-02T10:52:09Z")

</div>

Have you tried [safe mode](https://meta.discourse.org/t/how-to-use-discourse-safe-mode/53504)? You’ll also want to check your [logs](https://meta.discourse.org/t/where-does-discourse-store-and-show-logs/58022) and probably provide those.

Even with those I personally can’t help you, but without trying those two things there isn’t much for anyone who can to help you with.

My personal self-hosted instance and a CDCK hosted instance I manage both load groups JSON files fine ( I just checked) when on latest.

---

<div class="post-metadata">

### Author: ![gnowgi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gnowgi/32/113853_2.png) [@gnowgi](https://meta.discourse.org/u/gnowgi)
#### Post date: [October 2, 2021, 4:06pm UTC](https://meta.discourse.org/t/loading-groups-gives-internal-server-error/205004/4 "2021-10-02T16:06:44Z")

</div>

This is one of the recurring errors found:

```plaintext
Message (113 copies reported)

ActiveRecord::StatementInvalid (PG::UndefinedColumn: ERROR: column "for_topic" does not exist
LINE 1: SELECT "bookmarks"."id", "bookmarks"."post_id", "for_topic",...
                                                        ^
)
app/controllers/application_controller.rb:520:in `render_json_dump'
app/controllers/topics_controller.rb:1191:in `block (2 levels) in perform_show_response'
app/controllers/topics_controller.rb:1181:in `perform_show_response'
app/controllers/topics_controller.rb:162:in `show'
app/controllers/application_controller.rb:397:in `block in with_resolved_locale'
app/controllers/application_controller.rb:397:in `with_resolved_locale'
lib/middleware/omniauth_bypass_middleware.rb:71:in `call'
lib/content_security_policy/middleware.rb:12:in `call'
lib/middleware/anonymous_cache.rb:355:in `call'
config/initializers/100-quiet_logger.rb:23:in `call'
config/initializers/100-silence_logger.rb:31:in `call'
lib/middleware/enforce_hostname.rb:23:in `call'
lib/middleware/request_tracker.rb:187:in `call'

Backtrace

rack-mini-profiler (2.3.3) lib/patches/db/pg.rb:69:in `exec_params'
rack-mini-profiler (2.3.3) lib/patches/db/pg.rb:69:in `exec_params'
activerecord (6.1.4.1) lib/active_record/connection_adapters/postgresql_adapter.rb:672:in `block (2 levels) in exec_no_cache'
activesupport (6.1.4.1) lib/active_support/dependencies/interlock.rb:48:in `block in permit_concurrent_loads'
activesupport (6.1.4.1) lib/active_support/concurrency/share_lock.rb:187:in `yield_shares'
activesupport (6.1.4.1) lib/active_support/dependencies/interlock.rb:47:in `permit_concurrent_loads'
activerecord (6.1.4.1) lib/active_record/connection_adapters/postgresql_adapter.rb:671:in `block in exec_no_cache'
activerecord (6.1.4.1) lib/active_record/connection_adapters/abstract_adapter.rb:696:in `block (2 levels) in log'
activesupport (6.1.4.1) lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in `block (2 levels) in synchronize'
activesupport (6.1.4.1) lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'

Env

HTTP HOSTS: example.com

```

---

<div class="post-metadata">

### Author: ![gnowgi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gnowgi/32/113853_2.png) [@gnowgi](https://meta.discourse.org/u/gnowgi)
#### Post date: [October 2, 2021, 4:10pm UTC](https://meta.discourse.org/t/loading-groups-gives-internal-server-error/205004/5 "2021-10-02T16:10:26Z")

</div>

Another error is:

```plaintext
rack-mini-profiler-2.3.3/lib/patches/db/pg.rb:69:in `exec_params'
rack-mini-profiler-2.3.3/lib/patches/db/pg.rb:69:in `exec_params'
activerecord-6.1.4.1/lib/active_record/connection_adapters/postgresql_adapter.rb:672:in `block (2 levels) in exec_no_cache'
activesupport-6.1.4.1/lib/active_support/dependencies/interlock.rb:48:in `block in permit_concurrent_loads'
activesupport-6.1.4.1/lib/active_support/concurrency/share_lock.rb:187:in `yield_shares'
activesupport-6.1.4.1/lib/active_support/dependencies/interlock.rb:47:in `permit_concurrent_loads'
activerecord-6.1.4.1/lib/active_record/connection_adapters/postgresql_adapter.rb:671:in `block in exec_no_cache'
activerecord-6.1.4.1/lib/active_record/connection_adapters/abstract_adapter.rb:696:in `block (2 levels) in log'
activesupport-6.1.4.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in `block (2 levels) in synchronize'
activesupport-6.1.4.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
activesupport-6.1.4.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'
activesupport-6.1.4.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'
activesupport-6.1.4.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'
activerecord-6.1.4.1/lib/active_record/connection_adapters/abstract_adapter.rb:695:in `block in log'
activesupport-6.1.4.1/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
activerecord-6.1.4.1/lib/active_record/connection_adapters/abstract_adapter.rb:687:in `log'
activerecord-6.1.4.1/lib/active_record/connection_adapters/postgresql_adapter.rb:670:in `exec_no_cache'
activerecord-6.1.4.1/lib/active_record/connection_adapters/postgresql_adapter.rb:649:in `execute_and_clear'
activerecord-6.1.4.1/lib/active_record/connection_adapters/postgresql/database_statements.rb:53:in `exec_query'
activerecord-6.1.4.1/lib/active_record/connection_adapters/abstract/database_statements.rb:532:in `select'
activerecord-6.1.4.1/lib/active_record/connection_adapters/abstract/database_statements.rb:69:in `select_all'
activerecord-6.1.4.1/lib/active_record/connection_adapters/abstract/query_cache.rb:101:in `block in select_all'
activerecord-6.1.4.1/lib/active_record/connection_adapters/abstract/query_cache.rb:118:in `block in cache_sql'
activesupport-6.1.4.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in `block (2 levels) in synchronize'
activesupport-6.1.4.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
activesupport-6.1.4.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'
activesupport-6.1.4.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'
activesupport-6.1.4.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'
activerecord-6.1.4.1/lib/active_record/connection_adapters/abstract/query_cache.rb:109:in `cache_sql'
activerecord-6.1.4.1/lib/active_record/connection_adapters/abstract/query_cache.rb:101:in `select_all'
activerecord-6.1.4.1/lib/active_record/querying.rb:47:in `find_by_sql'
activerecord-6.1.4.1/lib/active_record/relation.rb:843:in `block in exec_queries'
activerecord-6.1.4.1/lib/active_record/relation.rb:861:in `skip_query_cache_if_necessary'
activerecord-6.1.4.1/lib/active_record/relation.rb:828:in `exec_queries'
activerecord-6.1.4.1/lib/active_record/association_relation.rb:54:in `exec_queries'
activerecord-6.1.4.1/lib/active_record/relation.rb:631:in `load'
activerecord-6.1.4.1/lib/active_record/relation.rb:249:in `records'
activerecord-6.1.4.1/lib/active_record/relation/delegation.rb:88:in `as_json'
activesupport-6.1.4.1/lib/active_support/json/encoding.rb:22:in `encode'
activesupport-6.1.4.1/lib/active_support/json/encoding.rb:22:in `encode'
activesupport-6.1.4.1/lib/active_support/core_ext/object/json.rb:43:in `to_json'
active_model_serializers-0.8.4/lib/active_model/serializer.rb:331:in `to_json'
multi_json-1.15.0/lib/multi_json/adapters/oj.rb:56:in `dump'
multi_json-1.15.0/lib/multi_json/adapters/oj.rb:56:in `dump'
multi_json-1.15.0/lib/multi_json/adapter.rb:25:in `dump'
multi_json-1.15.0/lib/multi_json.rb:139:in `dump'
/var/www/discourse/app/controllers/topics_controller.rb:1186:in `block (2 levels) in perform_show_response'
actionpack-6.1.4.1/lib/action_controller/metal/mime_responds.rb:214:in `respond_to'
/var/www/discourse/app/controllers/topics_controller.rb:1181:in `perform_show_response'
/var/www/discourse/app/controllers/topics_controller.rb:162:in `show'
actionpack-6.1.4.1/lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'
actionpack-6.1.4.1/lib/abstract_controller/base.rb:228:in `process_action'
actionpack-6.1.4.1/lib/action_controller/metal/rendering.rb:30:in `process_action'
actionpack-6.1.4.1/lib/abstract_controller/callbacks.rb:42:in `block in process_action'
activesupport-6.1.4.1/lib/active_support/callbacks.rb:117:in `block in run_callbacks'
/var/www/discourse/app/controllers/application_controller.rb:397:in `block in with_resolved_locale'
i18n-1.8.10/lib/i18n.rb:314:in `with_locale'
/var/www/discourse/app/controllers/application_controller.rb:397:in `with_resolved_locale'
activesupport-6.1.4.1/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
activesupport-6.1.4.1/lib/active_support/callbacks.rb:137:in `run_callbacks'
actionpack-6.1.4.1/lib/abstract_controller/callbacks.rb:41:in `process_action'
actionpack-6.1.4.1/lib/action_controller/metal/rescue.rb:22:in `process_action'
actionpack-6.1.4.1/lib/action_controller/metal/instrumentation.rb:34:in `block in process_action'
activesupport-6.1.4.1/lib/active_support/notifications.rb:203:in `block in instrument'
activesupport-6.1.4.1/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
activesupport-6.1.4.1/lib/active_support/notifications.rb:203:in `instrument'
actionpack-6.1.4.1/lib/action_controller/metal/instrumentation.rb:33:in `process_action'
actionpack-6.1.4.1/lib/action_controller/metal/params_wrapper.rb:249:in `process_action'
activerecord-6.1.4.1/lib/active_record/railties/controller_runtime.rb:27:in `process_action'
actionpack-6.1.4.1/lib/abstract_controller/base.rb:165:in `process'
actionview-6.1.4.1/lib/action_view/rendering.rb:39:in `process'
rack-mini-profiler-2.3.3/lib/mini_profiler/profiling_methods.rb:85:in `block in profile_method'
actionpack-6.1.4.1/lib/action_controller/metal.rb:190:in `dispatch'
actionpack-6.1.4.1/lib/action_controller/metal.rb:254:in `dispatch'
actionpack-6.1.4.1/lib/action_dispatch/routing/route_set.rb:50:in `dispatch'
actionpack-6.1.4.1/lib/action_dispatch/routing/route_set.rb:33:in `serve'
actionpack-6.1.4.1/lib/action_dispatch/journey/router.rb:50:in `block in serve'
actionpack-6.1.4.1/lib/action_dispatch/journey/router.rb:32:in `each'
actionpack-6.1.4.1/lib/action_dispatch/journey/router.rb:32:in `serve'
actionpack-6.1.4.1/lib/action_dispatch/routing/route_set.rb:842:in `call'
/var/www/discourse/lib/middleware/omniauth_bypass_middleware.rb:71:in `call'
rack-2.2.3/lib/rack/tempfile_reaper.rb:15:in `call'
rack-2.2.3/lib/rack/conditional_get.rb:27:in `call'
rack-2.2.3/lib/rack/head.rb:12:in `call'
actionpack-6.1.4.1/lib/action_dispatch/http/permissions_policy.rb:22:in `call'
/var/www/discourse/lib/content_security_policy/middleware.rb:12:in `call'
/var/www/discourse/lib/middleware/anonymous_cache.rb:353:in `call'
rack-2.2.3/lib/rack/session/abstract/id.rb:266:in `context'
rack-2.2.3/lib/rack/session/abstract/id.rb:260:in `call'
actionpack-6.1.4.1/lib/action_dispatch/middleware/cookies.rb:689:in `call'
actionpack-6.1.4.1/lib/action_dispatch/middleware/callbacks.rb:27:in `block in call'
activesupport-6.1.4.1/lib/active_support/callbacks.rb:98:in `run_callbacks'
actionpack-6.1.4.1/lib/action_dispatch/middleware/callbacks.rb:26:in `call'
actionpack-6.1.4.1/lib/action_dispatch/middleware/actionable_exceptions.rb:18:in `call'
actionpack-6.1.4.1/lib/action_dispatch/middleware/debug_exceptions.rb:29:in `call'
actionpack-6.1.4.1/lib/action_dispatch/middleware/show_exceptions.rb:33:in `call'
logster-2.9.7/lib/logster/middleware/reporter.rb:43:in `call'
railties-6.1.4.1/lib/rails/rack/logger.rb:37:in `call_app'
railties-6.1.4.1/lib/rails/rack/logger.rb:28:in `call'
/var/www/discourse/config/initializers/100-quiet_logger.rb:23:in `call'
/var/www/discourse/config/initializers/100-silence_logger.rb:31:in `call'
actionpack-6.1.4.1/lib/action_dispatch/middleware/remote_ip.rb:81:in `call'
actionpack-6.1.4.1/lib/action_dispatch/middleware/request_id.rb:26:in `call'
/var/www/discourse/lib/middleware/enforce_hostname.rb:23:in `call'
rack-2.2.3/lib/rack/method_override.rb:24:in `call'
actionpack-6.1.4.1/lib/action_dispatch/middleware/executor.rb:14:in `call'
rack-2.2.3/lib/rack/sendfile.rb:110:in `call'
actionpack-6.1.4.1/lib/action_dispatch/middleware/host_authorization.rb:92:in `call'
rack-mini-profiler-2.3.3/lib/mini_profiler/profiler.rb:249:in `call'
message_bus-3.3.6/lib/message_bus/rack/middleware.rb:61:in `call'
/var/www/discourse/lib/middleware/request_tracker.rb:187:in `call'
railties-6.1.4.1/lib/rails/engine.rb:539:in `call'
railties-6.1.4.1/lib/rails/railtie.rb:207:in `public_send'
railties-6.1.4.1/lib/rails/railtie.rb:207:in `method_missing'
rack-2.2.3/lib/rack/urlmap.rb:74:in `block in call'
rack-2.2.3/lib/rack/urlm

```

---

<div class="post-metadata">

### Author: ![gnowgi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gnowgi/32/113853_2.png) [@gnowgi](https://meta.discourse.org/u/gnowgi)
#### Post date: [October 2, 2021, 4:14pm UTC](https://meta.discourse.org/t/loading-groups-gives-internal-server-error/205004/6 "2021-10-02T16:14:15Z")

</div>

Thanks. Exploring through safe-mode also gave the same error. Should I rebuild the container after commenting the plugins?

---

<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: [October 2, 2021, 4:35pm UTC](https://meta.discourse.org/t/loading-groups-gives-internal-server-error/205004/7 "2021-10-02T16:35:12Z")

</div>

I don’t think you need to comment out the Plugins if you disabled them in safe-mode and the problem persisted. An upgrade and a rebuild might do the trick though. :+1:

---

<div class="post-metadata">

### Author: ![gnowgi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gnowgi/32/113853_2.png) [@gnowgi](https://meta.discourse.org/u/gnowgi)
#### Post date: [October 2, 2021, 4:38pm UTC](https://meta.discourse.org/t/loading-groups-gives-internal-server-error/205004/8 "2021-10-02T16:38:57Z")

</div>

Thanks.  
Before posting the topic, I did `launcher rebuild image-name`. The errors persist after that.

---

<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: [October 2, 2021, 4:46pm UTC](https://meta.discourse.org/t/loading-groups-gives-internal-server-error/205004/9 "2021-10-02T16:46:12Z")

</div>

Does that do the same job as `./launcher rebuild app`?

---

<div class="post-metadata">

### Author: ![gnowgi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gnowgi/32/113853_2.png) [@gnowgi](https://meta.discourse.org/u/gnowgi)
#### Post date: [October 3, 2021, 2:36pm UTC](https://meta.discourse.org/t/loading-groups-gives-internal-server-error/205004/10 "2021-10-03T14:36:26Z")

</div>

I think so. It should create a container called ‘app’.

---

<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: [October 3, 2021, 2:55pm UTC](https://meta.discourse.org/t/loading-groups-gives-internal-server-error/205004/11 "2021-10-03T14:55:17Z")

</div>

Ah, I see. I’m afraid I only know the basic ‘turn it off, and turn it back on again’ run-through -

- Check it in safe-mode
- Upgrade to latest
- Rebuild app

Is there anything special about your install that may give someone else a clue as to your issue?

---

<div class="post-metadata">

### Author: ![Benjamin\_D](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/benjamin_d/32/277831_2.png) [@Benjamin\_D](https://meta.discourse.org/u/Benjamin_D)
#### Post date: [October 3, 2021, 2:56pm UTC](https://meta.discourse.org/t/loading-groups-gives-internal-server-error/205004/12 "2021-10-03T14:56:06Z")

</div>

It seems you’re missing

> <https://github.com/discourse/discourse/blob/d1d2298a4cee0b021db66ff116a665ee8ae27111/db/migrate/20210913032326_add_for_topic_to_bookmarks.rb>

introduced in this commit  
[https://github.com/discourse/discourse/commit/d1d2298a4cee0b021db66ff116a665ee8ae27111#diff-65e74abf625f9cedea234eabe20ffbc0ef50e6d1ebf5b221d373e2a539082237](https://github.com/discourse/discourse/commit/d1d2298a4cee0b021db66ff116a665ee8ae27111#diff-65e74abf625f9cedea234eabe20ffbc0ef50e6d1ebf5b221d373e2a539082237)

---

<div class="post-metadata">

### Author: ![gnowgi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gnowgi/32/113853_2.png) [@gnowgi](https://meta.discourse.org/u/gnowgi)
#### Post date: [October 3, 2021, 3:26pm UTC](https://meta.discourse.org/t/loading-groups-gives-internal-server-error/205004/13 "2021-10-03T15:26:17Z")

</div>

You saved it. This is it. Upgraded to the latest (aba08d1929) and the problem is solved. But the latest release (2.8.0.beta6) didn’t fix the issue.

Wondering why this issue did not crop up on other discourse instances that we are running which are all at 2.8.0.beta6.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [November 2, 2021, 3:26pm UTC](https://meta.discourse.org/t/loading-groups-gives-internal-server-error/205004/14 "2021-11-02T15:26:22Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
