# Windows Print Service - Error 1053 Troubleshooting Guide ## ๐Ÿšจ Windows Service Error 1053 - "Service did not respond to start or control request" This error occurs when Windows services don't communicate properly with the Service Control Manager (SCM). Here's how to fix it: ### ๐Ÿ”ง SOLUTION 1: Use the Enhanced Service Package **Problem**: The original service wasn't designed for Windows service requirements. **Fix**: Updated service architecture with proper Windows service communication. #### New Files Included: - โœ… `service_wrapper.py` - Handles Windows service communication - โœ… `print_service_complete.py` - Enhanced with signal handling and proper shutdown - โœ… `test_service.bat` - Test service in standalone mode before installing ### ๐Ÿงช STEP-BY-STEP TROUBLESHOOTING: #### Step 1: Test Service in Standalone Mode ```cmd # Run this to test the service before installing as Windows service test_service.bat ``` If this works, the service code is fine. If not, check the logs. #### Step 2: Check Python and Dependencies ```cmd # Verify Python embedded is working cd C:\QualityPrintService\python_embedded python.exe --version # Test the service script directly python.exe ..\print_service_complete.py --test ``` #### Step 3: Install with Enhanced Wrapper The installer now creates a service wrapper that properly communicates with Windows SCM: ```cmd # Uninstall old service sc stop QualityPrintService sc delete QualityPrintService # Reinstall with enhanced wrapper install_service_complete.bat ``` #### Step 4: Manual Service Control ```cmd # Start service manually to see error details net start QualityPrintService # Check service status sc query QualityPrintService # View service logs type "%USERPROFILE%\PrintService\logs\service_wrapper_*.log" ``` ### ๐Ÿ” DIAGNOSTIC COMMANDS: #### Check Service Installation: ```cmd sc query QualityPrintService sc qc QualityPrintService ``` #### Check Port Availability: ```cmd netstat -an | findstr :8765 ``` #### Test HTTP Endpoints: ```cmd curl http://localhost:8765/health # OR powershell Invoke-WebRequest -Uri "http://localhost:8765/health" ``` ### ๐Ÿ“‹ COMMON SOLUTIONS: #### Solution A: Port Already in Use ```cmd # Find process using port 8765 netstat -ano | findstr :8765 # Kill process if needed (replace PID) taskkill /PID /F ``` #### Solution B: Python Path Issues ```cmd # Verify Python embedded path in service wrapper type "C:\QualityPrintService\service_wrapper.bat" ``` #### Solution C: Permissions Issues ```cmd # Run installer as Administrator # Right-click install_service_complete.bat โ†’ "Run as administrator" ``` #### Solution D: Service Recovery ```cmd # Configure automatic recovery sc failure QualityPrintService reset= 86400 actions= restart/5000/restart/5000/restart/5000 ``` ### ๐Ÿ“Š SERVICE STATUS VERIFICATION: #### Successful Service Start: - Service Status: RUNNING - HTTP Response: `{"status": "healthy", "service": "Windows Print Service"}` - Log Shows: "Service is ready and listening..." #### Failed Service Start: - Service Status: STOPPED or START_PENDING - HTTP Response: Connection refused - Log Shows: Error messages with specific details ### ๐Ÿ› ๏ธ ADVANCED TROUBLESHOOTING: #### Enable Debug Logging: Edit the service script to increase logging level: ```python logging.basicConfig(level=logging.DEBUG) ``` #### Manual Service Wrapper Test: ```cmd cd C:\QualityPrintService python_embedded\python.exe service_wrapper.py ``` #### Windows Event Viewer: 1. Open Event Viewer 2. Navigate: Windows Logs โ†’ Application 3. Filter by Source: Service Control Manager 4. Look for QualityPrintService errors ### ๐Ÿ“ž SUPPORT CHECKLIST: Before reporting issues, please verify: - [ ] โœ… Python embedded is working (`python_embedded\python.exe --version`) - [ ] โœ… Service runs in standalone mode (`test_service.bat`) - [ ] โœ… Port 8765 is available (`netstat -an | findstr :8765`) - [ ] โœ… Installer was run as Administrator - [ ] โœ… Windows is Windows 10/11 or Server 2016+ - [ ] โœ… Service logs show specific error messages ### ๐ŸŽฏ EXPECTED RESULTS: After following this guide: 1. **Service Status**: RUNNING 2. **Health Check**: http://localhost:8765/health returns JSON response 3. **Chrome Extension**: Detects service and shows "Windows Service" mode 4. **Printing**: Silent PDF printing works without dialogs --- **Package Version**: Zero Dependencies Complete **Last Updated**: September 2025 **Support**: Check service logs in `%USERPROFILE%\PrintService\logs\`