You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Problems with knowledgeC.db file - can I simply delete it?

Summary: I'm having trouble with the file "knowledgeC.db" (details below) and I'm wondering if I can simply delete this file and allow the OS to re-create it from scratch. Can I?


The issue/what I'm seeing: When I run backups on my Mac, the following file can not be backed up: knowledgeC.db.

This file is located here: /Users/<account_name>/Library/Application Support/Knowledge/knowledgeC.db


I use Carbon Copy Cloner ("CCC") for automated backups (great app, BTW). When I run CCC, it reports a physical read error on this file, it appears to be sitting on a bad sector of the hard drive (sadly, this is the boot drive, a 3 TB "Fusion Drive" consisting of a physical hard drive with a small solid-state flash drive). CCC suggests I delete this unreadable file and replace it with a known good backup (which is generic language for any unreadable file sitting on a bad sector*). This started happening a few weeks ago, and has been consistently reported ever since.


Lately I've also noted performance issues which I am guessing is associated with the problems with this file: long lags where the computer becomes unresponsive and just hangs for 10-60 seconds, I sometimes get the spinning beachball cursor, etc. The cursor can be moved, Finder and other apps can switch windows, but are generally non-responsive; browsers windows may be blank or appear frozen intermittently, until it all seems to resolve itself after a few seconds or up to (what seems like) a full minute. Then things seem fine again for an hour or two, eventually the "hiccup" occurs again. There are no other symptoms, just the inability to backup this file (and only this file, otherwise all backup operations run fine and complete without any errors), and the obvious long lags where the machine becomes largely unusable.


What I've found on the internets: "knowledgeC.db" seems to be a sort of log file tracking app usage and perhaps a plethora of other details of the user/device history. It appears to be related to Siri? (a feature I do not use and never will use), and has been alleged by some to be a potential privacy issue (I'm not concerned about that, though a cursory web search turns up plenty of suggestions that the file is often used for forensic examinations of devices by technicians, some perhaps from law enforcement agencies?; no comment/concerns/judgements/conspiracy rants here, just reporting what I see - I have no privacy concerns about this).


System details:

This old Mac is running macOS Big Sur 11.7.10. It's an iMac (Retina 5K, 27-inch, Late 2015). It's got a handful of external legacy USB hard drives for substantial media storage and backup.


My question: Can I simply delete this file, and if so, will a fresh new one be created automatically?


