Skip to content

Commit d35c397

Browse files
committed
Fix Python syntax error and add service recovery guide
1. Fixed f-string syntax error in api_import.py line 1036-1038 - Extracted backslash replacements to variables before f-string - This prevented the app from starting due to SyntaxError 2. Created FIX_MISSING_SERVICES.md guide to help users: - Diagnose and fix services with missing file paths - Options for deleting, reimporting, or fixing broken services - Instructions for GitHub import and auto-discovery https://claude.ai/code/session_01TxioM4AYTvC4DymoDyFZzC
1 parent 525e936 commit d35c397

File tree

2 files changed

+121
-2
lines changed

2 files changed

+121
-2
lines changed

FIX_MISSING_SERVICES.md

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
# Fix Missing Service Files
2+
3+
## Problem
4+
Your dashboard shows 7 services that can't start because their files/directories don't exist:
5+
6+
1. Forensic_CPA_AI (port 5000)
7+
2. Pearson_Nexus_AI_NEW-main (port 3040)
8+
3. ai-financial-advisor (port 3009)
9+
4. pearson-nexus-ai-monorepo (port 3030)
10+
5. prototype (port 3003)
11+
6. rest-express (port 3012)
12+
7. retail-commission-tracker (port 3050)
13+
14+
## Solution Options
15+
16+
### Option 1: Delete All Broken Services and Start Fresh
17+
18+
**Via Dashboard UI:**
19+
1. Go to http://localhost:5010/services
20+
2. Click on each service
21+
3. Click "Delete" button on each service
22+
4. Then import fresh bundles or use auto-discovery
23+
24+
**Via API (if you have curl):**
25+
```bash
26+
# Get service IDs
27+
curl http://localhost:5010/api/services
28+
29+
# Delete each service by ID
30+
curl -X DELETE http://localhost:5010/api/services/1
31+
curl -X DELETE http://localhost:5010/api/services/2
32+
# ... repeat for all services
33+
```
34+
35+
### Option 2: Clone/Download Missing Repositories
36+
37+
If you have the repositories on GitHub or elsewhere:
38+
39+
```bash
40+
# Create a repositories folder
41+
mkdir -p ~/repositories
42+
43+
# Clone your projects
44+
cd ~/repositories
45+
git clone https://github.com/YOUR_USERNAME/Forensic_CPA_AI.git
46+
git clone https://github.com/YOUR_USERNAME/Pearson_Nexus_AI_NEW-main.git
47+
git clone https://github.com/YOUR_USERNAME/ai-financial-advisor.git
48+
git clone https://github.com/YOUR_USERNAME/pearson-nexus-ai-monorepo.git
49+
git clone https://github.com/YOUR_USERNAME/prototype.git
50+
git clone https://github.com/YOUR_USERNAME/rest-express.git
51+
git clone https://github.com/YOUR_USERNAME/retail-commission-tracker.git
52+
53+
# Then use auto-discovery to re-import them
54+
# Go to: http://localhost:5010/import
55+
# Use "Import from folder" with path: /home/user/repositories
56+
```
57+
58+
### Option 3: Use GitHub Import Feature
59+
60+
If you have a GitHub token:
61+
62+
1. Go to http://localhost:5010/import
63+
2. Click "Connect GitHub (mobile)" to authenticate
64+
3. Click "Load my repos" to see all your repositories
65+
4. Select each repository and import it
66+
5. The system will clone them locally and register them
67+
68+
### Option 4: Import from Bundles
69+
70+
If you have `.json` bundle files:
71+
72+
1. Go to http://localhost:5010/import
73+
2. Drag and drop the `.json` bundle files
74+
3. Or use "Import bundle" and paste the JSON
75+
76+
## Recommended Approach
77+
78+
**For best results:**
79+
80+
1. **Delete all broken services** (Option 1)
81+
2. **Connect GitHub** and use auto-import (Option 3), OR
82+
3. **Clone repos manually** then use auto-discovery (Option 2)
83+
84+
## Quick Commands
85+
86+
```bash
87+
# Check what directories you have
88+
ls -la ~/repositories 2>/dev/null || echo "No repositories folder"
89+
ls -la ~/Documents 2>/dev/null || echo "No Documents folder"
90+
ls -la ~ | grep -i pearson
91+
ls -la ~ | grep -i forensic
92+
93+
# Create a workspace for your projects
94+
mkdir -p ~/repositories
95+
cd ~/repositories
96+
97+
# After cloning/downloading projects, verify they exist
98+
ls -la ~/repositories
99+
```
100+
101+
## Need Help?
102+
103+
If you're not sure which option to choose, answer these questions:
104+
105+
1. **Do you have GitHub repos for these projects?** → Use Option 3
106+
2. **Do you have the code on another computer?** → Copy it over, then use Option 2
107+
3. **Do you have .json bundle files?** → Use Option 4
108+
4. **Starting completely fresh?** → Use Option 1, then import as needed
109+
110+
## Next Steps
111+
112+
After fixing the services:
113+
114+
1. Verify paths are correct: http://localhost:5010/services
115+
2. Install dependencies for each service (npm install, pip install, etc.)
116+
3. Start services from the dashboard
117+
4. Check for port conflicts and resolve them

local_nexus_controller/routers/api_import.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,9 +1033,11 @@ def github_localize_pr(req: GitHubLocalizePrRequest) -> dict:
10331033
if not str(svc.get("working_directory") or "").strip():
10341034
svc["working_directory"] = "{REPO_ROOT}"
10351035
if not str(svc.get("start_command") or "").strip():
1036-
svc["start_command"] = f"powershell -ExecutionPolicy Bypass -File {start_ps1_path.replace('/', '\\\\')}"
1036+
start_ps1_win = start_ps1_path.replace('/', '\\')
1037+
svc["start_command"] = f"powershell -ExecutionPolicy Bypass -File {start_ps1_win}"
10371038
if not str(svc.get("stop_command") or "").strip():
1038-
svc["stop_command"] = f"powershell -ExecutionPolicy Bypass -File {stop_ps1_path.replace('/', '\\\\')}"
1039+
stop_ps1_win = stop_ps1_path.replace('/', '\\')
1040+
svc["stop_command"] = f"powershell -ExecutionPolicy Bypass -File {stop_ps1_win}"
10391041

10401042
tech = svc.get("tech_stack")
10411043
if not isinstance(tech, list):

0 commit comments

Comments
 (0)