# 502 errors when renaming large (by topic count) categories

**URL:** https://meta.discourse.org/t/502-errors-when-renaming-large-by-topic-count-categories/164107
**Category:** Bug
**Created:** [September 15, 2020, 4:32pm UTC](https://meta.discourse.org/t/502-errors-when-renaming-large-by-topic-count-categories/164107 "2020-09-15T16:32:24Z")
**Posts on this page:** 1
**Showing post:** 16

<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: [September 25, 2020, 5:17pm UTC](https://meta.discourse.org/t/502-errors-when-renaming-large-by-topic-count-categories/164107/16 "2020-09-25T17:17:24Z")

</div>

> [@Canapin](#):
>
> I tried updating from the rails console,  
> Tried these two commands:
> 
> ```plaintext
> ActiveRecord::Base.connection.execute("UPDATE categories SET name = 'General Discussion', topic_template = '', sort_order = '', default_view = '', read_only_banner = '', name_lower = 'general_discussion', updated_at = '2020-09-16 13:36:50.014192' WHERE categories.id = 21")
> 
> ```
> 
> ```plaintext
> Category.where(id: 21).update(name: "General")
> 
> ```
> 
> Both worked like a charm.

Just a correction about this: I think I previously did `Category.where(id: 21).update(name: "General")` for a category from which I moved the topics out or something like that, because I had to use this command multiple times on various categories right now, and it appears that the command duration is proportional to the number of posts in the target category.  
So basically, it’s the same issue as when I update the category from the interface, except that it won’t timeout in the command line.

It took more maybe one minute for a category with more than 30000 topics, more than, 30 seconds on a topic with more than 15000 topics, and it was fast for categories with few topics.

---

_[View the full topic](https://meta.discourse.org/t/502-errors-when-renaming-large-by-topic-count-categories/164107)._
