CLI Issues
Troubleshooting problems with the OpsSquad CLI and agents
This page covers common issues with the OpsSquad CLI tool and agent management.
Installation Issues
Installation Script Fails
Symptoms: The curl | bash installation fails with an error.
Solutions:
-
Check internet connectivity:
curl -I https://install.opssquad.aiIf this fails, check your network/proxy settings.
-
Try manual installation: Download the binary directly for your platform from the releases page.
-
Check disk space:
df -h /usr/local/binEnsure at least 50MB is available.
Permission Denied During Installation
Symptoms: "Permission denied" when installing to /usr/local/bin.
Solutions:
Option 1: Use sudo
curl -fsSL https://install.opssquad.ai/install.sh | sudo bashOption 2: User Installation
mkdir -p ~/.local/bin
# Download and extract to ~/.local/bin
export PATH="$HOME/.local/bin:$PATH"Command Not Found After Installation
Symptoms: opssquad: command not found after installation.
Solutions:
-
Restart your terminal or run:
source ~/.bashrc # or ~/.zshrc -
Check PATH includes installation directory:
echo $PATH | grep -E "(local/bin|\.local/bin)" -
Add to PATH if missing:
echo 'export PATH="/usr/local/bin:$PATH"' >> ~/.bashrc source ~/.bashrc
Agent Won't Start
Symptoms: opssquad agent start completes but agent shows as stopped.
Diagnostic Steps:
-
Run validation:
opssquad agent validateThis identifies specific issues.
-
Check logs for errors:
opssquad agent logs --lines=50Look for ERROR or FATAL messages.
-
Verify configuration exists:
# System installation cat /etc/opssquad/agent.yaml # User installation cat ~/.config/opssquad/agent.yaml -
Check agent binary exists:
# System installation ls -la /usr/local/lib/opssquad/ # User installation ls -la ~/.local/lib/opssquad/
Connectivity Problems
Symptoms: Agent starts but shows "Disconnected" or connection errors.
Check Network Access
# Test TCP connectivity
nc -zv socket.opssquad.ai 9000
# Alternative using curl
curl -v telnet://socket.opssquad.ai:9000
# Check DNS resolution
nslookup socket.opssquad.aiFirewall Configuration
Ensure outbound TCP on port 9000 is allowed:
UFW (Ubuntu):
# Check status
sudo ufw status
# Allow outbound (usually allowed by default)
sudo ufw allow out 9000/tcpfirewalld (RHEL/CentOS):
# Check status
sudo firewall-cmd --list-all
# Allow outbound
sudo firewall-cmd --permanent --add-port=9000/tcp
sudo firewall-cmd --reloadiptables:
# Check existing rules
sudo iptables -L -n | grep 9000
# Allow outbound
sudo iptables -A OUTPUT -p tcp --dport 9000 -j ACCEPTProxy Issues
If behind a corporate proxy:
# The agent's TCP connection doesn't work through HTTP proxies
# You need direct TCP access to socket.opssquad.ai:9000
# Temporarily disable proxy to test
unset http_proxy https_proxy HTTP_PROXY HTTPS_PROXY
opssquad agent restartWarning: OpsSquad agents require direct TCP access. HTTP proxies are not supported for the main connection.
Permission Errors
System Installation (Root)
If you installed with sudo, always use sudo for commands:
sudo opssquad agent status
sudo opssquad agent start
sudo opssquad agent logsFix permissions if needed:
sudo chown -R root:root /etc/opssquad/
sudo chmod 600 /etc/opssquad/agent.yamlUser Installation
If installed without root, never use sudo:
# Correct
opssquad agent status
# WRONG - will cause permission conflicts
sudo opssquad agent statusFix permissions:
chmod 600 ~/.config/opssquad/agent.yamlConfiguration Issues
Invalid Configuration
Symptoms: Validation fails with "invalid configuration".
Check YAML syntax:
# Install yamllint
pip install yamllint
# Validate config
yamllint /etc/opssquad/agent.yamlCommon YAML issues:
- Tabs instead of spaces
- Missing quotes around special characters
- Incorrect indentation
Missing Credentials
Symptoms: "agent_id or api_key missing".
Verify configuration:
app:
agent_id: "your-agent-id" # Required
api_key: "your-api-key" # RequiredRegenerate Configuration
If config is corrupted, reinstall:
opssquad agent uninstall --force
opssquad agent install --agent-id="your-id" --api-key="your-key"macOS Specific Issues
Developer Cannot Be Verified
Symptoms: "opssquad cannot be opened because the developer cannot be verified"
Solutions:
Using System Preferences:
- Open System Settings > Privacy & Security
- Scroll down to find the blocked app message
- Click "Open Anyway"
Using Command Line:
# Remove quarantine attribute
sudo xattr -d com.apple.quarantine /usr/local/bin/opssquad
sudo xattr -d com.apple.quarantine /usr/local/lib/opssquad/*Permission Issues on macOS
macOS may require explicit permissions:
# Grant execute permission
chmod +x /usr/local/bin/opssquad
chmod +x /usr/local/lib/opssquad/opssquad-connectivity-layerService Issues (Linux)
Service Not Starting on Boot
Check if enabled:
sudo systemctl is-enabled opssquad-connectivity-layerEnable it:
sudo systemctl enable opssquad-connectivity-layerView Service Status
sudo systemctl status opssquad-connectivity-layerView Service Logs
sudo journalctl -u opssquad-connectivity-layer -fRestart Service
sudo systemctl restart opssquad-connectivity-layerAgent Keeps Disconnecting
Symptoms: Frequent reconnection messages in logs.
Possible Causes:
-
Unstable network:
ping -c 20 socket.opssquad.aiLook for packet loss or high latency.
-
Firewall killing idle connections: Some firewalls terminate idle TCP connections. Contact your network administrator.
-
Resource exhaustion:
top -bn1 | head -20 free -hCheck CPU and memory usage.
-
Agent crashing:
opssquad agent logs | grep -i "error\|panic\|fatal"
Upgrade Issues
Upgrade Command Fails
# Check current version
opssquad --version
# Try manual upgrade
curl -fsSL https://install.opssquad.ai/install.sh | bashAgent Version Mismatch
After CLI upgrade, update the agent:
opssquad agent stop
opssquad agent upgrade
opssquad agent startGetting More Help
If these solutions don't resolve your issue:
-
Run full diagnostics:
opssquad agent validate > diagnostics.txt opssquad agent logs --lines=200 >> diagnostics.txt -
Contact support with:
- The
diagnostics.txtfile - Your OS:
uname -a - Steps to reproduce
- The
Support channels:
- Email: [email protected]
- Discord: discord.gg/opssquad
- GitHub: Issues