Troubleshooting
Common issues and quick fixes.
Installation Issues
Section titled “Installation Issues””Command not found: coderaft”
Section titled “”Command not found: coderaft””Problem: After installation, coderaft command is not recognized.
Solutions:
# Check if coderaft is in PATHwhich coderaft
# Add to PATH if neededexport PATH="/usr/local/bin:$PATH"
# Make permanent (add to ~/.bashrc or ~/.zshrc)echo 'export PATH="/usr/local/bin:$PATH"' >> ~/.bashrcsource ~/.bashrc
# Verify installationcoderaft --help“Docker is not installed or not running”
Section titled ““Docker is not installed or not running””Problem: Coderaft can’t connect to Docker daemon.
Solutions:
# Check Docker statussudo systemctl status docker
# Start Docker if stoppedsudo systemctl start dockersudo systemctl enable docker
# Check if user is in docker groupgroups $USER
# Add user to docker groupsudo usermod -aG docker $USER# Note: You must log out and back in for this to take effect
# Test Docker accessdocker ps“Permission denied while trying to connect to Docker”
Section titled ““Permission denied while trying to connect to Docker””Problem: User doesn’t have permission to access Docker socket.
Solutions:
# Add user to docker groupsudo usermod -aG docker $USER
# Restart terminal session or logout/login
# Alternatively, run with sudo (not recommended)sudo coderaft init myprojectIsland Issues
Section titled “Island Issues””Island not found” or “No such Island”
Section titled “”Island not found” or “No such Island””Problem: Island was manually deleted or doesn’t exist.
Solutions:
# Check what Islands existdocker ps -a --filter "name=coderaft_"
# List coderaft projectscoderaft list
# Recreate missing Islandcoderaft destroy myproject # Clean up trackingcoderaft init myproject # Recreate
# Or force recreatecoderaft init myproject --force“Island won’t start”
Section titled ““Island won’t start””Problem: Island fails to start or immediately exits.
Diagnosis:
# Check Island statusdocker ps -a --filter "name=coderaft_myproject"
# Check Island logsdocker logs coderaft_myproject
# Inspect Island configurationdocker inspect coderaft_myprojectSolutions:
# Try restarting Islanddocker start coderaft_myproject
# If still fails, recreate Islandcoderaft destroy myprojectcoderaft init myproject
# Check Docker daemonsudo systemctl restart docker“Island stops immediately after starting”
Section titled ““Island stops immediately after starting””Problem: Island keeps exiting instead of staying running.
Solutions:
# Check what command Island is runningdocker inspect coderaft_myproject | grep -A 5 '"Cmd"'
# Island should run 'sleep infinity'# If not, recreate:coderaft destroy myprojectcoderaft init myproject
# Check for resource constraintsdocker stats --no-streamFile Access Issues
Section titled “File Access Issues””Files not showing up in Island”
Section titled “”Files not showing up in Island””Problem: Files created on host don’t appear in /workspace/ inside Island.
Diagnosis:
# Check mount pointdocker inspect coderaft_myproject | grep -A 10 '"Mounts"'
# Should show: ~/coderaft/myproject -> /workspaceSolutions:
# Verify workspace directory existsls -la ~/coderaft/myproject/
# Create file on host and check in Islandecho "test" > ~/coderaft/myproject/test.txtcoderaft run myproject cat /workspace/test.txt
# If mount is wrong, recreate Islandcoderaft destroy myprojectcoderaft init myproject“Permission denied accessing files”
Section titled ““Permission denied accessing files””Problem: Can’t read/write files in Island workspace.
Solutions:
# Check file permissionsls -la ~/coderaft/myproject/
# Fix ownership if neededsudo chown -R $USER:$USER ~/coderaft/myproject/
# Check Island usercoderaft run myproject whoamicoderaft run myproject id
# If running as different user, use sudo inside Islandcoderaft run myproject "sudo chown -R root:root /workspace/"Network and Port Issues
Section titled “Network and Port Issues””Port already in use”
Section titled “”Port already in use””Problem: Can’t bind to port specified in configuration.
Solutions:
# Check what's using the portsudo netstat -tlnp | grep :5000# orsudo ss -tlnp | grep :5000
# Kill process using portsudo kill -9 <PID>
# Or use different port in coderaft.json# Change "5000:5000" to "5001:5000"
# Recreate Island with new configcoderaft destroy myprojectcoderaft init myproject“Can’t access web application from host”
Section titled ““Can’t access web application from host””Problem: Web app running in Island but not accessible from host.
Solutions:
# Ensure app binds to 0.0.0.0, not localhost# In your app: app.run(host='0.0.0.0', port=5000)
# Check port mapping in Islanddocker port coderaft_myproject
# Verify ports in coderaft.jsoncat ~/coderaft/myproject/coderaft.json
# Test from inside Islandcoderaft run myproject "curl http://localhost:5000"
# Test from hostcurl http://localhost:5000Configuration Issues
Section titled “Configuration Issues””Invalid JSON in coderaft.json”
Section titled “”Invalid JSON in coderaft.json””Problem: Configuration file has syntax errors.
Solutions:
# Validate JSON syntaxcat ~/coderaft/myproject/coderaft.json | python3 -m json.tool
# Or use coderaft validationcoderaft config validate myproject
# Fix common JSON errors:# - Missing commas between elements# - Trailing commas# - Unquoted strings# - Mismatched brackets/braces“Setup commands fail during initialization”
Section titled ““Setup commands fail during initialization””Problem: Commands in setup_commands array fail.
Diagnosis:
# Check Island logs during initdocker logs coderaft_myproject
# Test commands manuallycoderaft shell myproject# Run each setup command individuallySolutions:
# Common fixes:# 1. Add 'apt update' before package installs (though coderaft does this automatically)# 2. Use full package names# 3. Add '-y' flag to apt commands# 4. Check command syntax
# Example working setup_commands:{ "setup_commands": [ "apt install -y python3-pip nodejs npm", "pip3 install flask requests", "npm install -g typescript" ]}
# Test commands step by stepcoderaft shell myprojectapt install -y python3-pip # Should workpip3 install flask # Should workPerformance Issues
Section titled “Performance Issues””Island startup is slow”
Section titled “”Island startup is slow””Problem: Takes a long time to start Islands or run commands.
Solutions:
# Check Docker performancedocker system dfdocker system prune # Clean up unused resources
# Monitor during startuptime coderaft shell myproject
# Check system resourcesdocker stats --no-streamtop“High disk usage”
Section titled ““High disk usage””Problem: Docker/coderaft using too much disk space.
Solutions:
# Check disk usagecoderaft cleanup --dry-run --alldocker system df -v
# Clean up unused resourcescoderaft cleanup --alldocker system prune -a
# Check individual Islandsdocker exec coderaft_myproject du -sh /var/cache/aptcoderaft run myproject "apt autoclean"Recovery Procedures
Section titled “Recovery Procedures””Complete reset of coderaft”
Section titled “”Complete reset of coderaft””If everything is broken, start fresh:
# Stop all coderaft Islandsdocker stop $(docker ps -q --filter "name=coderaft_")
# Remove all coderaft Islandsdocker rm $(docker ps -aq --filter "name=coderaft_")
# Clean up Docker resourcesdocker system prune -a
# Remove coderaft configurationrm -rf ~/.coderaft/
# Keep or remove project files (your choice)# rm -rf ~/coderaft/ # This deletes your code!
# Reinstall coderaft if neededcurl -fsSL https://raw.githubusercontent.com/itzcozi/coderaft/main/install.sh | bash“Recover project after Island deletion”
Section titled ““Recover project after Island deletion””If Island was deleted but files remain:
# Check if files existls ~/coderaft/myproject/
# Recreate Islandcoderaft init myproject
# If you had custom configuration# Edit ~/coderaft/myproject/coderaft.json# Then recreate:coderaft destroy myprojectcoderaft init myproject“Fix corrupted configuration”
Section titled ““Fix corrupted configuration””If global configuration is corrupted:
# Backup existing configcp ~/.coderaft/config.json ~/.coderaft/config.json.backup
# Reset configurationrm ~/.coderaft/config.json
# Recreate projectscoderaft init project1coderaft init project2# etc.Getting Help
Section titled “Getting Help”Debug Information
Section titled “Debug Information”When reporting issues, include:
# System informationuname -acat /etc/os-release
# Docker informationdocker --versiondocker info
# Coderaft informationcoderaft --versioncoderaft list --verbose
# Island information (if applicable)docker logs coderaft_myprojectdocker inspect coderaft_myproject
# Configurationcat ~/.coderaft/config.jsoncat ~/coderaft/myproject/coderaft.jsonLog Files
Section titled “Log Files”Useful log locations:
- Docker daemon:
journalctl -u docker.service - Island logs:
docker logs coderaft_<project> - System messages:
/var/log/syslog
Common Commands for Diagnosis
Section titled “Common Commands for Diagnosis”# Check Docker daemonsudo systemctl status docker
# List all Islandsdocker ps -a
# Check Docker disk usagedocker system df
# Test Docker functionalitydocker run hello-world
# Check coderaft projectscoderaft listcoderaft maintenance --health-check
# Check system resourcesdf -hfree -h