Troubleshooting Guide
Solutions to common issues when using govman.
Table of Contents
- Installation Issues
- Version Switching Issues
- Auto-Switch Issues
- Shell Integration Issues
- Download Issues
- Permission Issues
- Platform-Specific Issues
- Configuration Issues
Installation Issues
"command not found: govman"
Cause: govman binary not in PATH.
Solutions:
-
Check if govman is installed:
ls -la ~/.govman/bin/govman -
Verify PATH contains govman:
echo $PATH | grep govman -
Add to PATH manually:
# Bash/Zsh echo 'export PATH="$HOME/.govman/bin:$PATH"' >> ~/.bashrc source ~/.bashrc # Fish fish_add_path ~/.govman/bin -
Re-run installation:
curl -fsSL https://raw.githubusercontent.com/justjundana/govman/main/scripts/install.sh | bash
Installation Fails with "Permission Denied"
Cause: Insufficient permissions.
Solutions:
-
Make binary executable:
chmod +x ~/.govman/bin/govman -
Check directory permissions:
ls -ld ~/.govman/bin # Should show: drwxr-xr-x -
Fix ownership:
sudo chown -R $(whoami) ~/.govman
"Certificate verification failed"
Cause: Outdated CA certificates.
Solutions:
# macOS
brew install openssl
# Ubuntu/Debian
sudo apt-get update && sudo apt-get install ca-certificates
# CentOS/RHEL
sudo yum install ca-certificates
Version Switching Issues
"Go version X is not installed"
Cause: Trying to use a version that isn't installed.
Solutions:
-
Check installed versions:
govman list -
Install the version:
govman install 1.21.5 -
Then switch:
govman use 1.21.5
"Cannot uninstall currently active version"
Cause: Attempting to remove the version you're currently using.
Solutions:
-
Switch to different version first:
govman use 1.20.12 -
Then uninstall:
govman uninstall 1.21.5
Version Switch Doesn't Persist
Cause: Using session-only activation instead of default.
Solutions:
-
Set as default:
govman use 1.21.5 --default -
Verify default is set:
cat ~/.govman/config.yaml | grep default_version -
Check in new terminal:
# Open new terminal go version
Auto-Switch Issues
Auto-Switch Not Working
Cause: Auto-switch disabled or shell integration not loaded.
Diagnosis:
# Check if auto-switch is enabled
cat ~/.govman/config.yaml | grep -A 2 auto_switch
# Check shell integration
type govman_auto_switch # Should show it's a function
Solutions:
-
Enable auto-switch in config:
auto_switch: enabled: true -
Re-initialize shell:
govman init --force source ~/.bashrc # Or ~/.zshrc, etc. -
Test manually:
govman refresh
.govman-version File Ignored
Cause: Invalid file format or content.
Solutions:
-
Check file content:
cat .govman-version # Should contain just: 1.21.5 -
Fix format (no quotes, no prefix):
echo "1.21.5" > .govman-version # ❌ Wrong (has quotes) echo 1.21.5 > .govman-version # ✅ Correct -
Remove whitespace:
echo "1.21.5" | tr -d ' \n\r' > .govman-version -
Verify version is installed:
govman list | grep 1.21.5 govman install 1.21.5 # If missing
Wrong Version After cd
Cause: Multiple .govman-version files or cached state.
Solutions:
-
Check for parent directory files:
find . -name ".govman-version" -type f -
Force refresh:
govman refresh -
Verify current:
govman current go version
Shell Integration Issues
Shell Integration Not Loading
Cause: Configuration not in shell RC file or syntax error.
Diagnosis:
# Check if configuration exists
grep -A 5 "GOVMAN" ~/.bashrc # Or ~/.zshrc, etc.
# Check for syntax errors
bash -n ~/.bashrc # For Bash
zsh -n ~/.zshrc # For Zsh
Solutions:
-
Re-initialize:
govman init --force -
Manually reload:
source ~/.bashrc # Or appropriate RC file -
Check for conflicts:
# Look for duplicate GOVMAN sections grep -n "GOVMAN" ~/.bashrc
govman Command is Not a Function
Cause: Wrapper function not loaded.
Diagnosis:
type govman
# Should show: govman is a function
# If shows: govman is /path/to/binary - wrapper not loaded
Solutions:
-
Reload shell configuration:
source ~/.bashrc -
Check function definition:
declare -f govman # Should show function code -
Re-initialize shell:
govman init --force
Auto-Switch Triggers Too Often
Cause: Hook firing on every prompt.
Solutions:
-
Disable auto-switch:
auto_switch: enabled: false -
Use manual switching:
govman use 1.21.5
Download Issues
Download Fails or Times Out
Cause: Network issues, firewall, or slow connection.
Solutions:
-
Increase timeout:
download: timeout: 1800s # 30 minutes retry_count: 10 -
Use mirror:
mirror: enabled: true url: "https://golang.google.cn/dl/" -
Check connectivity:
curl -I https://go.dev/dl/ -
Configure proxy:
export HTTP_PROXY=http://proxy.example.com:8080 export HTTPS_PROXY=http://proxy.example.com:8080
"Checksum verification failed"
Cause: Corrupted download or man-in-the-middle attack.
Solutions:
-
Clear cache and retry:
govman clean govman install 1.21.5 -
Check network security:
- Verify you're not behind a corporate proxy that modifies downloads
- Check for antivirus interference
- Try different network
-
Manual download:
- Download from https://go.dev/dl/
- Verify checksum manually
- Extract to
~/.govman/versions/
Downloads are Slow
Cause: Limited bandwidth or server issues.
Solutions:
-
Use mirror closer to your region:
mirror: enabled: true url: "https://golang.google.cn/dl/" # For Asia -
Adjust connection settings:
download: parallel: true max_connections: 2 # Lower for slower networks -
Resume interrupted downloads:
- govman automatically resumes partial downloads
- Just run the install command again
Permission Issues
"Permission denied" When Creating Directories
Cause: Insufficient permissions in home directory.
Solutions:
-
Fix home directory permissions:
chmod 755 ~ -
Fix govman directory permissions:
mkdir -p ~/.govman chmod 755 ~/.govman -
Check ownership:
ls -ld ~/.govman # Should be owned by you, not root -
Fix ownership:
sudo chown -R $(whoami) ~/.govman
"Operation not permitted" on macOS
Cause: macOS Gatekeeper blocking binary.
Solutions:
-
Remove quarantine attribute:
xattr -d com.apple.quarantine ~/.govman/bin/govman -
Allow in System Preferences:
- Go to System Preferences → Security & Privacy
- Click "Allow" for govman
-
Disable Gatekeeper temporarily:
sudo spctl --master-disable # Run govman sudo spctl --master-enable
SELinux Issues on Linux
Cause: SELinux preventing execution.
Solutions:
-
Check SELinux status:
getenforce -
Set proper context:
chcon -t bin_t ~/.govman/bin/govman -
Or temporarily disable:
sudo setenforce 0 # Run govman sudo setenforce 1
Platform-Specific Issues
macOS: "Developer Cannot be Verified"
Cause: Apple's security blocking unsigned binary.
Solutions:
-
Right-click and open:
- Right-click govman binary
- Select "Open"
- Click "Open" in dialog
-
Command line:
xattr -d com.apple.quarantine ~/.govman/bin/govman
Windows: "Windows Defender Blocked This App"
Cause: SmartScreen blocking unknown binary.
Solutions:
-
Add exclusion:
Add-MpPreference -ExclusionPath "$env:USERPROFILE\.govman" -
Click "Run anyway":
- Click "More info"
- Click "Run anyway"
-
Disable SmartScreen temporarily:
- Only if you trust the source
Windows: PowerShell Execution Policy
Cause: PowerShell blocking scripts.
Solutions:
# Check current policy
Get-ExecutionPolicy
# Set policy for current user
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
# Or bypass for single session
powershell -ExecutionPolicy Bypass
Linux: "No such file or directory" Despite Binary Existing
Cause: Missing shared libraries or wrong architecture.
Solutions:
-
Check architecture:
uname -m file ~/.govman/bin/govman -
Install missing libraries:
# Ubuntu/Debian sudo apt-get install libc6 # CentOS/RHEL sudo yum install glibc
Configuration Issues
Configuration Changes Not Taking Effect
Cause: Config not reloaded or using flags.
Solutions:
-
Check config location:
ls -la ~/.govman/config.yaml -
Validate YAML syntax:
# Use online YAML validator or govman --verbose list # Shows config loading -
Remove and regenerate:
mv ~/.govman/config.yaml ~/.govman/config.yaml.backup govman list # Regenerates with defaults
Custom Config File Not Loaded
Cause: Not specifying config path.
Solutions:
# Use --config flag
govman --config /path/to/config.yaml list
# Or set environment variable
export GOVMAN_CONFIG=/path/to/config.yaml
govman list
Debugging Tips
Enable Verbose Mode
Get detailed information about what govman is doing:
govman --verbose install 1.21.5
govman --verbose use 1.21.5
Check govman Version
govman --version
Check Go Environment
go env
go version -v
Test in Clean Environment
# Start new shell without config
bash --norc --noprofile
# Or
zsh -f
# Test govman commands
Check Logs
govman outputs to stderr. Capture for analysis:
govman install 1.21.5 2>&1 | tee govman-install.log
Getting Help
Before Opening an Issue
- ✅ Check this troubleshooting guide
- ✅ Search existing issues
- ✅ Try with
--verboseflag - ✅ Test in clean environment
When Opening an Issue
Include:
- OS and version:
uname -a(Unix) orsysteminfo(Windows) - Shell:
echo $SHELL - govman version:
govman --version - Go version:
go version(if applicable) - Complete error message: Use
--verbose - Steps to reproduce
- Expected vs actual behavior
Community Support
Still Having Issues?
If this guide didn't solve your problem:
- Check the Commands Reference for detailed usage
- Review Configuration Guide for settings
- See Shell Integration for setup issues
- Open a GitHub Issue with details
We're here to help! 🤝