CLI Troubleshooting
Common issues and solutions for the OpsSquad CLI
This guide covers common issues you may encounter with the OpsSquad CLI and how to resolve them.
Diagnostic Commands
Before troubleshooting, run these commands to gather information:
# Validate installation
opssquad node validate
# Check node status
opssquad node status
# View recent logs
opssquad node logs --lines=50Common Issues
Node Won't Start
Symptoms:
opssquad node startcompletes but node shows as stopped- Status shows "Inactive" or "Failed"
Solutions:
-
Run validation:
opssquad node validateThis identifies configuration or permission issues.
-
Check logs for errors:
opssquad node logsLook for error messages indicating the root cause.
-
Verify configuration exists:
# System installation cat /etc/opssquad/node.yaml # User installation cat ~/.config/opssquad/node.yaml -
Check binary exists:
# System installation ls -la /usr/local/lib/opssquad/ # User installation ls -la ~/.local/lib/opssquad/
Connectivity Problems
Symptoms:
- Node starts but shows "Disconnected"
- "Connection refused" or "timeout" errors in logs
- Node repeatedly reconnecting
Solutions:
-
Test network connectivity:
# Check if you can reach the platform nc -zv socket.opssquad.ai 9000 # Alternative test curl -v telnet://socket.opssquad.ai:9000If this fails, you have a network/firewall issue.
-
Check firewall rules:
Ensure outbound TCP connections on port 9000 are allowed:
# UFW (Ubuntu) sudo ufw status # iptables sudo iptables -L -n | grep 9000 # firewalld (CentOS/RHEL) sudo firewall-cmd --list-all -
Check DNS resolution:
nslookup socket.opssquad.ai dig socket.opssquad.ai -
Check for proxy interference:
The node's TCP connection may not work through HTTP proxies. Try disabling proxy settings:
unset http_proxy https_proxy HTTP_PROXY HTTPS_PROXY opssquad node restart
Permission Errors
Symptoms:
- "Permission denied" errors
- Cannot read/write configuration files
- Service fails to start
Solutions:
System Installation (Root)
If you installed with sudo, always use sudo for management commands:
sudo opssquad node status
sudo opssquad node start
sudo opssquad node logsCheck file permissions:
# Configuration should be readable by root
sudo ls -la /etc/opssquad/
# Logs directory should be writable
sudo ls -la /var/log/opssquad/Fix permissions if needed:
sudo chown -R root:root /etc/opssquad/
sudo chmod 600 /etc/opssquad/node.yaml
sudo chmod 755 /var/log/opssquad/User Installation (Non-Root)
If you installed as a regular user, do not use sudo:
# Correct - no sudo
opssquad node status
# Incorrect - will cause permission conflicts
sudo opssquad node status # Don't do this!Check file permissions:
ls -la ~/.config/opssquad/
ls -la ~/.local/lib/opssquad/
ls -la ~/.local/log/opssquad/Configuration Invalid
Symptoms:
- Validation fails with "invalid configuration"
- Node won't start due to config errors
Solutions:
-
Check YAML syntax:
# Install yamllint pip install yamllint # Validate config yamllint /etc/opssquad/node.yaml -
Verify required fields:
The configuration must have
node_idandtoken:app: node_id: "your-node-id" # Required token: "your-token" # Required -
Check for special characters:
If your token contains special characters, wrap it in quotes:
app: token: "tok_live_key+with/special=chars" -
Regenerate configuration:
If config is corrupted, reinstall:
opssquad node uninstall --force opssquad node install --node-id="your-id" --token="your-token"
macOS Security Warnings
Symptoms:
- "opssquad cannot be opened because the developer cannot be verified"
- Binary blocked by Gatekeeper
Solutions:
Using System Preferences
- Open System Preferences (or System Settings on macOS Ventura+)
- Go to Security & Privacy (or Privacy & Security)
- Under the General tab, you should see a message about opssquad being blocked
- Click Open Anyway or Allow Anyway
- Try running the command again
Using Command Line
Remove the quarantine attribute:
sudo xattr -d com.apple.quarantine /usr/local/bin/opssquad
sudo xattr -d com.apple.quarantine /usr/local/lib/opssquad/*Service Not Starting on Boot
Symptoms:
- Node runs when started manually but doesn't start on boot
- Systemd service not enabled
Solutions:
Check if the service is enabled:
sudo systemctl is-enabled opssquad-connectivity-layerEnable it:
sudo systemctl enable opssquad-connectivity-layerCheck service status:
sudo systemctl status opssquad-connectivity-layerView service logs:
sudo journalctl -u opssquad-connectivity-layer -fNode Keeps Disconnecting
Symptoms:
- Frequent "reconnecting" messages in logs
- Node status fluctuates between Connected/Disconnected
Possible Causes:
- Unstable network connection - Check network stability
- Firewall timeout - Some firewalls close idle connections
- Resource exhaustion - Check CPU/memory usage
Solutions:
# Check for network issues
ping -c 10 socket.opssquad.ai
# Check system resources
top -bn1 | head -20
# Check for connection resets in logs
opssquad node logs | grep -i "disconnect\|reconnect\|error"Getting Help
If you cannot resolve the issue:
- Email Support: Contact [email protected] with output of
opssquad node validateandopssquad node logs, plus your operating system and version. - Community Discord: Join discord.gg/opssquad for real-time help from the community.
- GitHub Issues: Report bugs at github.com/opssquad/opssquad-cli-tool/issues.
Next Steps
- Commands Reference - Review all available CLI commands.
- Configuration - Learn about configuration options.