I have a really odd problem wit a D6-site that I'm trying to expand with new modules.

I have 23 content types, but at random times they get reduced to 11! Central core content types such as story and page simply disappear along with several content types added by modules and myself using CCK. It's always the same number and selection that goes, and the consequence is that new content of this type cant be created and old content can't be edited. The menu path node/add/my_type simply doesn't work and node/add only contains the limited number of content types.

I can provoke the error by clearing caches or saving the module list (with no changes), but it also seems that they disappear at random times when the site has run for a while. I can occasionally list them and see them all, but suddenly only 11 are left. Going into Create Content (node/add) does not have this effect, but going into Adminster/Edit Content Types (admin/content/types) does. It happens quitely with no errors. I can't get the lost content types back no matter what I do, clearing caches, running update.php etc. The only way is a database restore.

I have been debbuging myself blue in the face trying to trace the problem, removing modules and trying to backtrace calls to "delete from node_type", but can't seem to see anything unusual going on or any contrib modules acting wrongly. My suspicion has been going to modules not getting properly invoked before the content types are rebuilt after a cache clear or hook_node_info's not being called at the right time, but all seems to be OK there.

The site has been running for a long time with no signs of this strange behavior, but now I can reproduce it almost systematically.

I can't put my finger on what part of my upgrade that started this and I can't roll back to older backups due to the amount of content added to the site, which has som 35,000 registered users. The live site is running and does fine, but I dare not fiddle with it before I know what's going on.

I'm really lost here and have no idea where the problem comes from.

Any hints will be appreciated.

Martin