QuickBooks Database Server Unable to Start (Started and then Stopped)

Symptoms

When attempting to start the database server service, the service throws an error:

“The QuickBooksDB[X] service on local computer started and then stopped. Some services stop automatically if they are not in use by other services or programs”

When you attempt to scan for files in with the QuickBooks Database Server Manager it is unable to resolve network issues due to the service being stopped.

Error

The QuickBooksDB[X] service can only start when the DNS Server Service is not running. I’m frankly not quite sure why this is required, but the issue has been unresolved by Intuit for quite some time.

Solution

  1. Stop the DNS Server service (Stop-Service “DNS”).
  2. Start the QuickBooks service (Start-Service “QuickBooksDB[X]”) *substitute X for your version #.
  3. If started successfully, start the DNS Server service (Start-Service “DNS”). If the QB service fails to start, you may have another issue on your hands.

To resolve this issue permanently, I built a quick PowerShell script that is run every X minutes on our servers to minimize the user downtime and technician involvement. You can find the code on Github and below.

$QB = Get-Service -Name QuickBooks* | Sort-Object | Select-Object -First 1 -ErrorAction Ignore
$DNS = Get-Service -Name DNS -ErrorAction Ignore

If (($DNS -eq $null) -or ($QB -eq $null)){
    Exit
}

If ($QB.Status -eq "Running"){
    Exit
}

If ($QB.Status -eq "Stopped") {
    If ($DNS.Status -eq "Stopped"){
        Start-Service $QB, $DNS
    }ElseIf ($DNS.Status -eq "Running"){
        Stop-Service $DNS
        Start-Service $QB, $DNS
    }
}

$QB = Get-Service -Name QuickBooks* | Sort-Object | Select-Object -First 1 -ErrorAction Ignore
$DNS = Get-Service -Name DNS -ErrorAction Ignore

If (($QB.Status -eq "Stopped") -or ($DNS.Status -eq "Stopped")){
    Write-Host "Services were unable to start. Manual check required."
}

PC Deployments

Over the past couple of weeks I’ve been working on a PC deployment script using PowerShell – the goal is to run the script, walk away, then come back and the computer should be completely set up.

My original version included a lot of proprietary/confidential information as the commands were hard-coded into the script. Obviously, that’s not very good for distribution or customization internally. Thus began the effort to make the script entirely customizable through XML and CSV files.

The basic premise is that there are three stages of deployment – with a reboot in-between each one. This allows changes, such as computer name, domain join, windows updates, etc. to be applied. However, as the PC reboots, it needs to re-initialize the script and resume from where it left off. I ran into a few struggles with the re-initialization/persistent powershell scripts on my virtual machine which were solved through this post (http://www.codewrecks.com/blog/index.php/2017/07/18/hyper-v-and-windows-autologon/). So, the deployment might look something like this:

Stage One: Create user accounts, install software, reboot.

Stage Two: Windows Updates, set computer name, domain join, reboot.

Stage Three: Windows Updates (yes, again!), set power configuration, re-apply the license key (dell manufacturing line issues), copy files from a network share, reboot.

The current version of the script can be found on Github. Right now, I’m debugging the script (there are definitely kinks to be worked out), but the proof of concept is enough to be considered viable.

Disclaimer: As a human, I will inevitably make mistakes and get things wrong. If you  notice an error, or have a better solution, please let me know!

Out of Space on Windows? Updates At Fault.

It seems like each time a client comes to me complaining that their hard drive is full it’s for one of two reasons.

  1. Their hard drive is 40GB.
  2. Windows Update creates unnecessary ‘cab’ files and clutters up the Temp directory.

Of course, this is by no means an exhaustive list. However, it just seems to happen most of the time. When you run WinDirStat (Site/Direct Download v1.1.2) the folder with the most content is C:\Windows\Temp. Oftentimes, I see this location taking up >50-100GB of space. Luckily, the fix is very easy. Delete all the cab files in the C:\Windows\Temp folder.

The data isn’t important and can safely be removed. For one, its in a Temp folder. Also, the cab files are just Windows Update download files…so if they really need to be on the system…they will re-download. Only the hope is that next time Windows actually installs them.

I wrote a Powershell script that is meant to be run on a weekly basis and clears up all of the cab files that have an age greater than 1 week. It’s up to you whether to use an RMM or Task Scheduler, or simply run it once. Here’s the one-liner.

Get-ChildItem -Path "C:\Windows\Temp" -Filter "cab*" | Where-Object {$_.CreationTime -lt ((Get-Date).AddDays(-7)) } | Remove-Item -Force

Disclaimer: As a human, I will inevitably make mistakes and get things wrong. If you  notice an error, or have a better solution, please let me know!