Skip to content

Latest commit

 

History

History
319 lines (241 loc) · 7.58 KB

File metadata and controls

319 lines (241 loc) · 7.58 KB

Auto-Start Status - ENABLED

Current Configuration

Your auto-start is ALREADY ENABLED in .env:

LOCAL_NEXUS_AUTO_START_ALL_ON_BOOT=true

This means:

  • ✅ Services automatically start when controller starts
  • ✅ No manual clicking required
  • ✅ Works on every reboot if you've set up Windows auto-start

What Happens When You Start the Controller

When you run start.bat or npm run dev:

  1. Controller starts - Web server launches on port 5010
  2. Auto-start kicks in - Scans database for services
  3. Services launch - All services with start_command get started
  4. Dashboard opens - Browser opens to http://localhost:5010
  5. You see status - Green "Running" badges for started services

You'll see this in the terminal:

============================================================
Auto-starting 3 service(s)
============================================================
  Starting: My API Service... ✓ Started
  Starting: My Web App... ✓ Started
  Starting: Background Worker... ✓ Started
============================================================
Auto-start complete
============================================================

If You're Still Seeing Errors

Scenario 1: "No services to auto-start"

What you see:

No services to auto-start (all services already running or no start commands defined)

Why:

  • You haven't added any services yet
  • Services don't have start_command defined
  • All services are already running

Fix:

  1. Open dashboard: http://localhost:5010
  2. Go to: Services
  3. Add services or check existing ones have start commands

Scenario 2: "✗ Error: ..." for specific service

What you see:

  Starting: My Service... ✗ Error: [Errno 2] No such file or directory

Why:

  • Service has wrong working directory
  • Dependencies not installed
  • Command not found (missing Python, Node, etc.)

Fix:

  1. Open dashboard: http://localhost:5010
  2. Click the service name
  3. Check "Last Error" field
  4. Fix the issue (see AUTO_START_TROUBLESHOOTING.md)
  5. Restart controller

Scenario 3: Service shows "Stopped" in dashboard

What you see:

  • Service exists in dashboard
  • Status shows "Stopped" (gray)
  • Never auto-started

Why:

  • Service has no start_command defined

Fix:

  1. Click the service name
  2. Add a start_command like:
    python app.py
    npm start
    node server.js
    
  3. Save
  4. Restart controller (auto-start will pick it up)

Quick Diagnostic

Check Configuration

Double-click: CHECK_AUTO_START.bat

This shows:

  • Auto-start enabled/disabled
  • Port and host settings
  • Database status
  • Next steps

Check Service Logs

Via Dashboard:

  1. Go to http://localhost:5010
  2. Click "Services"
  3. Click a service name
  4. Scroll down to "Logs" section

Via File System:

Open: data/logs/

Each service has its own log file showing:

  • Startup output
  • Runtime logs
  • Error messages

How To Test Auto-Start

Test 1: Restart Controller

  1. Close controller window (or Ctrl+C)
  2. Run: start.bat
  3. Watch terminal for auto-start messages
  4. Check dashboard for green "Running" statuses

Test 2: Add New Service

  1. Go to http://localhost:5010
  2. Click "Services" → "New Service"
  3. Fill in:
    • Name: Test Service
    • Start Command: python -m http.server 8888
    • Working Directory: C:\Users\nedpe
    • Port: 8888
  4. Click "Create Service"
  5. Restart controller
  6. Should auto-start on next launch

Test 3: Check Process Manager

  1. Press Ctrl+Shift+Esc (Task Manager)
  2. Look for processes:
    • python.exe (for Python services)
    • node.exe (for Node services)
    • Other runtimes
  3. Count should match number of running services

Windows Auto-Start vs Service Auto-Start

These are TWO DIFFERENT features:

Windows Auto-Start

What: Starts the controller itself when Windows boots

Configured by:

  • Double-click: tools\ENABLE_AUTO_START.bat
  • Creates Windows Task Scheduler task
  • Runs controller on login

Status: Check Task Scheduler for "Local Nexus Controller" task

Service Auto-Start

What: Starts services when controller starts

Configured by:

  • .env file: LOCAL_NEXUS_AUTO_START_ALL_ON_BOOT=true
  • Already enabled in your setup!

Status: Check .env or run CHECK_AUTO_START.bat

Complete Auto-Start Setup

For full automation (services start on Windows boot):

  1. ✅ Enable service auto-start (already done!)

    LOCAL_NEXUS_AUTO_START_ALL_ON_BOOT=true
  2. Enable Windows auto-start

    • Double-click: tools\ENABLE_AUTO_START.bat
    • Click "Yes" for admin access
  3. Result:

    • Windows boots
    • Controller starts automatically
    • Services start automatically
    • Everything running, no manual steps!

Troubleshooting Flow

Start controller
     ↓
Does terminal show "Auto-starting X service(s)"?
     ↓ YES                           ↓ NO
     ↓                               ↓
Any "✗ Error" messages?      Check .env file
     ↓ YES        ↓ NO       LOCAL_NEXUS_AUTO_START_ALL_ON_BOOT=true?
     ↓            ↓                  ↓ NO
     ↓            ↓                  └→ Enable it, restart
     ↓            ↓
Read error    Check dashboard   ↓ YES
     ↓         Services page     ↓
     ↓         Look for green    Do services have start_command?
     ↓         "Running" status       ↓ NO
     ↓                                └→ Add start commands
     ↓                            ↓ YES
Fix issue                        └→ Check service logs
     ↓
Restart controller

Common Patterns

Pattern 1: Everything Works

Terminal shows: "Auto-starting 5 service(s)"
Terminal shows: "✓ Started" for each service
Dashboard shows: Green "Running" badges

Action: Nothing! You're good to go.

Pattern 2: Some Services Fail

Terminal shows: "Auto-starting 5 service(s)"
Terminal shows: "✓ Started" for 3 services
Terminal shows: "✗ Error" for 2 services
Dashboard shows: Mix of green and red statuses

Action: Fix the 2 failing services (check logs, fix issues)

Pattern 3: No Auto-Start

Terminal shows: "No services to auto-start..."
Dashboard shows: All services stopped

Action:

  • Add services if none exist
  • Add start_command to existing services
  • Check .env has auto-start enabled

Next Steps

  1. Verify auto-start is working:

    start.bat

    Look for "Auto-starting X service(s)" in terminal

  2. Check dashboard: http://localhost:5010 → Services

  3. If errors:

    • Read error messages in terminal
    • Check service logs
    • See AUTO_START_TROUBLESHOOTING.md
  4. Enable full automation:

    • Double-click: tools\ENABLE_AUTO_START.bat
    • Restart computer to test

Files Created

  • AUTO_START_TROUBLESHOOTING.md - Complete troubleshooting guide
  • AUTO_START_STATUS.md - This file
  • CHECK_AUTO_START.bat - Quick diagnostic tool

All ready to help you get services starting automatically!


Summary

Feature Status How To Configure
Service Auto-Start ENABLED Already set in .env
Windows Auto-Start ⚠️ Check Run tools\ENABLE_AUTO_START.bat
Auto-Discovery ENABLED Already set in .env
File Watcher ENABLED Already set in .env

Your controller is fully configured for auto-starting services. If services aren't starting, it's likely:

  • Missing start commands on services
  • Errors during startup (check logs)
  • Dependencies not installed

Run CHECK_AUTO_START.bat for a quick diagnostic!