# Error Message when editing large number of topics

**URL:** https://meta.discourse.org/t/error-message-when-editing-large-number-of-topics/132276
**Category:** Support
**Created:** [October 30, 2019, 9:27pm UTC](https://meta.discourse.org/t/error-message-when-editing-large-number-of-topics/132276 "2019-10-30T21:27:54Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![christian\_01](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/christian_01/32/162392_2.png) [@christian\_01](https://meta.discourse.org/u/christian_01)
#### Post date: [October 30, 2019, 9:27pm UTC](https://meta.discourse.org/t/error-message-when-editing-large-number-of-topics/132276/1 "2019-10-30T21:27:54Z")

</div>

Does anyone know why I keep getting this error message when I try and edit more than about 60 topics at once.

‘‘Sorry, an error has occurred.’’

The only workaround is to edit a small number of topics at once - about 30.

 ![11](https://global.discourse-cdn.com/meta/original/3X/b/2/b2967c25c85e417f100543cc3b717ee03e80c96f.jpeg)

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [October 31, 2019, 3:18am UTC](https://meta.discourse.org/t/error-message-when-editing-large-number-of-topics/132276/2 "2019-10-31T03:18:00Z")

</div>

It is a very expensive operation so it is timing out.

---

<div class="post-metadata">

### Author: ![christian\_01](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/christian_01/32/162392_2.png) [@christian\_01](https://meta.discourse.org/u/christian_01)
#### Post date: [October 31, 2019, 6:09pm UTC](https://meta.discourse.org/t/error-message-when-editing-large-number-of-topics/132276/3 "2019-10-31T18:09:01Z")

</div>

Thank you for the feedback, but is there a way to fix it?

---

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [October 31, 2019, 7:37pm UTC](https://meta.discourse.org/t/error-message-when-editing-large-number-of-topics/132276/4 "2019-10-31T19:37:38Z")

</div>

Select less topics at once. I’d suggest keeping it to a about 50 per batch. If you need to bulk edit a very large number of topics, use of the rails console will be necessary. See [Administrative Bulk Operations](https://meta.discourse.org/t/administrative-bulk-operations/118349)

---

<div class="post-metadata">

### Author: ![christian\_01](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/christian_01/32/162392_2.png) [@christian\_01](https://meta.discourse.org/u/christian_01)
#### Post date: [November 1, 2019, 3:54pm UTC](https://meta.discourse.org/t/error-message-when-editing-large-number-of-topics/132276/5 "2019-11-01T15:54:27Z")

</div>

I have thousands of topics in a category!

---

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [November 1, 2019, 3:56pm UTC](https://meta.discourse.org/t/error-message-when-editing-large-number-of-topics/132276/6 "2019-11-01T15:56:21Z")

</div>

Then using the rails console is the best solution here. See the link above for bulk operations.

---

<div class="post-metadata">

### Author: ![christian\_01](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/christian_01/32/162392_2.png) [@christian\_01](https://meta.discourse.org/u/christian_01)
#### Post date: [November 1, 2019, 4:02pm UTC](https://meta.discourse.org/t/error-message-when-editing-large-number-of-topics/132276/7 "2019-11-01T16:02:35Z")

</div>

I can’t see an option to bulk delete all topics in a category?

---

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [November 1, 2019, 4:04pm UTC](https://meta.discourse.org/t/error-message-when-editing-large-number-of-topics/132276/8 "2019-11-01T16:04:47Z")

</div>

The guide to delete all topics in a category is linked in the [Destructive rake tasks](https://meta.discourse.org/t/administrative-bulk-operations/118349#heading--14) section of the guide.

> [@Bulk delete all topics in a category](https://meta.discourse.org/t/deleting-all-topics-in-a-category/97904):
>
> bookmark This guide provides instructions on how to bulk delete all topics within a category on a self-hosted Discourse instance. person_raising_hand Required user level: System Administrator warning SSH access to your server is required Removing all topics from a category can be necessary for various reasons, such as reorganizing content or clearing outdated discussions. This guide walks you through the steps to accomplish this task safely on a self-hosted Discourse server. …

As noted in that guide, please be sure to take a backup before running any destructive tasks like these in case something doesn’t go well.

---

<div class="post-metadata">

### Author: ![christian\_01](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/christian_01/32/162392_2.png) [@christian\_01](https://meta.discourse.org/u/christian_01)
#### Post date: [November 1, 2019, 5:36pm UTC](https://meta.discourse.org/t/error-message-when-editing-large-number-of-topics/132276/9 "2019-11-01T17:36:01Z")

</div>

Right, I’m getting somewhere.

I have successfully bulk removed all topics in a category, but it’s not letting me delete the entire category now because it’s saying:

‘‘Can’t delete this category because topic count is 1.’’

As far as I can see, there are no topics.

Any ideas?

 ![23](https://global.discourse-cdn.com/meta/original/3X/b/1/b183d634a322fc33652c91debc076a23a2d8ae60.png)

---

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [November 1, 2019, 5:38pm UTC](https://meta.discourse.org/t/error-message-when-editing-large-number-of-topics/132276/10 "2019-11-01T17:38:26Z")

</div>

That’s odd. In that case, try deleting the category from the console. See `Delete entire categories` in the Bulk Operations topic for details.

---

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [November 1, 2019, 6:02pm UTC](https://meta.discourse.org/t/error-message-when-editing-large-number-of-topics/132276/11 "2019-11-01T18:02:37Z")

</div>

A quick follow up @christian_01. In the future, please ask for help with what your real issue is - in this case deleting a category with topics in it - rather than what you’re trying to do to solve the issue.

From what I gather, your ultimate goal is deleting a category with lots of topics in it. Had we know that from the beginning, I could’ve pointed you directly to the guide on deleting categories with topics. Instead, we ended up answering a number of other questions, which only got you part way to your goal. Please see

> **[XY problem](https://en.wikipedia.org/wiki/XY_problem)**
>
> The XY problem is a communication problem encountered in help desk, technical support, software engineering, or customer service situations where the question is about an end user's attempted solution (X) rather than the root problem itself (Y).
> The XY problem obscures the real issues and may even introduce secondary problems that lead to miscommunication, resource mismanagement, and sub-par solutions. The solution for the support personnel is to ask probing questions as to why the information i...

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [November 1, 2019, 6:18pm UTC](https://meta.discourse.org/t/error-message-when-editing-large-number-of-topics/132276/12 "2019-11-01T18:18:53Z")

</div>

> [@christian\_01](#):
>
> I have successfully bulk removed all topics in a category, but it’s not letting me delete the entire category now because it’s saying:
> 
> ‘‘Can’t delete this category because topic count is 1.’’

The `destroy:topics` task won’t delete topics that were created by the system user. It will also not delete pinned topics. This means there is a good chance that the category’s About topic will not be deleted. If that’s the case, you can delete it manually.

---

<div class="post-metadata">

### Author: ![christian\_01](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/christian_01/32/162392_2.png) [@christian\_01](https://meta.discourse.org/u/christian_01)
#### Post date: [November 1, 2019, 9:07pm UTC](https://meta.discourse.org/t/error-message-when-editing-large-number-of-topics/132276/13 "2019-11-01T21:07:39Z")

</div>

Yes, that’s the issue I’m having. The last topic to delete is the ‘About’, which I’m struggling to delete.

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [November 1, 2019, 9:31pm UTC](https://meta.discourse.org/t/error-message-when-editing-large-number-of-topics/132276/14 "2019-11-01T21:31:31Z")

</div>

It’s possible that the About topic was unlisted. If you are logged into the site with a staff account, you should be able to see unlisted topics. If for some reason you can’t find the topic, you will be able to get it from the rails console.

---

<div class="post-metadata">

### Author: ![christian\_01](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/christian_01/32/162392_2.png) [@christian\_01](https://meta.discourse.org/u/christian_01)
#### Post date: [November 1, 2019, 9:38pm UTC](https://meta.discourse.org/t/error-message-when-editing-large-number-of-topics/132276/15 "2019-11-01T21:38:52Z")

</div>

No, it’s listed okay. I select delete, but it doesn’t go.

---

<div class="post-metadata">

### Author: ![christian\_01](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/christian_01/32/162392_2.png) [@christian\_01](https://meta.discourse.org/u/christian_01)
#### Post date: [November 1, 2019, 9:41pm UTC](https://meta.discourse.org/t/error-message-when-editing-large-number-of-topics/132276/16 "2019-11-01T21:41:07Z")

</div>

It does have replies. Does that matter?

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [November 1, 2019, 9:45pm UTC](https://meta.discourse.org/t/error-message-when-editing-large-number-of-topics/132276/17 "2019-11-01T21:45:34Z")

</div>

> [@christian\_01](#):
>
> I select delete, but it doesn’t go.

Can you try deleting the topic with your browser’s web inspector open on its ‘console’ tab? There may be an error message that lets us know what the problem is.

The other place to look is in your site’s error logs (Admin / Logs / Error Logs.) Deselect the ‘Debug’, ‘Info’, and ‘Warning’ checkboxes from the bottom left of the error logs page so that you’ll only see the errors in the log list.

> [@christian\_01](#):
>
> It does have replies. Does that matter?

It should be possible to delete a topic that has replies.

---

<div class="post-metadata">

### Author: ![christian\_01](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/christian_01/32/162392_2.png) [@christian\_01](https://meta.discourse.org/u/christian_01)
#### Post date: [November 1, 2019, 9:48pm UTC](https://meta.discourse.org/t/error-message-when-editing-large-number-of-topics/132276/18 "2019-11-01T21:48:42Z")

</div>

Thank you for your feedback @simon.

I managed to delete the whole category successfully using ‘‘rake destroy:categories[…]’’

---

<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: [July 20, 2023, 4:37am UTC](https://meta.discourse.org/t/error-message-when-editing-large-number-of-topics/132276/19 "2023-07-20T04:37:59Z")

</div>



---

<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: [August 19, 2023, 4:38am UTC](https://meta.discourse.org/t/error-message-when-editing-large-number-of-topics/132276/20 "2023-08-19T04:38:08Z")

</div>

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