Troubleshooting
Troubleshooting pages should start from symptoms and end with verification. Avoid broad speculation when a concrete command can show the state.
First Checks
Section titled “First Checks”Before diving into specific issues, run these commands to gather context:
# Verify foxctl is installed and reachablefoxctl version
# Check Go version (for building from source)go version
# Show current configurationfoxctl config showCapture stderr for debugging — structured logs (zerolog JSON) are written to stderr, while Protocol v1 envelopes go to stdout:
foxctl run fs/ls --input '{"path":"."}' 2>debug.logError Codes
Section titled “Error Codes”All foxctl errors use structured error codes in the envelope’s error.code field:
| Code | Meaning | Common Causes |
|---|---|---|
EARG | Invalid argument | Missing or malformed parameters |
ENOTFOUND | Resource not found | Skill, file, or digest doesn’t exist |
ETIMEOUT | Operation timed out | Network issues, long-running skill |
ERUNTIME | Runtime error | Skill crashed or panicked |
EENVELOPE | Envelope validation failed | Malformed JSON, missing fields |
EPARSE | Parse error | Invalid input format |
EPOLICY | Policy violation | Path traversal, network access denied |
EIO | I/O error | File access failure, CAS corruption |
EAUTH | Authentication failed | Invalid credentials |
ERATELIMIT | Rate limit exceeded | Too many API calls |
ECANCELED | Operation canceled | User cancellation, context timeout |
Installation Issues
Section titled “Installation Issues”foxctl: command not found
Section titled “foxctl: command not found”The binary is not in your PATH or is not installed.
# If built from source, add to PATHexport PATH="$PATH:/path/to/foxctl/bin"
# Or install to a standard locationsudo cp ./foxctl /usr/local/bin/
# Verifywhich foxctlfoxctl versionIf foxctl on PATH reports Command 'run' not available in bundled mode, you are running a wrapper from another install. Run ./bin/foxctl from the repo checkout instead, or rebuild with make build.
Permission denied
Section titled “Permission denied”chmod +x ./foxctlmacOS: “foxctl is damaged and can’t be opened”
Section titled “macOS: “foxctl is damaged and can’t be opened””Gatekeeper is blocking the binary.
xattr -d com.apple.quarantine ./foxctlOr build from source to avoid the issue entirely:
make buildBuild Issues
Section titled “Build Issues”go: cannot find main module
Section titled “go: cannot find main module”You are not in the repository root:
cd /path/to/foxctlmake buildundefined: some_package.SomeFunc
Section titled “undefined: some_package.SomeFunc”Missing or outdated dependencies:
go mod downloadgo mod tidymake buildBuild fails with CGO errors
Section titled “Build fails with CGO errors”foxctl requires pure Go builds. Always set CGO_ENABLED=0:
CGO_ENABLED=0 make buildDo not revive the legacy CGO/SQLite storage lane (no -tags=libsqlite3, no foxctl-cgo, no sqlite-vector). Turso is the canonical SQLite-family storage path.
golangci-lint: command not found
Section titled “golangci-lint: command not found”Install the linter:
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latestTests fail with package not found
Section titled “Tests fail with package not found”go mod downloadgo test ./...Skill Execution Issues
Section titled “Skill Execution Issues”ENOTFOUND: skill not found
Section titled “ENOTFOUND: skill not found”The skill is not installed or not in the skill path.
# List installed skillsfoxctl skills list
# Build and install all skillsmake skills-install
# Build a single skillCGO_ENABLED=0 go build -o ~/.foxctl/skills/code/symbols/bin ./skills/code_symbolsImportant: The skill loader looks for a binary named bin (or bin-cgo), not a custom name. Always use the correct output path:
# Correct — loader will find itgo build -o ~/.foxctl/skills/my/skill/bin ./skills/my_skill
# Wrong — loader won't find itgo build -o ~/.foxctl/skills/my/skill/my_skill ./skills/my_skillSkills must also be installed after building — the build step creates the binary in the source directory, but the loader searches ~/.foxctl/skills/:
# Install all skillsmake skills-installEPOLICY: path outside workspace
Section titled “EPOLICY: path outside workspace”You attempted to access a file outside the workspace boundary:
# Check current workspacefoxctl config show | grep workspace
# Use relative paths within workspacefoxctl run fs/read --input '{"path":"./src/main.go"}'ERUNTIME: skill execution failed
Section titled “ERUNTIME: skill execution failed”The skill crashed or encountered an internal error:
# Check stderr for detailsfoxctl run <skill> 2>error.logcat error.log
# Enable debug loggingexport FOXCTL_LOG_LEVEL=debugfoxctl run <skill>
# Check skill manifest for requirementsfoxctl skills describe <skill>WASI skill fails to run
Section titled “WASI skill fails to run”WASI skills run in a sandboxed environment with no network access (network: "none"). If a skill needs network access, use an exec skill instead.
Rebuild WASI skills from source:
make skills-buildETIMEOUT: skill execution timed out
Section titled “ETIMEOUT: skill execution timed out”The default timeout is 5 minutes. For long-running operations, use the jobs system:
foxctl jobs submit <skill> --args '...'foxctl jobs tail <job-id>API keys not found in skills
Section titled “API keys not found in skills”Skills must explicitly load .env files. Add config.LoadDotEnv() before any os.Getenv() calls:
import "github.com/joshka0/foxctl/internal/platform/config"
func main() { config.LoadDotEnv() // BEFORE os.Getenv() apiKey := os.Getenv("FOXCTL_EMBEDDING_API_KEY")}Job Issues
Section titled “Job Issues”Job stuck in queued state
Section titled “Job stuck in queued state”# Check job queuefoxctl jobs list --status queued
# Submit a simple test job to verify the queue is processingfoxctl jobs submit fs/ls --path .Job stuck in running after a crash
Section titled “Job stuck in running after a crash”Crash recovery may not have triggered:
# Cancel the stuck jobfoxctl jobs cancel <job-id>
# Last resort: direct database updatesqlite3 ~/.foxctl/foxctl.db "UPDATE jobs SET status='error' WHERE id='<job-id>';"Job result not found
Section titled “Job result not found”# Check job statusfoxctl jobs get <job-id>
# If it errored, check stderrfoxctl jobs get <job-id> --show-stderr
# Check if the CAS artifact still existsfoxctl cas list | grep <digest>Memory and Search Issues
Section titled “Memory and Search Issues”Memory search returns no results
Section titled “Memory search returns no results”Memory queries are scoped by workspace path. Run from the correct project directory or specify the workspace explicitly:
# Run from project directorycd /path/to/projectfoxctl memory search "auth"
# Or specify workspace in the skill inputfoxctl run memory/query --input '{"workspace": "/path/to/project"}'Semantic search returns poor results
Section titled “Semantic search returns poor results”The repo graph index may be missing, empty, or stale. Check index status before judging search quality:
foxctl index repo status --workspace /path/to/repoIf nodes_total is 0 or index_matches_head is false, rebuild the index for the repo’s languages:
foxctl index repo build --workspace /path/to/repo --go=false --typescriptEmbedding dimension mismatch
Section titled “Embedding dimension mismatch”Mixing embedding providers with different vector dimensions causes search failures. Use the same provider for storage and queries:
| Provider | Dimensions |
|---|---|
| Qwen3 Embedding 8B | 4096 |
| Qwen3 Embedding 4B | 2560 |
| Qwen3 Embedding 0.6B | 1024 |
| Gemini | 3072 |
If you switch providers, rebuild the affected vector store.
Storage Issues
Section titled “Storage Issues”CAS digest verification failed
Section titled “CAS digest verification failed”A CAS artifact may be corrupted:
# Delete the corrupted artifactfoxctl cas delete <digest> --force
# Re-run the operation to regenerate itfoxctl run <skill> --cache offCAS storage growing too large
Section titled “CAS storage growing too large”# Check total CAS usagedu -sh ~/.foxctl/cas/
# List unpinned artifactsfoxctl cas list --unpinned
# Dry-run garbage collectionfoxctl cas gc --older-than 168h --dry-run
# Run garbage collectionfoxctl cas gc --older-than 168h --confirm
# Pin important artifacts before GC to protect themfoxctl cas pin <digest>Database locking errors
Section titled “Database locking errors”SQLite has limited concurrency. If you see locking errors:
# Remove stale lock filesrm -f ~/.foxctl/foxctl.db-shm ~/.foxctl/foxctl.db-wal
# If persistent, backup and vacuumcp ~/.foxctl/foxctl.db ~/.foxctl/foxctl.db.baksqlite3 ~/.foxctl/foxctl.db "VACUUM;"Database corruption
Section titled “Database corruption”# Check integritysqlite3 ~/.foxctl/foxctl.db "PRAGMA integrity_check;"
# Restore from backup if availablecp ~/.foxctl/foxctl.db.bak ~/.foxctl/foxctl.db
# Or rebuild from scratch (loses history)rm ~/.foxctl/foxctl.dbfoxctl config initAgent Issues
Section titled “Agent Issues”Agent not responding
Section titled “Agent not responding”# Check agent statusfoxctl agent info <agent-id>
# Stream live eventsfoxctl agent watch <agent-id>
# Send a follow-up and waitfoxctl agent ask <agent-id> --question "What is your current state?" --wait --timeout 120sRoom messages stored but not visible in tmux
Section titled “Room messages stored but not visible in tmux”Check all three layers — workspace alignment, room membership, and pane delivery:
# 1. Verify the live loop is in the correct workspaceps -Ao pid=,command= | rg 'foxctl room loop'lsof -a -p <loop-pid> -d cwd
# 2. Check room membership includes the panefoxctl room show <room-id> --workspace /path/to/workspace
# 3. Read the pane directlyfoxctl mux read <pane-id> --lines 120For tmux-backed room relay, pane_id is the actual delivery target. actor_id is for room semantics and matching.
Platform-Specific Issues
Section titled “Platform-Specific Issues”Linux: setrlimit: operation not permitted
Section titled “Linux: setrlimit: operation not permitted”foxctl sets resource limits for safety. Run as a regular user (not root):
# Check current ulimitsulimit -aWindows: Path separator errors
Section titled “Windows: Path separator errors”Use forward slashes in foxctl inputs, even on Windows:
foxctl run fs/read --input '{"path":"./src/main.go"}'.env file not loading in sandboxed environments
Section titled “.env file not loading in sandboxed environments”If ~/.foxctl/.env is a symlink to the repo’s .env and the repo path doesn’t exist in the sandbox, the symlink breaks. Use a real file:
make env-sync # Copies repo .env → ~/.foxctl/.env
# Verify it's a real file (not a symlink)ls -la ~/.foxctl/.envThe .env loader checks these locations in order:
~/.foxctl/.env(global defaults)$FOXCTL_HOME/.env(if set)$PWD/.env(project overrides)
Debugging Techniques
Section titled “Debugging Techniques”Enable debug logging
Section titled “Enable debug logging”export FOXCTL_LOG_LEVEL=debugfoxctl run <skill> 2>debug.logInspect envelopes
Section titled “Inspect envelopes”# Pretty-print the JSON envelopefoxctl run fs/ls --input '{"path":"."}' | jq .
# Check specific fieldsfoxctl run fs/ls --input '{"path":"."}' | jq '.meta'Test with minimal skills
Section titled “Test with minimal skills”# These exercise core functionality without skill-specific logicfoxctl run fs/ls --input '{"path":"."}'
# If these fail, the issue is in core — not in a specific skillReset to clean state
Section titled “Reset to clean state”# Backup firstcp -r ~/.foxctl ~/.foxctl.bak
# Remove all staterm -rf ~/.foxctl/
# Reinitializefoxctl config initfoxctl skills list # Should be emptyCommon Pitfalls
Section titled “Common Pitfalls”| Pitfall | Solution |
|---|---|
| Running from wrong directory | Run from repository root or specify workspace paths |
| Skills not found after build | Run make skills-install to install to ~/.foxctl/skills/ |
| Stale cache returning old results | Use --cache off to bypass cache |
| Secrets in command history | Use environment variables, not CLI arguments |
| Expecting network from WASI skills | WASI enforces network: "none" — use exec skills for network access |
| Wrong foxctl binary on PATH | Use ./bin/foxctl from the repo checkout |
| Observability not working | Use absolute paths in FOXCTL_OBS_DIR, not ~ shorthand |
Getting Help
Section titled “Getting Help”Before reporting an issue:
- Check this troubleshooting guide and Gotchas
- Enable debug logging:
export FOXCTL_LOG_LEVEL=debug - Try a minimal reproduction — simplify to the smallest failing case
- Check if it worked before — what changed?
When opening an issue, include:
# System infouname -ago versionfoxctl version
# Reproduction with debug outputfoxctl run <skill> --input '{}' 2>error.logcat error.log