Fix CodeProject.AI Service Not Starting in Windows

Smart Home
CodeProject.AI identifying a car in a security camera image

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:

  1. Open the Windows start menu, type services, then open the Services application in the search results
  2. Scroll down to the CodeProject.AI service
  3. Right-click and choose Start or Restart
Screenshot of Services application with CodeProject.AI Server highlighted.

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:

  1. Open the Windows start menu, type event viewer, then open the Event Viewer application in the search results
  2. Wait a few moments for things to load; you should see a long list of errors, warnings, and other entries
  3. Scroll to around the date/time that you tried starting the CodeProject.AI service and see what errors are present
Screenshot of Event Viewer application with CodeProject.AI Server error details shown.

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!

Screenshot of CodeProject.AI configuration files in Windows Explorer.

Things have been running smoothly for the past couple of weeks as of this blog post, so I think that did the trick.


Comments are closed