Got a couple ghost categories
-
So category id 14 and 20 are invalid. To check their data
hgetall category:14 hgetall category:20
And to remove them permenantly.
del category:14 zrem categories:cid 14 del category:20 zrem categories:cid 20
Does this issue still happen if you create a new category and purge it?
-
The issue doesn't happen on a new install so I'm guessing it has something to do with the import process. NodeBB creates 12 categories during setup process so any category created after that will start from
cid
13. Looking at the ids you posted seems like the impoter lets nodebb create the default categories and then imports the new categories after 13 so thats why your nextCid value is high.I skimmed over the impoter code but didn't see anything wrong yet. Maybe @bentael might have a better idea.
-
@a_5mith Yeah doesn't really bother me either, because I've also deleted a lot of the categories I've imported. It would be cool if I could change the IDs for the existing ones, but I've already started linking to them, so probably not a good idea.
-
@luke said:
Might have been because I didn't use the --flush flag when I ran the importer command for this instance.
Yeah I'm not sure how runFlush effects things, looks like if you specify runFlush it runs nodebb's setup before importing.
-
-
always use
--flush
, unless for some reason, the import process got interrupted (crashed and you do not want to restart it) (i am going to get rid of this feature soon, it's too confusing, probably useless, and very error prone) -
also, yes, the importer lets NodeBB create the first 12 categories, then attempts to delete them, before it starts importing source categories, hence the id 13 as the first one.
I do not know why the data looked weird, but it's most likely because you haven't flushed before importing.
-