Worth noting: if it's only needed for Siri, I don't use Siri and have no intention of ever starting to (I just don't want to talk to computers, you all go ahead and knock yourselves out).


If it's a necessary file that won't automatically be recreated if deleted, I assume I can probably find a "good" copy of it from a previous CCC backup, but if it's "optional" I'd be happy as a clam to just do without it and skip the task of finding and replacing it.


Do I need this thing?


(*Yes, a bad sector on the boot drive. We'll get to that issue, but first things first, about this file...)


Thank you for any guidance you can offer.

Earlier Mac models

Posted on Oct 4, 2024 9:27 AM

Reply
Question marked as Top-ranking reply

Posted on Oct 5, 2024 6:50 AM

Only the Apple macOS product team could clarify what that Knowledge folder and its contents are about. They have become increasingly fond of sqlite3 databases. There is no man page, or other operating system documentation that reveals its purpose. You might contact Bombich and ask them the reason you are receiving this CCC error on that Knowledge folder contents.

11 replies
Question marked as Top-ranking reply

Oct 5, 2024 6:50 AM in response to longtimemacuser666

Only the Apple macOS product team could clarify what that Knowledge folder and its contents are about. They have become increasingly fond of sqlite3 databases. There is no man page, or other operating system documentation that reveals its purpose. You might contact Bombich and ask them the reason you are receiving this CCC error on that Knowledge folder contents.

Oct 22, 2024 11:14 AM in response to longtimemacuser666

Circling back to answer some of my own questions and perhaps offer some small insights to others in case someone finds themselves facing similar questions...


Short version: I believe my problems have been resolved. And it appears that the file in question (the file "knowledgeC.db" which resides in /Users/<account_name>/Library/Application Support/Knowledge/) can simply be deleted and on the next restart the OS will re-create a new "knowledgeC.db" file without any fuss and without any dire consequences (at least that's my initial conclusion after running the "fixed" computer for a day or two).


The issue in my case was when doing a backup, my backup software displayed a read-error for this file (because the file was indeed unreadable and corrupt, because it was sitting on a bad sector). Because I was not comfortable with "experimenting" by simply deleting this unreadable file (because it's largely undocumented and I was not sure what would happen if it went missing), and because I knew my boot drive was coughing up bad sectors more than just once in a long while (a sign the drive itself was failing), I wanted to replace the boot drive (in an iMac, not a small undertaking), but wanted to be sure I wouldn't lose any data. Here's what I did:


  • I bought a large (4TB) external solid-state drive (SSD) which would become my new boot drive.
  • Did a full backup of my old boot drive (this is done regularly, but I did incremental backups every time I changed any setting or updated a file I cared about).
  • Booted into Recovery and did a clean install of the macOS to (what would soon be) my new boot drive (the external SSD). I stopped short of MIGRATING files from the old boot HD to the new external SSD, because...
  • Before migrating files, I wanted to find out if the file in question (knowledgeC.db) was something important or if simply deleting it would be trivial. So, I booted off the new external SSD, tested it for a few hours, running apps, copying files, just using the computer as I would normally. It didn't have all my stuff on it but I tested enough to check that things were working. Then I dug down into the Library path and deleted the file in question (knowledgeC.db). Rebooted, and the computer seemed fine. I checked and sure enough, a new knowledgeC.db file had simply been recreated upon restart. I tested the machine for a while, it seemed fine.
  • I rebooted, formatted the (new) boot drive and did a clean reinstall of the macOS again (just to be sure I was starting with a very clean slate). This time, after the OS installation was complete, I proceeded with Migration Assistant to migrate files from the old (internal) boot drive to the new (external SSD) boot drive. That process took about 12 hours* (see below for a note on that). The process completed without any apparent issues.
  • I'm now working from the new external SSD boot drive. All seems to be well, my apps, accounts, and data all seem to have been migrated successfully, without requiring everything to be reinstalled (a handful of items required me to re-log-in and re-validate my credentials, but all apps work).
  • As suggested (in this article: Use an external SSD as your startup disk with your iMac or Mac mini), this appears to have had the side benefit of actually speeding things up a bit. I haven't done anything with the old (internal) boot drive yet; since it was chewing up random corrupt files (which were unlucky enough to be sitting on bad sectors) I'm reluctant to use it for much going forward.


Potentially noteworthy: Before all this, I was observing intermittent system "lags" where the iMac would just hang for 10-30 seconds in an unresponsive state (then it would recover and work for for an hour or longer). The lag was a moderate annoyance, I was speculating that the OS was periodically attempting to read or write/update this "knowledgeC.db" file, was unable to, and eventually gave up and moved on. The new drive and migration seems to have fixed this - in any case I've been working for more than 24 hours without seeing that (or any other annoying) behavior, so maybe my speculation was correct.


Continued in next post...

Oct 22, 2024 11:12 AM in response to longtimemacuser666

Continued from previous post (5000 character limit)...


So, bottom line: moving to a new, external (fast) SSD drive for boot and main functions, with a clean OS installation seems to have fixed all the issues I was observing. The Migration Assistant app is a very useful tool, solid-state drives are great, and I'm glad I invested the time and money to do this, it feels like my old iMac (now 10 years old) has a new lease on life and will be able to soldier on for more years of productivity (yeah, it's not the latest and glossiest hardware, but it is still a very productive tool for most tasks - working on the desktop every day is better than rotting in a landfill).


*A note about procedures that may take a shockingly long time to complete (like migrating large volumes of data): The only glitch that I encountered during this process was when the iMac went to sleep during the long hours of migration. I actually made three separate attempts to accomplish this before I was able to complete the migration. During the first two attempts, the Mac appears to have gone to sleep (or at least the screen saver blanked the screens); the operation was running overnight, I couldn't sit there and move the mouse every 5 minutes to keep it all "awake". Once it woke up, I saw that transfer rates had gone waaaaaaaay way down to a crawl and it appeared the operation would take weeks to finish (so I canceled it and started the entire process over - twice).


I can't be sure if that was related to power-savinig issues but on my third attempt I got at least a little smarter: I unplugged everything that wasn't critical to the operation (an external USB hub with many external drives attached, other peripherals, second monitor, etc.), leaving only wired keyboard, wired mouse, the one external SSD drive, ethernet to the internet. I also looked for KB articles to keep the Mac from sleeping, and found several useful articles which showed a Terminal command to  prevent sleep and screen-sleep (here's one example: Prevent sleep in recovery mode / install disk). I ran that before starting the process (and I also sat there moving the mouse every 9 or 10 minutes just to be sure). This time, transfer speeds dropped a bit after a few hours, but things continued to flow, and the process completed in about 12 hours. The lesson for me was: if you're gonna do things that require overnight or many-days to complete, run that Terminal command before you start. YMMV.


I hope some of the above may be useful to someone someday. Cheers.

Oct 4, 2024 9:43 AM in response to longtimemacuser666

I don't delete mine, and I don't recommend that you delete any file that you don't know what it is or the function it serves. Mine is 25 MB and I simply don't care on a 1TB drive.


The Knowledge folder and its contents are permitted read/write only to your uid (user name) and CCC would not have access to read or search this content. There is a reason this content is so protected.

Oct 4, 2024 10:32 AM in response to VikingOSX

Thank you for your insights.

I don't delete mine, and I don't recommend that you delete any file that you don't know what it is or the function it serves.

I agree and don't delete system files willy nilly either. The size is of course trivial and not the issue here (mine's 7 MB). The warning from CCC about a bad sector, and the (perhaps related?) performance issue is the issue. That's what has prompted my question.

The Knowledge folder and its contents are permitted read/write only to your uid (user name) and CCC would not have access to read or search this content. There is a reason this content is so protected.

Understood, but I'm not sure that's particularly relevant. CCC has been happily backing up this drive quietly and without any mention of this file for years, so I suspect that its access rights to this folder have not changed recently and is not now throwing an inappropriate error message (the error is quite specific, and CCC doesn't complain about any other files in the same folder which presumably would have the same degree of access protection). I have the latest update to CCC installed, and it's been coughing up this "read error" for weeks every time I backup the drive. If CCC was mistakenly trying to now read a file it had previously excluded, I'd guess they (CCC) would be on top of things, they're quite good about such things.


So while I appreciate the warning not to just go deleting random OS files for no reason, my specific questions remain: Is this file really needed (for those who choose not to use Siri), and if it really is needed, would it simply be re-generated automatically if it's deleted? I'm not about to delete it until I get some clarity on that.


Thanks.

Oct 4, 2024 6:38 PM in response to D.I. Johnson

You could simply remove that file from its enclosing folder and see what happens when you next reboot, or over a short span of time.

Yes, of course, but...that's kind of like closing your eyes, pushing a random, unlabeled button and muttering, "gee, I wonder what this one does..." The currently popular acronym "FAFO" comes to mind. Could be easy and inconsequential, could make the world stop spinning. I'd rather get some sense of how risky that would be before going there and just crossing my fingers. But thank you for the suggestion.

Oct 5, 2024 7:43 AM in response to VikingOSX

You might contact Bombich and ask them the reason you are receiving this CCC error on that Knowledge folder contents.

That is a good suggestion and will be my next step. I'm pretty sure their answer will be that unless the user explicitly excludes that folder, their backup software does access the contents of that folder, and the reason I'm getting that error now is simply because the drive really does indeed have a (new) physical bad sector when it had not previously (exactly how they manage that trick given permissions does not really concern me, but the difference in results - the "read error" it's now throwing - suggests to me that what's changed is nothing in permissions or the software, it's actually just a bad sector - Ocam's razor...).


I was hoping (and still am) that someone here might be able to shed even a little light on the actual need for the file in question; it does seem to be a pretty obscure one (so far my online searches for it yield more questions about it than answers, most of them related to forensic efforts, rather than any meaningful insights). FWIW IME the staff at Bombich are generally very responsive (the founder actually answers technical questions), knowledgable and very good about follow up. They typically don't work over weekends (and they're based in Europe so there's a non-trivial time difference). I'm planning to ping them on (their) Monday morning to get their input.


I assume Bombich staff will have limited knowledge about what happens if that file is missing entirely. Based on my current experience, my iMac demonstrates that if that file is still present but is damaged and unreadable (CCC tells me it can't physically read the file), evidently the machine will still run fairly well most of the time, but I am getting periodic lags from 10 to 60 seconds long which are annoying (I'm guessing that the OS is periodically attempting to read/write/update that file, and that's failing because of the bad sector, and that's causing the lags I'm getting, but the OS eventually gives up and moves on for a while...this is just a guess but seems reasonable to me if the purpose of this file is to record a history of various operations...the fact that the machine recovers from this lag and then seems like its old self after a minute hints that maybe the file is not really critical...but it's a significant annoyance when it happens).


There's obviously a larger issue here I'll need to deal with (the boot drive itself seems to be progressively failing). Before I contemplate that (how big of a repair bill would there be to have someone open this iMac and swap in a new boot drive?) I'd like to get the current performance issues squared away first. Even with its advanced age, this old Mac has been a real workhorse and it's still (mostly) very useful. If I can get a drive transplant I might go for that (gotta get an estimate for that - I'll post a separate thread on what to expect when I get to that).


Thanks for all the input on this issue.

Problems with knowledgeC.db file - can I simply delete it?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.