Bulk Actions > Set Category results in error

AI-generated summary

A user encountered an error when trying to move topics using Bulk Actions > Set Category in Discourse v2.0.0.beta10 +71. The issue was traced to topics with titles shorter than the minimum required length of 15 characters, a result of importing from phpBB. tehspaceg suggested duplicate titles as a possible cause, but the actual problem was resolved by checking the logs codinghorror. allu identified the error in production.log, confirmed the issue via a database query, and fixed it by temporarily lowering the minimum title length to 1, moving the topics, and restoring the limit. The solution highlights the importance of reviewing logs and understanding import constraints.

I am trying to move 30 topics from a subcategory to the parent category by multiple select and then applying Bulk Actions > Set Category. This results in an error message “Sorry, an error has occurred.”. The category does not get updated. All the data was imported from phpBB. I am using v2.0.0.beta10 +71.

Any ideas?

I ran into this when I imported my topics from NodeBB; there are probably topics with duplicate titles. There is a setting you can enable to allow duplicate topic titles, or you can manually rename them.

You might learn more about the error by going to /logs

Indeed, I could also verify this to be true in my case by querying the discourse db. I also tried allowing duplicate titles, like you suggested. Unfortunately, this did not resolve my issue. Nevertheless, yours is a great input, and I am likely to run into this down the line.

Thanks for pointing out the obvious to me. Indeed, by looking at the logs (duh), I managed to identify my issue. Being a newbie, and not really knowing my way around discourse (yet), I would like to share how I proceeded. Maybe it will be of some help to others investigating similar problems.

My first issue was, that I wasn’t entirely sure what logs to look at. To find this out, I reproduced my error and then executed this command to find which logs under /var/discourse/shared/standalone/log have changed:

find /var/discourse/shared/standalone/log -type f -mmin -1 -printf '%TY-%Tm-%Td %TT %p\n' | sort -r

having then identified that the action was going on in production.log, i then tailed it to find this error:

ActiveRecord::RecordInvalid (Validation failed: Title is too short (minimum is 15 characters), Title seems unclear, is it a complete sentence?)

Next, I was interested to learn what my (imported) minimum topic length was. I executed the following query against postgres:

select min(length(title)) from topics where archetype = 'regular' and length(title) < 15

surprisingly, i turned out to be 1 (bye bye phpBB, I won’t miss you…) :roll_eyes:

Then, I went into Discourse admin, set min topic title length to 1, moved my posts, and then reset to 15.

Problem solved :grinning: