Got a couple ghost categories

  • NodeBB

    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?


  • @baris That fixed it! Made a new category and deleted it, and no ghosts this time. Weird.

  • NodeBB

    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.


  • Might have been because I didn't use the --flush flag when I ran the importer command for this instance.


  • I ran into the same thing, so my categories also start from 13. Never really bothered me, but you're not along @luke, 😆


  • @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.

  • NodeBB

    @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.


  • @baris Seems to delete all content and then sets up an admin account with the username "admin" and the password "password", before it imports the data.

  • NodeBB

    Oh so if you don't specify flush it won't touch the data in the redis instance, that might explain why some data was invalid.

  • Plugin & Theme Dev

    • 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.

  • GNU/Linux Admin

    @bentael said:

    i am going to get rid of this feature soon, it's too confusing, probably useless, and very error prone

    👍


  • @bentael Well, will you add a flag that will not flush the data? I think the importer could be useful as a merge tool that way.

Suggested Topics

| |