Add NET_RAW capability requirement for ICMP ping

Agent was crashing with segmentation fault (exit code 139) when
attempting ICMP ping health checks. The surge-ping library requires
CAP_NET_RAW capability to create raw sockets for ICMP.

Changes:
- Added cap_add: NET_RAW to docker-compose.example.yml
- Updated README docker-compose example
- Added troubleshooting section for exit code 139 crashes

Without this capability, the agent crashes immediately after
successful ping execution when the surge-ping library attempts
to clean up raw socket resources.
This commit is contained in:
Graham McIntire 2026-02-10 13:22:37 -06:00
parent b0f3b57671
commit 4da510dff1
No known key found for this signature in database
2 changed files with 18 additions and 0 deletions

View file

@ -38,6 +38,9 @@ services:
towerops-agent: towerops-agent:
image: ghcr.io/towerops-app/towerops-agent:latest image: ghcr.io/towerops-app/towerops-agent:latest
restart: unless-stopped restart: unless-stopped
# Required for ICMP ping health checks
cap_add:
- NET_RAW
environment: environment:
- TOWEROPS_API_URL=https://towerops.net - TOWEROPS_API_URL=https://towerops.net
- TOWEROPS_AGENT_TOKEN=your-agent-token-here - TOWEROPS_AGENT_TOKEN=your-agent-token-here
@ -122,6 +125,17 @@ docker build -t towerops-agent .
## Troubleshooting ## Troubleshooting
### Agent Crashes with Segmentation Fault (Exit Code 139)
This typically occurs when the container doesn't have the `NET_RAW` capability required for ICMP ping:
```yaml
cap_add:
- NET_RAW
```
Add this to your `docker-compose.yml` under the agent service. Without this capability, the agent will crash when attempting health checks.
### Agent Not Connecting ### Agent Not Connecting
- Verify the API URL is correct (accepts http://, https://, ws://, or wss://) - Verify the API URL is correct (accepts http://, https://, ws://, or wss://)

View file

@ -4,6 +4,10 @@ services:
container_name: towerops-agent container_name: towerops-agent
restart: unless-stopped restart: unless-stopped
# Required for ICMP ping health checks
cap_add:
- NET_RAW
environment: environment:
# Required: Agent authentication token (from Towerops web UI) # Required: Agent authentication token (from Towerops web UI)
# Get this from: Organization > Agents > Create New Agent # Get this from: Organization > Agents > Create New Agent