Skip to content

Commit d266c93

Browse files
committed
docs: resolve all code review feedback (security, safety, formatting)
1 parent 114508e commit d266c93

File tree

1 file changed

+54
-26
lines changed

1 file changed

+54
-26
lines changed

docs/TROUBLESHOOTING.md

Lines changed: 54 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Common errors and solutions for Cortex Linux.
2020
### Error: "No API key found"
2121

2222
**Symptom:**
23-
```
23+
```text
2424
Error: No API key found. Set ANTHROPIC_API_KEY or OPENAI_API_KEY environment variable.
2525
```
2626

@@ -29,15 +29,15 @@ Error: No API key found. Set ANTHROPIC_API_KEY or OPENAI_API_KEY environment var
2929
1. **Set the environment variable:**
3030
```bash
3131
# For Claude (recommended)
32-
export ANTHROPIC_API_KEY='sk-ant-api03-your-key-here'
32+
export ANTHROPIC_API_KEY='<YOUR_ANTHROPIC_API_KEY>'
3333

3434
# For OpenAI
35-
export OPENAI_API_KEY='sk-your-key-here'
35+
export OPENAI_API_KEY='<YOUR_OPENAI_API_KEY>'
3636
```
3737

3838
2. **Add to shell config for persistence:**
3939
```bash
40-
echo 'export ANTHROPIC_API_KEY="sk-ant-api03-your-key"' >> ~/.bashrc
40+
echo 'export ANTHROPIC_API_KEY="<YOUR_ANTHROPIC_API_KEY>"' >> ~/.bashrc
4141
source ~/.bashrc
4242
```
4343

@@ -46,7 +46,8 @@ source ~/.bashrc
4646
cortex wizard
4747
```
4848

49-
4. **For offline mode (no API key needed):**
49+
4. **For Local Provider mode (No API key needed):**
50+
*Note: Installation of tools like Docker may still require an internet connection.*
5051
```bash
5152
export CORTEX_PROVIDER=ollama
5253
cortex install docker
@@ -55,7 +56,7 @@ cortex install docker
5556
### Error: "API rate limit exceeded"
5657

5758
**Symptom:**
58-
```
59+
```text
5960
Error: Rate limit exceeded. Please wait before trying again.
6061
```
6162

@@ -70,14 +71,14 @@ sleep 60 && cortex install docker
7071
export CORTEX_PROVIDER=ollama
7172
```
7273

73-
-----
74+
---
7475

7576
## Installation Errors
7677

7778
### Error: "Package not found"
7879

7980
**Symptom:**
80-
```
81+
```text
8182
E: Unable to locate package xyz
8283
```
8384

@@ -107,10 +108,11 @@ sudo apt --fix-broken install
107108
sudo apt update && sudo apt upgrade
108109
```
109110

111+
110112
### Error: "dpkg lock"
111113

112114
**Symptom:**
113-
```
115+
```text
114116
E: Could not get lock /var/lib/dpkg/lock-frontend
115117
```
116118

@@ -121,18 +123,26 @@ E: Could not get lock /var/lib/dpkg/lock-frontend
121123
sudo lsof /var/lib/dpkg/lock-frontend
122124
```
123125

124-
2. **Kill stuck apt process (use with caution):**
126+
2. **If it's genuinely stuck, stop the specific process (use with caution):**
125127
```bash
126-
sudo killall apt apt-get
128+
# Check for apt, apt-get, or unattended-upgrades
129+
ps aux | egrep 'apt|apt-get|unattended' | egrep -v egrep
130+
131+
# Then (only if needed) kill the specific PID (replace <PID>):
132+
sudo kill <PID>
133+
134+
# Recovery: Run these if the package manager breaks after killing the process
135+
sudo dpkg --configure -a
136+
sudo apt --fix-broken install
127137
```
128-
-----
138+
---
129139

130140
## Network & Connectivity
131141

132142
### Error: "Could not resolve host"
133143

134144
**Symptom:**
135-
```
145+
```text
136146
Could not resolve 'archive.ubuntu.com'
137147
```
138148

@@ -143,11 +153,17 @@ Could not resolve 'archive.ubuntu.com'
143153
ping -c 3 8.8.8.8
144154
```
145155

146-
2. **Try different DNS (Safe Method):**
156+
2. **Try different DNS (Temporary):**
157+
*Note: `/etc/resolv.conf` is often overwritten. Use `resolvectl` for permanent changes.*
147158
```bash
159+
# Append Google DNS
148160
echo "nameserver 8.8.8.8" | sudo tee -a /etc/resolv.conf
161+
162+
# Rollback (Undo): Edit the file and remove the line
163+
sudo nano /etc/resolv.conf
149164
```
150165

166+
151167
### Error: "SSL certificate problem"
152168

153169
**Solutions:**
@@ -163,7 +179,7 @@ sudo update-ca-certificates
163179
timedatectl status
164180
sudo timedatectl set-ntp true
165181
```
166-
-----
182+
---
167183

168184
## Permission Problems
169185

@@ -181,33 +197,44 @@ sudo cortex install docker --execute
181197
ls -la ~/.cortex/
182198
```
183199

184-
-----
200+
---
185201

186202
## LLM Provider Issues
187203

188204
### Error: "Ollama not running"
189205

190206
**Symptom:**
191-
```
207+
```text
192208
Error: Could not connect to Ollama at localhost:11434
193-
```
209+
````
194210
195211
**Solutions:**
196212
197-
1. **Start Ollama:**
213+
1. **Start System Service (Recommended):**
214+
215+
```bash
216+
sudo systemctl start ollama
217+
```
218+
219+
2. **Manual Start (Fallback):**
220+
*Note: Only use this if the system service is unavailable.*
221+
198222
```bash
199-
ollama serve &
223+
ollama serve
200224
```
201225

202-
2. **Install Ollama if missing:**
226+
3. **Install Ollama if missing:**
227+
*Note: Always review remote scripts before running them.*
228+
203229
```bash
204230
curl -fsSL https://ollama.com/install.sh | sh
205231
```
206232

207233
### Error: "Context length exceeded"
208234

209235
**Symptom:**
210-
```
236+
237+
```text
211238
Error: This model's maximum context length is 4096 tokens
212239
```
213240

@@ -218,17 +245,18 @@ Error: This model's maximum context length is 4096 tokens
218245

219246
2. **Change Provider:**
220247
Switch to a provider that supports larger context windows (e.g., Anthropic) using the wizard:
248+
221249
```bash
222250
cortex wizard
223251
```
224-
-----
252+
---
225253

226254
## Package Manager Conflicts
227255

228256
### Error: "Snap vs apt conflict"
229257

230258
**Symptom:**
231-
```
259+
```text
232260
error: cannot install "firefox": classic confinement requires snaps
233261
```
234262

@@ -238,7 +266,7 @@ error: cannot install "firefox": classic confinement requires snaps
238266
```bash
239267
sudo snap install firefox --classic
240268
```
241-
-----
269+
---
242270

243271
## Performance Issues
244272

@@ -255,7 +283,7 @@ export CORTEX_PROVIDER=ollama
255283
```bash
256284
ping api.anthropic.com
257285
```
258-
-----
286+
---
259287

260288
## Rollback & Recovery
261289

0 commit comments

Comments
 (0)