Troubleshooting

Common issues and their solutions.

Agent Issues

Agent won't start

Symptoms: systemctl status ssi-agent shows failed state

Solutions:

  1. Check the logs:

    bash
    1journalctl -u ssi-agent -n 50
  2. Verify configuration file:

    bash
    1python3 -m json.tool /etc/ssi-agent/config.json
  3. Check if agent is registered:

    bash
    1ssi whoami

Agent not connecting to backend

Symptoms: Agent running but no data in mobile app

Solutions:

  1. Verify backend URL:

    bash
    1cat /etc/ssi-agent/config.json | grep backend_url
  2. Test connectivity:

    bash
    1curl -I https://api.service-status-indicator.com/api/health/
  3. Check for firewall issues:

    bash
    1sudo iptables -L -n
  4. Restart the agent:

    bash
    1sudo systemctl restart ssi-agent

Registration fails

Symptoms: ssi register times out or fails

Solutions:

  1. Check network connectivity to backend
  2. Verify backend URL is correct
  3. Check backend logs for errors
  4. Try again after a few minutes

Service Script Issues

Service not running on schedule

Symptoms: Timer exists but script never executes

Solutions:

  1. Check timer status:

    bash
    1systemctl list-timers | grep ssi_
  2. Verify timer is enabled:

    bash
    1systemctl is-enabled ssi_my_service.timer
  3. Check service status:

    bash
    1systemctl status ssi_my_service.service
  4. Reload systemd:

    bash
    1sudo systemctl daemon-reload

Script runs but status not reported

Symptoms: Log file has output but no update in app

Solutions:

  1. Check output format matches expected:

    YYYY-MM-DD HH:MM:SS, STATUS, Message
  2. Verify log file exists:

    bash
    1ls -la /var/log/ssi-agent/
  3. Check agent is watching the file:

    bash
    1journalctl -u ssi-agent | grep my_service

"Service script must be a .bash file"

Solution: Rename your script with .bash extension:

bash
1mv my-script.sh my-script.bash

"Service name must be between 3 and 60 characters"

Solution: Update the # name: field in your script.

"Invalid schedule format"

Solution: Verify your schedule using:

bash
1systemd-analyze calendar "your-schedule-here"

Permission Issues

"Permission denied" when adding service

Solutions:

  1. Check you're in the admin group:

    bash
    1groups
  2. Use sudo if needed:

    bash
    1sudo ssi add my-script.bash

Can't write to log directory

Solutions:

  1. Check permissions:

    bash
    1ls -la /var/log/ssi-agent/
  2. Fix ownership:

    bash
    1sudo chown -R ssi-agent:ssi-agent /var/log/ssi-agent/

Log Inspection

View agent daemon logs

bash
1journalctl -u ssi-agent -f

View service script logs

bash
1tail -f /var/log/ssi-agent/<service_id>.log

View systemd timer logs

bash
1journalctl -u ssi_<service_id>.timer
2journalctl -u ssi_<service_id>.service

Reset and Recovery

Completely reset agent

bash
1# Unregister
2ssi unregister
3
4# Re-register
5ssi register
6
7# Restart
8sudo systemctl restart ssi-agent

Force remove broken service

bash
1ssi remove broken_service --force

Reinstall agent

bash
1cd ssi-agent
2sudo ./install.sh --remove
3sudo ./install.sh