This guide helps you diagnose and fix common issues with Cascade CLI.
Before diving into specific issues, run the built-in diagnostics:
# Run comprehensive health check
ca doctor
# Get detailed system information
ca doctor --verbose
# Show configuration
ca config list
# Check Git status
git statusSymptoms:
$ ca --version
bash: cc: command not foundSolutions:
-
Check if binary exists:
# If installed via cargo ls ~/.cargo/bin/cc # If built from source ls target/release/cc
-
Fix PATH:
# Add to PATH temporarily export PATH="$HOME/.cargo/bin:$PATH" # Make permanent (bash) echo 'export PATH="$HOME/.cargo/bin:$PATH"' >> ~/.bashrc source ~/.bashrc # Make permanent (zsh) echo 'export PATH="$HOME/.cargo/bin:$PATH"' >> ~/.zshrc source ~/.zshrc
-
Reinstall:
# Via cargo cargo install --path . --force # Or rebuild cargo build --release cp target/release/ca ~/.local/bin/
Symptoms:
error: linking with `ca` failed: exit status: 1
Solutions:
-
Update Rust:
rustup update rustc --version # Should be 1.82+ -
Install system dependencies:
# Ubuntu/Debian sudo apt update sudo apt install build-essential pkg-config libssl-dev # macOS xcode-select --install # CentOS/RHEL sudo yum groupinstall "Development Tools" sudo yum install openssl-devel
-
Clear cache and rebuild:
cargo clean cargo build --release
Symptoms:
$ ca --version
Permission deniedSolutions:
-
Fix permissions:
chmod +x ~/.cargo/bin/cc -
Install to user directory:
cargo install --path . --root ~/.local export PATH="$HOME/.local/bin:$PATH"
Symptoms:
Error: Repository is not initialized for Cascade CLI
Solutions:
-
Check if in Git repository:
git status # Should show repository status, not "not a git repository" -
Initialize Cascade CLI:
ca init --bitbucket-url https://your-bitbucket.com # Or use setup wizard ca setup -
Fix corrupted configuration:
rm -rf .cascade/ ca init --force
Symptoms:
Error: Failed to connect to Bitbucket: HTTP 401 Unauthorized
Error: Failed to connect to Bitbucket: Connection timeout
Solutions:
-
Verify credentials:
ca config get bitbucket.token ca config get bitbucket.url # Test manually curl -H "Authorization: Bearer YOUR_TOKEN" \ "https://your-bitbucket.com/rest/api/1.0/projects"
-
Check Personal Access Token:
- Token must have Repository Write permissions
- Token must not be expired
- Check Bitbucket → Settings → Personal Access Tokens
-
Network issues:
# Check DNS resolution nslookup your-bitbucket.com # Test connectivity ping your-bitbucket.com # Check proxy settings echo $HTTP_PROXY echo $HTTPS_PROXY
-
Corporate firewall/proxy:
# Configure Git for proxy git config --global http.proxy http://proxy.company.com:8080 git config --global https.proxy https://proxy.company.com:8080 # Set environment variables export HTTP_PROXY=http://proxy.company.com:8080 export HTTPS_PROXY=https://proxy.company.com:8080
Symptoms:
Error: Project 'INVALID' not found
Error: Repository 'invalid-repo' not found in project 'PROJECT'
Solutions:
-
List available projects:
curl -H "Authorization: Bearer YOUR_TOKEN" \ "https://your-bitbucket.com/rest/api/1.0/projects" | jq '.values[].key'
-
List repositories in project:
curl -H "Authorization: Bearer YOUR_TOKEN" \ "https://your-bitbucket.com/rest/api/1.0/projects/PROJECT/repos" | jq '.values[].name'
-
Auto-detect from Git remote:
git remote -v # Use the setup wizard to auto-detect ca setup --force
Symptoms:
Error: No active stack found
Solutions:
-
Check existing stacks:
ca stacks list
-
Create or activate a stack:
# Create new stack ca stacks create my-feature --base main # Or activate existing stack ca stacks switch existing-stack-name
-
Recover from corruption:
# Check stack metadata ls .cascade/stacks/ # Validate stack integrity ca stacks validate # Force create new stack if needed ca stacks create recovery-stack --base main --force
Symptoms:
Error: Failed to sync stack: merge conflicts detected
Error: Base branch 'main' not found
Solutions:
-
Resolve merge conflicts:
# Check conflict status git status # Resolve conflicts manually git add . ca rebase continue # Or abort and try different strategy ca rebase abort ca stacks sync --strategy merge
-
Update base branch:
# Fetch latest changes git fetch origin # Ensure base branch exists git branch -r | grep origin/main # Update local base git checkout main git pull origin main # Try sync again ca stacks sync
-
Stack corruption recovery:
# Backup current work git stash # Reset stack to known good state ca stack # Note commit hashes git checkout main git pull origin main # Recreate stack manually ca stacks create recovery --base main git cherry-pick COMMIT_HASH_1 ca stacks push git cherry-pick COMMIT_HASH_2 ca stacks push
Symptoms:
Error: Failed to create pull request: title cannot be empty
Error: Failed to create pull request: source branch not found
Solutions:
-
Check commit exists:
git log --oneline -n 5 ca stack
-
Verify branch state:
# Check current branch git branch # Ensure commits are pushed to remote git push origin current-branch
-
Manual PR creation:
# Get commit details ca stack # Create PR manually in Bitbucket UI # Then update stack metadata ca stacks submit --pr-id 123
Symptoms:
- Commands taking > 30 seconds
- High memory usage
- Timeouts
Solutions:
-
Optimize Git configuration:
git config core.preloadindex true git config core.fscache true git config gc.auto 256
-
Adjust Cascade CLI settings:
ca config set performance.cache_size 500 ca config set performance.parallel_operations false ca config set network.timeout 120
-
Repository maintenance:
# Clean up Git repository git gc --aggressive git prune # Clear Cascade cache rm -rf .cascade/cache/
Solutions:
-
Reduce cache size:
ca config set performance.cache_size 100 -
Monitor memory usage:
# During operation top -p $(pgrep cc) # Check cache directory size du -sh .cascade/cache/
Symptoms:
- Garbled characters
- No colors
- Layout issues
Solutions:
-
Check terminal capabilities:
echo $TERM # Should be xterm-256color or similar # Test colors tput colors # Should be 256 or higher
-
Fix terminal settings:
export TERM=xterm-256color # For tmux users export TERM=screen-256color
-
Disable colors if needed:
ca config set ui.colors false ca tui
Solutions:
-
Update terminal:
# Check for terminal updates # Try different terminal: iTerm2, Alacritty, etc.
-
Reset TUI settings:
ca config unset ui.tui_refresh_rate ca config unset ui.tui_theme
-
Use alternative interface:
# Use CLI instead of TUI ca stacks list --verbose ca viz stack
Symptoms:
- Commits not auto-added to stack
- No pre-push validation
Solutions:
-
Check hook installation:
ca hooks status ls -la .git/hooks/
-
Verify permissions:
chmod +x .git/hooks/post-commit chmod +x .git/hooks/pre-push
-
Reinstall hooks:
ca hooks uninstall ca hooks install --force
Symptoms:
Error: Existing hook found, use --force to overwrite
Solutions:
-
Backup existing hooks:
cp .git/hooks/post-commit .git/hooks/post-commit.backup
-
Force install:
ca hooks install --force
-
Manual integration:
# Edit existing hook to call Cascade CLI echo "ca stacks push --auto || true" >> .git/hooks/post-commit
# Set debug level
export CASCADE_LOG_LEVEL=debug
# Run command with debug output
ca stacks push
# Check logs
tail -f ~/.cascade/logs/cascade.log# Full diagnostic report
ca doctor --verbose > cascade-debug.txt
# Add system info
echo "=== System Info ===" >> cascade-debug.txt
uname -a >> cascade-debug.txt
git --version >> cascade-debug.txt
rustc --version >> cascade-debug.txt
# Add configuration
echo "=== Configuration ===" >> cascade-debug.txt
ca config list >> cascade-debug.txt
# Add recent logs
echo "=== Recent Logs ===" >> cascade-debug.txt
tail -50 ~/.cascade/logs/cascade.log >> cascade-debug.txt# Test Bitbucket API manually
curl -v -H "Authorization: Bearer YOUR_TOKEN" \
"https://your-bitbucket.com/rest/api/1.0/projects"
# Check DNS resolution
dig your-bitbucket.com
# Test with different timeout
ca config set network.timeout 300# Check Git integrity
git fsck --full
# Analyze repository size
git count-objects -vH
# Check remote configuration
git remote show origin
# Analyze stack metadata
find .cascade/ -name "*.json" -exec cat {} \;If everything is broken:
# 1. Backup important work
git stash
git branch backup-$(date +%Y%m%d)
# 2. Remove Cascade configuration
rm -rf .cascade/
# 3. Reinitialize
ca setup
# 4. Recreate stacks manually
ca stacks create recovery --base main
# Cherry-pick commits as neededFor corrupted stack metadata:
# 1. Export stack information
ca stack > stack-backup.txt
# 2. Note commit hashes and PR IDs
# 3. Delete corrupted stack
ca stacks delete problematic-stack --force
# 4. Recreate with same commits
ca stacks create recovered-stack --base main
git cherry-pick HASH1
ca stacks push
git cherry-pick HASH2
ca stacks push
# 5. Reconnect to existing PRs
ca config set stack.recovered-stack.pr.1 PR_ID_1
ca config set stack.recovered-stack.pr.2 PR_ID_2For broken configuration:
# 1. Backup current config
cp .cascade/config.toml .cascade/config.toml.backup
# 2. Reset to defaults
ca config reset
# 3. Reconfigure step by step
ca config set bitbucket.url "https://your-bitbucket.com"
ca config set bitbucket.project "PROJECT"
ca config set bitbucket.repository "repo"
ca config set bitbucket.token "YOUR_TOKEN"
# 4. Test configuration
ca doctor-
Built-in help:
ca --help ca stack --help ca stacks create --help
-
Diagnostics:
ca doctor --verbose
-
Documentation:
- User Manual - Complete command reference
- Installation Guide - Setup instructions
- Configuration Guide - Settings reference
-
Search existing issues:
- GitHub Issues
- Use search terms: error message, symptom keywords
-
Community discussions:
- GitHub Discussions
- Stack Overflow (tag: cascade-cli)
-
Create new issue: Include this information:
# System information ca doctor --verbose # Error reproduction steps # Expected vs actual behavior # Configuration (sanitized) ca config list | sed 's/token = .*/token = [REDACTED]/'
For enterprise users:
-
Internal support channels:
- Check your company's internal documentation
- Contact IT support for network/proxy issues
-
Configuration templates:
- Ask your team lead for standard configuration
- Check if there's a company-specific setup guide
-
Regular maintenance:
# Weekly repository cleanup git gc ca doctor # Monthly cache cleanup rm -rf .cascade/cache/
-
Configuration backup:
# Backup configuration cp .cascade/config.toml ~/.cascade-config-backup.toml # Version control team config git add .cascade/config.toml git commit -m "Add team Cascade CLI configuration"
-
Monitor health:
# Regular health checks ca doctor | grep -E "(ERROR|WARN)" # Check for updates cargo install cascade-cli --force
- Don't manually force push to shared branches (Cascade CLI handles force pushes safely during rebase)
- Don't ignore merge conflicts
- Don't work on multiple stacks simultaneously without switching
- Don't delete .cascade/ directory unless troubleshooting
- Don't commit sensitive information in configuration
If force push operations fail during rebase:
# Error: Force push rejected
# Solution 1: Check branch protection rules
git ls-remote --heads origin | grep your-branch
# Solution 2: Verify you have push permissions
git remote show origin
# Solution 3: Force push manually as fallback
git checkout original-branch
git reset --hard versioned-branch
git push --force-with-lease origin original-branchIf PRs don't update correctly:
# Check if PRs still exist
ca stacks prs --verbose
# Manually update PR if needed
ca config set stack.STACK_NAME.pr.INDEX PR_ID
# Re-submit if PR was closed
ca stacks submit INDEX --title "Updated after rebase"If a rebase operation is interrupted, temporary branches may be left behind:
# Check for orphaned temp branches (dry-run)
ca cleanup
# Actually delete them
ca cleanup --execute
# Force delete even if they have unmerged commits
ca cleanup --execute --force
# Or manually list and delete
git branch | grep -E '.*-temp-[0-9]+$'
git branch -D branch-temp-1234567890Why this happens: During rebase, Cascade creates temporary branches with
timestamps (e.g., feature-temp-1234567890). These are normally cleaned up
automatically, but may remain if the process is killed or errors occur.
Understanding when force pushes are safe:
# Cascade CLI force pushes are safe because:
# 1. Only affects your feature branches (never main/develop)
# 2. Validates existing PRs before pushing
# 3. Creates backup branches before operations
# 4. Uses --force-with-lease for additional safety
# Check backup branches exist
git branch | grep -E '.*-v[0-9]+$'
# Manually verify safety
git log --oneline origin/your-branch..your-branch-v2| Code | Meaning | Common Solutions |
|---|---|---|
| E001 | Configuration missing | Run ca init or ca setup |
| E002 | Git repository not found | Ensure you're in a Git repository |
| E003 | Bitbucket connection failed | Check credentials and network |
| E004 | Stack not found | Use ca stacks list to see available stacks |
| E005 | Merge conflict detected | Resolve conflicts and run ca rebase continue or ca sync continue |
| E006 | Invalid commit hash | Check commit exists with git log |
| E007 | Permission denied | Check file permissions and access rights |
| E008 | Network timeout | Increase timeout with ca config set network.timeout 120 |
If your issue isn't covered here, please create an issue with detailed information about your problem.