Fix CodeProject.AI Service Not Starting in Windows

I run CodeProject.AI alongside Blue Iris on a refurbished Dell Optiplex 7050 to enable person/vehicle detection for my security cameras. Things generally have worked well since moving away from DeepStack to CodeProject.AI, but recently I started getting AI timeouts in my Blue Iris logs. It turns out CodeProject.AI was not running, and I couldn’t get it to start.
I tried opening the CodeProject.AI dashboard, which is just a shortcut link to the server dashboard. I dug a little deeper and discovered the CodeProject.AI service wasn’t running at all. I tried manually starting it:
- Open the Windows start menu, type services, then open the Services application in the search results
- Scroll down to the CodeProject.AI service
- Right-click and choose Start or Restart
I got an error that the service couldn’t start because of a timeout. I then dug into the Event Viewer logs to see what was going on:
- Open the Windows start menu, type event viewer, then open the Event Viewer application in the search results
- Wait a few moments for things to load; you should see a long list of errors, warnings, and other entries
- Scroll to around the date/time that you tried starting the CodeProject.AI service and see what errors are present
In my case, there was an error message that explained that the modulesettings.json file could not be parsed. At some point it must have gotten malformed, possibly during an unexpected shutdown/reboot of the computer (it has happened a few times lately, that’s another issue to track down).
This file persisted even after I uninstalled and reinstalled CodeProject.AI. So I simply deleted that file, started the CodeProject.AI service again, and it recreated the file (I assume with default settings?). I was back up and running!
Things have been running smoothly for the past couple of weeks as of this blog post, so I think that did the trick.