Kaseya Community

Agent Logs not getting truncated from SQL Database

  • When our nightly maintenance runs, kaseya should be moving logs older than 30 days into an archive and deleting them from the database.  The issue is that while the logs are indeed getting archived, they are never removed from the DB.  That means that every day the same list of logs is getting exported with one more getting added.  Our partition is quickly running out of space.  I have experienced this before but db corruption was the culprit, and this time our database seems to be fine.  Does anyone know of a sql query to remove all of these tables?  I know sql basics but something like deleted multiple tables at once is out of my area of expertise.  Thanks!

  • Hi - we do have such a query,as we've run into the  same issue a few times. But, I'm not sure it would be wise to share, as some knowledge what you're doing is recommended. It's a little bit too easy to empty your database if you don't understand what you're doing. You admit to not knowing about these things, so Kaseya should do this for you. Best thing would be to create a ticket with Severity 1 as this fix should be readily available....

  • I've seen similar happening when the backup portion of database maintenance was failing to run.  It seems like removing the tables only happens after the backup (which sort of makes sense if you are relying on this being your only SQL backup...).  In my case I had a separate disk mounted as a folder for the backups, and somewhere along the line Kaseya started checking the available disk space on the root drive of the path before actually running the backup.  Since the disk was mounted in c:\KaseyaData\Backups and the amount of actual space left on the "C:" drive was about 50GB, vs my databases size of 150GB, the database backup would immediately fail, even though the drive mounted at c:\KaseyaData\Backups had 500GB free.  

    I changed this to mount the drive as a new drive letter, and reconfigured the backups to happen there, and since it's been happy and has been deleting the older log tables properly.  (With the exception of "AgentLogsXXX", which i'm starting a separate ticket about.).  

  • - We found the issue after patch .23 was installed. After recently installing patch .24 this issue has been fixed for us. Cleanup is now running as expected, without any further action from us.