Runtime Troubleshooting
Solving runtime and execution problems.
Execution Errors
Command Fails to Execute
Problem: Command runs but fails
Debugging:
# Linux/macOS - Use debug logging
RUST_LOG=debug nia command
# Windows PowerShell - Use debug logging
$env:RUST_LOG="debug"; nia command
# Check what was received
nia issue plan
Stub Commands
Current Implementation: Commands print context
Expected Output:
Command: plan
Subcommand: task
Operation: create
Options: edit=true
Future: Will integrate with AI coding agents
Help System Issues
Help Not Displaying
Problem: --help doesn’t show information
Solutions:
- Check help flag syntax:
--helpnot-help - Try at different levels:
nia --help nia issue --help nia issue plan --help - Check configuration defines help properly
Custom Help Files Not Loading
Problem: Custom help not showing
Checks:
# Verify file exists
ls configs/help/mycommand.md
# Check configuration
cat .nia/config.toml | grep help_file
# Validate references
nia config validate
Documentation Issues
nia docs Fails
Problem: Documentation command doesn’t work
Possible Causes:
- mdBook not built
- Browser not found
- Temp directory issues
Solutions:
# Rebuild documentation
mdbook build
# Check if docs exist
ls user-docs/book/index.html
# Open manually
firefox user-docs/book/index.html
Documentation Not Updated
Problem: Changes don’t appear in docs
Solution: Rebuild:
# Clean and rebuild
rm -rf user-docs/book
mdbook build
# Or use watch mode during development
mdbook serve
Performance Problems
Slow Command Execution
Problem: Commands take long to execute
Possible Causes:
- Large configuration
- Slow file I/O
- Many commands defined
Debugging:
# Time the command
time nia config validate
# Check config size
wc -l .nia/config.toml
# Simplify configuration
Slow Validation
Problem: nia config validate is slow
Solutions:
- Reduce config complexity
- Remove unused commands
- Check file system performance
Permission Problems
Can’t Access Files
Problem: Permission denied errors
Solutions:
# Fix file permissions
chmod 644 .nia/config.toml
# Fix directory permissions
chmod 755 .nia
# Check ownership
ls -la .nia/
Can’t Write Logs
Problem: Can’t create log files
Solutions:
# Check logs directory
mkdir -p logs
chmod 755 logs
# Check permissions
ls -la logs/
Environment Issues
Different Behavior in Different Shells
Problem: Commands work differently in bash vs zsh
Possible Causes:
- Path differences
- Environment variables
- Shell aliases
Debugging:
# Check PATH
echo $PATH
# Check which nia
which nia
# Try with full path
/usr/local/bin/nia --help
CI/CD Pipeline Failures
Problem: Commands work locally but fail in CI
Common Issues:
- Missing binary in PATH
- Configuration not committed
- Different user permissions
Solutions:
# In CI pipeline
export PATH=$PATH:/path/to/nia
nia config validate
Error Recovery
General Debugging Approach
-
Read Error Message:
- Note error code
- Check line numbers
- Read suggestions
-
Enable Debug Logging:
# Linux/macOS RUST_LOG=debug nia command # Windows PowerShell $env:RUST_LOG="debug"; nia command -
Validate Configuration:
nia config validate -
Check Help:
nia command --help -
Simplify:
- Remove complexity
- Test minimal case
- Add back gradually
When Nothing Works
- Start with fresh configuration
- Use default commands only
- Add custom commands one at a time
- Test after each change
Platform-Specific Issues
Linux
Common Issues:
- Permission denied: Use
chmod +x - Command not found: Add to PATH
macOS
Common Issues:
- Gatekeeper blocking:
xattr -d com.apple.quarantine nia - Permission issues: Check Security & Privacy settings
Windows
Common Issues:
- Path separator: Use
/not\in configs - Execution policy: May need to allow binary execution
- Line endings: Ensure TOML files use LF not CRLF
Secret Masking Issues
Secret Visible in Trace Files
Problem: Sensitive data appears in .nia/work/job_*/traces/ files
Solutions:
-
Check pattern coverage:
# View loaded patterns RUST_LOG=debug nia ask "test" 2>&1 | grep "patterns" -
Add custom pattern: Create or edit
.nia/config/.gitleaks.toml:[[rules]] id = "custom-secret" description = "My custom secret format" regex = '''YOUR_SECRET_PATTERN_HERE''' keywords = ["keyword"] -
Verify config location: Ensure
.gitleaks.tomlis in.nia/config/(not project root)
Over-Redaction (Legitimate Data Masked)
Problem: Non-secret values being replaced with ***REDACTED***
Solutions:
-
Add to allowlist:
[allowlist] regexes = [ '''pattern_to_allow''', ] stopwords = ["test", "example", "mock"] -
Use more specific patterns: Replace broad patterns with targeted ones that include context
📖 See: Secret Masking Documentation for full configuration guide
Getting Help
If problems persist:
- Review common issues: Common Problems
- Validate configuration: Config Troubleshooting
- Use
RUST_LOG=debugfor agent diagnostics, or runnia status --verbosefor configuration diagnostics - Simplify to minimal test case