Old/Bad Category CID somehow stuck in nodeBB cache. How to clear?
-
Thank you for this amazing platform. I ran into an unusual issue where I have a category CID coming back from the cache and I have no reference to it anywhere within any of the collections on the mongo database.
I have attemtped to trace this back to the cache library and tried to perform a cache reset also. I have also re-build all assets with ./nodebb build. Where can I clear this bogus cid. Its crashing the entire server and I need to clear it.
For now I just added a temporary filter on the cids array to manually remove it and this is temporarily fixing my problem and allowing nodebb server to start and operate fine.
Before I do any more review of the codebase, I was wondering if I am just missing something.
So for example the cids will come back as:
[ '1', '2', '3', '4' ]
'4' is bad cid. It is non-existant and must be removed from cache. This '4' does not exist in database and causes nodebb to crash.
I cannot clear '4' cid from cache.
So my temporary fix is to do
.filter(cid => cid !== '4') // This is fixing for now.
NodeBB/src/categories/index.js at master · NodeBB/NodeBB
Node.js based forum software built for the modern web - NodeBB/src/categories/index.js at master · NodeBB/NodeBB
GitHub (github.com)
Categories.getAllCidsFromSet = function (key, callback) { const cids = cache.get(key); // ... })
Any advice I greatly appreciate!