Troubleshooting
Reference for the most common SWAO errors. Each entry lists the error message or symptom, the likely cause, and the steps to resolve it.
MODULE_NOT_FOUND pdfkit
Symptom: SWAO exits with Error: Cannot find module 'pdfkit' or similar native module error.
Cause: The binary's bundled native dependency (pdfkit or one of its platform-specific companions) was not correctly extracted at startup. This can happen if the binary was partially downloaded, moved to a read-only location, or if the extraction cache directory (~/.swao/cache/) is corrupted.
Fix:
# Clear the extraction cache and let SWAO re-extract on next run
rm -rf ~/.swao/cache/
# Then re-run the command that failed
swao --versionIf the error persists, re-download the binary using a fresh copy from the releases page and verify its SHA-256 checksum before installing.
EACCES permission denied
Symptom: Error: EACCES: permission denied when running swao on Linux or macOS.
Cause: The binary does not have the execute permission bit set.
Fix:
chmod +x /usr/local/bin/swao
# Or wherever the binary lives
which swao
chmod +x "$(which swao)"API key not set
Symptom: Error: ANTHROPIC_API_KEY is not set or LLM connectivity: red in swao health-check.
Cause: The Anthropic API key environment variable is missing from the current shell session.
Fix:
# Set for the current session
export ANTHROPIC_API_KEY="sk-ant-..."
# Set permanently in your shell profile
echo 'export ANTHROPIC_API_KEY="sk-ant-..."' >> ~/.zshrc
source ~/.zshrc
# Verify
swao health-checkFor CI environments, store the key as a repository secret and inject it via the workflow (see CI/CD Pipeline Integration).
WSP schema mismatch
Symptom: swao health-check reports Schema version: red; assessment fails with a schema validation error.
Cause: The workspace .swao.yml declares an older schema version than the installed binary expects, or vice versa.
Fix:
# Preview the migration
swao migrate-config --dry-run
# Apply
swao migrate-config
# Verify
swao health-checkIf you have intentionally rolled back to an older binary, ensure the binary version matches the schema version declared in .swao.yml.
Playwright not found
Symptom: Playwright: yellow in swao health-check; the dynamic pass is skipped.
Cause: Playwright and/or Chromium are not installed. The yellow status means the dynamic pass is automatically disabled -- other passes run normally.
Fix:
npx playwright install chromium
# On Linux, also install system dependencies
npx playwright install-deps chromiumAfter installation, re-run swao health-check to confirm the probe turns green.
MCP connection refused
Symptom: Claude Code (or another MCP client) reports Connection refused when trying to use SWAO tools.
Cause: The SWAO MCP server is not running.
Fix:
# Start the MCP server
swao mcp --http
# Verify it is listening
curl http://localhost:3737/healthSee MCP Server Integration for persistent server setup options.
Licence expired
Symptom: swao health-check reports Licence: red; Consultant/Enterprise features are unavailable.
Cause: The activation key has passed its expiry date.
Fix:
swao license request
# Send the token to the SWAO team to receive a renewal key
swao license activate <new-key>
swao license statusCommunity edition features remain available without a licence key.
Binary reports virus
Symptom: Windows Defender or a third-party AV product quarantines or deletes swao-enterprise-win.exe.
Cause: Heuristic false positive. Packed Node.js binaries are sometimes flagged by reputation-based AV engines.
Fix: See Windows: Allow SWAO Binary for the full allowlisting procedure. Verify the SHA-256 hash of the downloaded binary against the published sha256sums.txt before allowlisting to confirm it is not a genuine threat.
swao health-check: LLM timeout
Symptom: LLM connectivity: red or yellow with a timeout error; assessment passes hang.
Cause: The LLM provider endpoint is unreachable or slow. Common causes include a proxy misconfiguration, a firewall rule blocking outbound HTTPS, or the Anthropic/OpenAI API experiencing degraded availability.
Fix:
# Test direct connectivity
curl -v https://api.anthropic.com/v1/models \
-H "x-api-key: ${ANTHROPIC_API_KEY}" \
-H "anthropic-version: 2023-06-01"
# Temporarily bypass using --skip-llm
swao assess --app my-app --skip-llmIf your environment routes traffic via an HTTP proxy, set HTTPS_PROXY before running SWAO:
export HTTPS_PROXY="http://proxy.example.com:8080"
swao health-checkpublish: browser not found
Symptom: swao publish exits with an error about a browser not being found.
Cause: swao publish uses the system default browser (or Playwright's Chromium) to open the report gallery. If neither is configured, the command fails.
Fix:
# Option A: export the gallery to HTML instead of opening a browser
swao publish --export ./dist/gallery
# Option B: set the BROWSER environment variable
export BROWSER=/usr/bin/chromium-browser
swao publish
# Option C: install Playwright Chromium
npx playwright install chromiumpbit template fails to load
Symptom: Power BI Desktop refuses to open the .pbit template or shows a "corrupt file" error.
Cause: The .pbit template file was modified programmatically (e.g. via a zip rewrite script). Power BI's OPC packaging format does not survive generic zip round-trips.
Fix: Re-export the .pbit natively from Power BI Desktop:
- Open the
.pbixsource file in Power BI Desktop. - Select File > Export > Power BI template.
- Save the new
.pbitfile.
Do not use jszip or similar libraries to patch .pbit files. See the pbit-template-native audit gate for the rationale.
Out of memory
Symptom: SWAO process is killed with an out-of-memory error during a large assessment run.
Cause: The LLM pass processes app source files or context inputs in memory. Very large repositories or high --max-apps values can exhaust available RAM.
Fix:
# Reduce the number of apps assessed in a single run
swao assess --app my-app --max-apps 5
# Run apps sequentially instead of in parallel
swao assess --app app-one
swao assess --app app-two
# Limit Node.js heap size
NODE_OPTIONS="--max-old-space-size=4096" swao assess --app my-appIf the issue persists on a specific app, check for unusually large context import files (imports/*.csv) and reduce their size before the assessment run.
Windows: blank screen on first launch or TUI does not start
Symptom: Double-clicking swao-enterprise-win.exe in Explorer (or running it directly from a terminal) shows a blank window for several seconds, then exits -- or the TUI appears but navigation keys do not work.
Cause: swao-enterprise-win.exe is the raw pkg binary. It is designed to be called programmatically (scripts, CI pipelines, MCP configuration). It does not configure a Windows console environment suitable for the interactive TUI (Ink/React requires a proper TTY with VT100 escape-code support).
Fix: Use swao.bat -- the mandated Windows entry point for interactive terminal use. swao.bat is distributed alongside swao-enterprise-win.exe in every release. It configures the Windows console (UTF-8 code page, ANSI/VT100 mode, TTY detection) before handing control to the binary:
# Correct: use the launcher
C:\Tools\swao\swao.bat
# Also correct for scripted / non-interactive use (CI, MCP configuration)
C:\Tools\swao\swao-enterprise-win.exe mcp --help
C:\Tools\swao\swao-enterprise-win.exe assess --app my-app --skip-llm
# Incorrect for interactive TUI: bypasses console setup
C:\Tools\swao\swao-enterprise-win.exe # may show blank screenIf swao.bat is not present, download it from the same GitHub release page as the .exe binary and place it in the same directory. Do not rename either file.
Note on startup delay: The first launch after download (or after a Windows update) may show a 5-20 second blank terminal. This is normal -- it is the V8 snapshot being decompressed by the pkg runtime. Subsequent launches are faster.