Service Startup Issues
Troubleshooting guide for AutoDoctorAPI Windows service startup failures, timeouts, runtime mode mismatch, and interpreter-related install behavior.
Categories:
Who This Is For
- Technical users deploying AutoDoctor through installer packages.
- Developers troubleshooting service wrapper runtime behavior.
Symptom Patterns
- Service shows
Startingthen times out. - Service installs but does not transition to
Running. debugmode logs show child process launch failures.
Fast Diagnostic Commands
Get-Service AutoDoctorAPI
sc.exe qc AutoDoctorAPI
Get-Content C:\ProgramData\AutoDoctor\logs\autodoctor_api.log -Tail 100
Invoke-RestMethod http://127.0.0.1:8000/health
Understand Runtime Modes
Mode is read from:
C:\ProgramData\AutoDoctor\config\autodoctor.ini[Service] mode = bundled | system_python
Behavior:
bundled: prefersautodoctor_api.exesystem_python: prefersrun_autodoctor.pyvia selected Python
Common Root Causes and Fixes
1) Bundled mode timeout after installer build from .venv
Cause:
- Packaged runtime mismatch or missing child-start prerequisites on target.
Fix:
- Re-run installer and select
Use system Python interpreter (advanced). - Ensure Python 3.12 + packages:
pywin32,fastapi,uvicorn
- Reinstall service in system-Python mode.
2) System Python mode validation fails in installer
Fix:
py -3 --version
py -3 -m pip install pywin32 fastapi uvicorn
Optional explicit interpreter:
$env:AUTO_DOCTOR_SYSTEM_PYTHON = "C:\Python312\python.exe"
3) Service registered but child API does not launch
Checks:
- Confirm files exist:
<root>\server\api\autodoctor_service.exe<root>\server\api\autodoctor_api.exe<root>\server\api\run_autodoctor.py
Fix:
- Repair install by rerunning installer as Administrator.
- Validate
AUTO_DOCTOR_HOMEandAUTO_DOCTOR_CONFIG_INIare not pointing to stale paths.
Manual Service Re-registration
Bundled mode
cd C:\ProgramData\AutoDoctor\server\api
.\autodoctor_service.exe --startup auto remove
.\autodoctor_service.exe --startup auto install
.\autodoctor_service.exe start
System Python mode
cd C:\ProgramData\AutoDoctor\server\api
py -3 .\autodoctor_service.py --startup auto remove
py -3 .\autodoctor_service.py --startup auto install
py -3 .\autodoctor_service.py start
Verify Recovery
Get-Service AutoDoctorAPI
Invoke-RestMethod http://127.0.0.1:8000/health
Start-Process "http://127.0.0.1:8000/dashboard/"
Note
If startup still fails with no useful local log, inspect Windows Event Viewer (System and Application logs) for SCM and Python runtime entries.