Bulk Actions > Set Category results in error


(Allen) #1

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?


(Geran Smith) #2

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.


(Jeff Atwood) #3

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


(Allen) #4

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:


(Jeff Atwood) #5