Common issues and solutions for voip-stack.
- VM Creation Issues
- Network Configuration Issues
- VM Management Issues
- Ansible Issues
- OpenSIPS Issues
- Asterisk Issues
- RTPEngine Issues
- Fail2ban Issues
- Vault Issues
- Database Issues
- Performance Issues
- Recovery Procedures
Symptom: limactl start fails or hangs
Solution:
# Check VM status
limactl list
# Check for errors
limactl info sip-1
# View Lima logs
cat ~/.lima/sip-1/ha.stderr.log
cat ~/.lima/sip-1/serial.log
# Try stopping and restarting
limactl stop sip-1 --force
limactl start sip-1Symptom: VM stays in "Starting" state
Cause: Image download or boot issue
Solution:
# Delete and recreate VM
limactl delete sip-1 --force
./scripts/lima-vms.sh create
# Check if Debian image downloaded correctly
ls -la ~/.cache/lima/download/Symptom: "error loading yaml" when creating VM
Cause: Invalid YAML in Lima config
Solution:
# Validate YAML syntax
cat lima/sip-1.yaml | python3 -c 'import yaml,sys; yaml.safe_load(sys.stdin)'
# Check Lima config format
limactl validate lima/sip-1.yamlSymptom: VM can't reach devstack-core services
Cause: Lima networking issue
Solution:
# Check host.lima.internal resolves inside VM
limactl shell sip-1 -- getent hosts host.lima.internal
# Test connectivity to Vault
limactl shell sip-1 -- curl -s http://host.lima.internal:8200/v1/sys/health
# If needed, get host IP manually
limactl shell sip-1 -- ip route | grep defaultSymptom: SSH to VM times out
Cause: VM not fully booted or SSH not ready
Solution:
# Check VM status
limactl list
# Wait for VM to be "Running"
# Then test SSH
ssh -v -F ~/.lima/sip-1/ssh.config lima-sip-1Symptom: limactl shell says VM not found
Solution:
# List all VMs
limactl list
# If VMs missing, recreate them
./scripts/lima-vms.sh createSymptom: lima-vms.sh create fails because VM exists
Solution:
# The script will skip existing VMs automatically
# To recreate, destroy first:
./scripts/lima-vms.sh destroy
./scripts/lima-vms.sh createSymptom: Ansible fails with "Unreachable host"
Solution:
# Check VMs are running
limactl list
# Regenerate inventory
./scripts/lima-vms.sh inventory
# Test SSH manually
limactl shell sip-1
# Check inventory file
cat ansible/inventory/lima.ymlSymptom: Ansible fails with "Cannot connect to Vault"
Solution:
# Check Vault is running
curl http://192.168.64.1:8200/v1/sys/health
# Check devstack-core
cd ~/devstack-core
./devstack status
# Restart if needed
./devstack restart vaultSymptom: Specific Ansible task fails
Solution:
# Run playbook with verbose output
cd ~/voip-stack/ansible
ansible-playbook playbooks/provision-vms.yml -vv
# Run specific role only
ansible-playbook playbooks/provision-vms.yml --tags opensips
# Skip problematic role
ansible-playbook playbooks/provision-vms.yml --skip-tags asteriskSymptom: Task fails with "Could not find or access 'template.j2'"
Cause: Template file missing from role's templates directory
Solution:
# Check what templates exist
ls -la ansible/roles/[role_name]/templates/
# Check configure.yml for required templates
cat ansible/roles/[role_name]/tasks/configure.yml
# Create missing template or check git status
git statusSymptom: Container continuously restarts, exit code 255
Cause: Deprecated -E flag in OpenSIPS 3.5
Solution:
The OpenSIPS 3.5 Docker image uses deprecated -E flag by default. Override with -F:
# In docker-compose.yml
services:
opensips:
command: ["-F"] # Use -F instead of deprecated -ESymptom: opensips -c fails with syntax errors
Cause: OpenSIPS 3.5 deprecated several configuration parameters
Common Fixes:
# Old syntax (3.4 and earlier) → New syntax (3.5+)
children=4 → udp_workers=4
tcp_children=4 → tcp_workers=4
listen=udp:0.0.0.0:5060 → socket=udp:0.0.0.0:5060
log_stderror=yes → stderror_enabled=yes
log_facility=LOG_LOCAL0 → syslog_facility=LOG_LOCAL0
Required module for UDP transport:
# Must be loaded explicitly in 3.5
loadmodule "proto_udp.so"
Symptom: Container shows unhealthy, healthcheck fails
Cause: Healthcheck using TCP for UDP service
Solution:
# In docker-compose.yml - use UDP check
healthcheck:
test: ["CMD", "nc", "-z", "-u", "{{ internal_ip }}", "5060"]
interval: 30s
timeout: 10s
retries: 3Symptom: Port 5060 already in use
Cause: Native systemd service running alongside Docker container
Solution:
# Check what's using port 5060
limactl shell sip-1 -- ss -nlup | grep 5060
# Disable native service if using Docker
limactl shell sip-1 -- sudo systemctl disable opensips
limactl shell sip-1 -- sudo systemctl stop opensipsSymptom: "ERROR: cannot load module" in logs
Cause: Incorrect module path for deployment type
Solution:
# Docker container path
mpath="/lib64/opensips/modules/"
# Native/source installation path
mpath="/usr/local/lib64/opensips/modules/"
Symptom: "db_postgres: ERROR" in logs
Solution:
# Test PostgreSQL connection from VM (via host.lima.internal)
limactl shell sip-1 -- psql -h host.lima.internal -U opensips -d opensips -c "SELECT 1"
# Check connectivity
limactl shell sip-1 -- nc -z host.lima.internal 5432
# Check credentials in config
limactl shell sip-1 -- grep db_url /etc/opensips/opensips.cfgSymptom: Ansible fails with missing template (pjsip.conf.j2, extensions.conf.j2)
Cause: Template files not created in role
Solution: Ensure all required templates exist in ansible/roles/asterisk/templates/:
pjsip.conf.j2extensions.conf.j2manager.conf.j2ari.conf.j2cdr.conf.j2voicemail.conf.j2
Symptom: pjsip show endpoints shows empty
Solution:
# Check PJSIP configuration
ssh voip@192.168.64.30 'docker exec asterisk asterisk -rx "pjsip show transports"'
# Check for config errors
ssh voip@192.168.64.30 'docker exec asterisk asterisk -rx "config show pjsip.conf"'
# Enable PJSIP debug
ssh voip@192.168.64.30 'docker exec asterisk asterisk -rx "pjsip set logger on"'Symptom: Calls connect but no audio
Cause: RTPEngine not configured or unreachable
Solution:
# Check RTPEngine is running
limactl shell media-1 -- systemctl status rtpengine
# Check PJSIP direct_media setting
limactl shell pbx-1 -- grep direct_media /etc/asterisk/pjsip.conf
# Should be: direct_media=noSymptom: Ansible check mode fails on "Display Asterisk version"
Cause: Variable not defined when command doesn't execute
Solution: Add condition to debug task:
- name: Display Asterisk version
ansible.builtin.debug:
msg: "{{ asterisk_version_output.stdout }}"
when: asterisk_version_output.stdout is definedSymptom: lsmod | grep xt_RTPENGINE returns nothing
Solution:
# Check if module exists
limactl shell media-1 -- find /lib/modules -name "xt_RTPENGINE*"
# Check DKMS status
limactl shell media-1 -- dkms status
# Rebuild if needed
limactl shell media-1 -- sudo dkms autoinstall
# Manual load
limactl shell media-1 -- sudo modprobe xt_RTPENGINESymptom: systemctl status rtpengine shows failed
Solution:
# Check logs
limactl shell media-1 -- journalctl -u rtpengine -n 50
# Verify configuration
limactl shell media-1 -- cat /etc/rtpengine/rtpengine.conf
# Check interface exists
limactl shell media-1 -- ip addr showSymptom: "fail2ban.sock not found" errors
Cause: fail2ban service hasn't started or socket timing issue
Solution:
# Wait for socket creation
limactl shell sip-1 -- sleep 5 && ls -la /var/run/fail2ban/
# Restart fail2ban
limactl shell sip-1 -- sudo systemctl restart fail2ban
# Check status
limactl shell sip-1 -- sudo fail2ban-client statusSymptom: "Unable to find a corresponding log file"
Cause: Log file doesn't exist yet
Solution: Create log file before enabling jail:
# Create log file
limactl shell sip-1 -- sudo touch /var/log/opensips/opensips.log
limactl shell sip-1 -- sudo chown opensips:opensips /var/log/opensips/opensips.log
# Restart fail2ban
limactl shell sip-1 -- sudo systemctl restart fail2banSymptom: Jail fails to start with regex errors
Cause: Invalid filter configuration
Solution:
# Test filter
limactl shell sip-1 -- sudo fail2ban-regex /var/log/opensips/opensips.log /etc/fail2ban/filter.d/opensips.conf
# Check filter file
limactl shell sip-1 -- cat /etc/fail2ban/filter.d/opensips.confSymptom: Vault agent can't authenticate
Cause: AppRole not set up in Vault
Solution:
# Check Vault approle
curl -s http://192.168.64.1:8200/v1/sys/auth | jq '.["approle/"]'
# Check if role exists
export VAULT_ADDR=http://192.168.64.1:8200
vault read auth/approle/role/voip-stack
# Create if missing (via devstack-core)
cd ~/devstack-core
./devstack vault-setup-voipSymptom: "cannot execute binary file" on ARM64
Cause: x86 binary downloaded on ARM system
Solution: Ensure correct binary URL:
# For ARM64 (Apple Silicon)
vault_client_binary_url: "https://releases.hashicorp.com/vault/{{ vault_version }}/vault_{{ vault_version }}_linux_arm64.zip"Symptom: Services can't connect to PostgreSQL
Solution:
# Test connection from VM (via host.lima.internal)
limactl shell sip-1 -- psql -h host.lima.internal -U opensips -d opensips
# Check devstack-core PostgreSQL
cd ~/devstack-core
./devstack logs postgres
# Restart if needed
./devstack restart postgresSolution:
# Check database exists
psql -h localhost -U postgres -l
# Run migrations manually inside VM
limactl shell sip-1
sudo -u opensips opensips-cli -x database createSolution:
# Check CPU usage
limactl shell sip-1 -- top -bn1 | head -20
# Check disk I/O
limactl shell sip-1 -- iostat
# Check available RAM
limactl shell sip-1 -- free -h
# Check VM resources
limactl info sip-1 | grep -E "cpus|memory"Solution:
# Check what's using memory
limactl shell pbx-1 -- ps aux --sort=-%mem | head -20
# Restart services to clear memory
limactl shell pbx-1 -- sudo systemctl restart asteriskCauses and Solutions:
- Redundant fact gathering: Remove
gather_facts: yesfrom subsequent plays - Long SSH waits: Reduce polling interval (5s → 2s)
- APT cache updates: Add
cache_valid_time: 3600to apt tasks - Sequential execution: Use
strategy: freefor independent hosts
See ANSIBLE-PROVISIONING.md for detailed performance optimization.
# Stop all VMs
./scripts/lima-vms.sh stop
# Destroy all VMs
./scripts/lima-vms.sh destroy
# Re-create VMs
./scripts/lima-vms.sh create
# Generate inventory and re-provision
./scripts/lima-vms.sh inventory
./scripts/ansible-run.sh provision-vms# Stop and delete single VM
limactl stop sip-1
limactl delete sip-1
# Recreate VM
limactl create --name=sip-1 lima/sip-1.yaml
limactl start sip-1
# Regenerate inventory
./scripts/lima-vms.sh inventory
# Re-run Ansible for this VM only
./scripts/ansible-run.sh provision-vms --limit sip-1# Restart service on VM
limactl shell sip-1 -- sudo systemctl restart opensips
# Check logs
limactl shell sip-1 -- journalctl -u opensips -n 50 --no-pager-
Check Logs:
# VM system logs limactl shell sip-1 -- sudo journalctl -xe # Service logs limactl shell sip-1 -- journalctl -u opensips --no-pager # Lima VM logs cat ~/.lima/sip-1/ha.stderr.log # Ansible logs ./scripts/ansible-run.sh provision-vms -vvv > debug.log 2>&1
-
Verify Prerequisites:
- devstack-core running
- Lima VMs running (
limactl list) - Sufficient disk space and RAM
-
Community Support:
- GitHub Issues: https://github.com/NormB/voip-stack/issues
- Check existing issues first
- Include logs and error messages
Document Status: Complete Last Updated: 2025-12-30 VM Platform: Lima with Debian 12 ARM64