# Internal error: undefined method \`visibility\_reason\_id'

**URL:** <https://meta.discourse.org/t/internal-error-undefined-method-visibility-reason-id/308317>\
**Category:** Self-hosting\
**Created:** [May 16, 2024, 8:55pm UTC](https://meta.discourse.org/t/internal-error-undefined-method-visibility-reason-id/308317 "2024-05-16T20:55:10Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![jeanas](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jeanas/32/281211_2.png) [@jeanas](https://meta.discourse.org/u/jeanas)\
**Post date:** [May 16, 2024, 8:55pm UTC](https://meta.discourse.org/t/internal-error-undefined-method-visibility-reason-id/308317/1 "2024-05-16T20:55:10Z")

</div>

I manage a Discourse instance on [https://lilypond.community](https://lilypond.community). A few hours ago, I used the Web interface to upgrade Discourse to 3.3.0beta2. It failed with the same error as on [3.3.0.beta2-dev update error - #8 by david](https://meta.discourse.org/t/3-3-0-beta2-dev-update-error/308163/8). At that moment, I didn’t have the time to investigate, so I left it as-is, but the forum still looked functional. Now it’s giving

> Oops
> 
> The software powering this discussion forum encountered an unexpected problem. We apologize for the inconvenience.
> 
> Detailed information about the error was logged, and an automatic notification generated. We’ll take a look at it.
> 
> No further action is necessary. However, if the error condition persists, you can provide additional detail, including steps to reproduce the error, by posting a discussion topic in the site’s feedback category.

on any page (`/`, `/t/topic-slug`, etc).

I followed the advice on the linked topic:

```plaintext
cd /var/discourse
git pull
./launcher rebuild app
./launcher start app

```

but it didn’t help. I’m not 100% sure the problem is actually related to the upgrade, though I find it likely.

This is what I find in `/var/discourse/shared/standalone/log/rails/production.log`, just after trying to access the page `https://lilypond.community/t/effacer-les-citations-du-conducteur/5698/8`:

```plaintext
Started GET "/t/effacer-les-citations-du-conducteur/5698/8" for [IP redacted] at 2024-05-16 20:49:53 +0000
Processing by TopicsController#show as HTML
  Parameters: {"slug"=>"effacer-les-citations-du-conducteur", "topic_id"=>"5698", "post_number"=>"8"}
Completed 500 Internal Server Error in 39ms (ActiveRecord: 0.0ms | Allocations: 14832)
NoMethodError (undefined method `visibility_reason_id' for #<Topic id: 5698, title: "Effacer les citations du conducteur", [...]>)
app/serializers/topic_view_serializer.rb:327:in `include_visibility_reason_id?'
(eval):37:in `_fast_attributes'
app/controllers/topics_controller.rb:1360:in `block (2 levels) in perform_show_response'
app/controllers/topics_controller.rb:1354:in `perform_show_response'
app/controllers/topics_controller.rb:187:in `show'
app/controllers/application_controller.rb:423:in `block in with_resolved_locale'
app/controllers/application_controller.rb:423:in `with_resolved_locale'
lib/middleware/omniauth_bypass_middleware.rb:64:in `call'
lib/content_security_policy/middleware.rb:12:in `call'
lib/middleware/anonymous_cache.rb:391:in `call'
lib/middleware/csp_script_nonce_injector.rb:12:in `call'
config/initializers/008-rack-cors.rb:14: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:277:in `call'
start
done

```

For a user page:

```plaintext
Started GET "/u/jeanas/" for [IP redacted] at 2024-05-16 20:47:21 +0000
Processing by UsersController#show as HTML
  Parameters: {"username"=>"jeanas"}
Completed 500 Internal Server Error in 180ms (ActiveRecord: 0.0ms | Allocations: 80166)
NoMethodError (undefined method `custom_homepage' for #<ThemeModifierHelper:0x00007f37a9f775c8 @theme_ids=[1]>)
app/serializers/user_serializer.rb:327:in `can_pick_theme_with_custom_homepage'
(eval):100:in `_fast_attributes'
app/controllers/users_controller.rb:152:in `block (2 levels) in show'
app/controllers/users_controller.rb:149:in `show'
app/controllers/application_controller.rb:423:in `block in with_resolved_locale'
app/controllers/application_controller.rb:423:in `with_resolved_locale'
lib/middleware/omniauth_bypass_middleware.rb:64:in `call'
lib/content_security_policy/middleware.rb:12:in `call'
lib/middleware/anonymous_cache.rb:393:in `call'
lib/middleware/csp_script_nonce_injector.rb:12:in `call'
config/initializers/008-rack-cors.rb:14: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:277:in `call'

```

And for the root page:

```plaintext
Started GET "/" for [IP redacted] at 2024-05-16 20:54:16 +0000
NoMethodError (undefined method `custom_homepage' for #<ThemeModifierHelper:0x00007f37aba0c488 @theme_ids=[]>)
lib/homepage_helper.rb:5:in `resolve'
lib/homepage_constraint.rb:12:in `matches?'
lib/middleware/omniauth_bypass_middleware.rb:64:in `call'
lib/content_security_policy/middleware.rb:12:in `call'
lib/middleware/anonymous_cache.rb:393:in `call'
lib/middleware/csp_script_nonce_injector.rb:12:in `call'
config/initializers/008-rack-cors.rb:14: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:277:in `call'

```

---

_[View the full topic](https://meta.discourse.org/t/internal-error-undefined-method-visibility-reason-id/308317)._
