Skip to content

Troubleshooting

Diagnose and resolve common deployment issues.

┌─────────────────────────────────────────────────────────────┐
│ ✗ Error: Target Offline │
├─────────────────────────────────────────────────────────────┤
│ │
│ Target: web-prod-03 │
│ Status: Offline (last seen 2 hours ago) │
│ │
│ Possible causes: │
│ • Tarsus agent not running │
│ • Network connectivity issues │
│ • Firewall blocking connection │
│ • Server powered off or rebooted │
│ │
└─────────────────────────────────────────────────────────────┘

Diagnosis:

  1. Check if the server is accessible
  2. Verify Tarsus agent is running
  3. Check network/firewall rules
  4. Review Tarsus logs

Resolution:

Terminal window
# On target machine
systemctl status tarsus
systemctl start tarsus
# Check logs
journalctl -u tarsus -f
┌─────────────────────────────────────────────────────────────┐
│ ✗ Error: Command Timeout │
├─────────────────────────────────────────────────────────────┤
│ │
│ Action: deploy-app │
│ Timeout: 300 seconds │
│ Elapsed: 300 seconds │
│ │
│ The command did not complete within the timeout period. │
│ │
└─────────────────────────────────────────────────────────────┘

Diagnosis:

  1. Check what the command was doing
  2. Look for network or I/O bottlenecks
  3. Verify resource availability

Resolution:

CauseSolution
Slow networkIncrease timeout or optimize transfer
Large file copyUse streaming or chunked transfer
Hung processFix underlying issue or add timeout handling
Resource exhaustionFree up disk/memory
┌─────────────────────────────────────────────────────────────┐
│ ✗ Error: Permission Denied │
├─────────────────────────────────────────────────────────────┤
│ │
│ Command: cp /tmp/app.zip /opt/apps/ │
│ Exit code: 1 │
│ Error: Permission denied: /opt/apps/ │
│ │
│ The Tarsus agent does not have permission to write to │
│ the target directory. │
│ │
└─────────────────────────────────────────────────────────────┘

Diagnosis:

  1. Check Tarsus user permissions
  2. Verify directory ownership
  3. Review SELinux/AppArmor policies

Resolution:

Terminal window
# Fix directory permissions
sudo chown -R tarsus:tarsus /opt/apps
sudo chmod 755 /opt/apps
# Or run Tarsus with appropriate user
┌─────────────────────────────────────────────────────────────┐
│ ✗ Error: Connection Refused │
├─────────────────────────────────────────────────────────────┤
│ │
│ Target: web-prod-01:9342 │
│ Error: Connection refused │
│ │
│ Thorax could not connect to the Tarsus agent. │
│ │
└─────────────────────────────────────────────────────────────┘

Diagnosis:

  1. Check Tarsus is running and listening
  2. Verify port is correct
  3. Check firewall rules
  4. Verify TLS certificates

Resolution:

Terminal window
# Check if Tarsus is listening
netstat -tlnp | grep 9342
# Check firewall
iptables -L -n | grep 9342
# Test connectivity from Thorax
nc -zv target-hostname 9342
┌─────────────────────────────────────────────────────────────┐
│ ✗ Error: Certificate Verification Failed │
├─────────────────────────────────────────────────────────────┤
│ │
│ Target: web-prod-01 │
│ Error: certificate has expired │
│ │
│ The TLS certificate presented by Tarsus is not valid. │
│ │
└─────────────────────────────────────────────────────────────┘

Diagnosis:

  1. Check certificate expiration
  2. Verify certificate chain
  3. Confirm CA trust

Resolution:

Terminal window
# Check certificate expiration
openssl x509 -in /etc/mantis/certs/client.crt -noout -dates
# Regenerate a client certificate (dev helper), then re-pre-register it
mantisctl cert generate-client --name web-prod-01
mantisctl cert revoke <old-registration-id> --reason "Certificate renewed"
mantisctl cert pre-register --name web-prod-01 --from-cert ./certs/web-prod-01-cert.pem
┌─────────────────────────────────────────────────────────────┐
│ ✗ Error: Version Not Found │
├─────────────────────────────────────────────────────────────┤
│ │
│ Solution: customer-portal │
│ Requested version: 1.3.0 │
│ Available versions: 1.0.0, 1.1.0, 1.2.0 │
│ │
│ The requested version does not exist. │
│ │
└─────────────────────────────────────────────────────────────┘

Resolution:

  1. Check available versions
  2. Create the missing version
  3. Use a different version
┌─────────────────────────────────────────────────────────────┐
│ ✗ Error: Required Variable Not Set │
├─────────────────────────────────────────────────────────────┤
│ │
│ Variable: database_host │
│ Environment: Production │
│ │
│ This variable is required but has no value for the │
│ target environment. │
│ │
└─────────────────────────────────────────────────────────────┘

Resolution:

  1. Navigate to solution variables
  2. Set value for the environment
  3. Retry deployment

Access detailed logs:

Terminal window
# View deployment logs
mantisctl deployment logs <deployment-id>
# Filter by target
mantisctl deployment logs <deployment-id> --target <target-id>
# Filter by log level
mantisctl deployment logs <deployment-id> --level error

Verify target connectivity:

Terminal window
# Pre-flight check for a specific target (validates health + freezes)
mantisctl deployment check --solution-id customer-portal --target web-prod-01
# Pre-flight check for an environment
mantisctl deployment check --solution-id customer-portal --environment-id production

Test the network path to a target’s listen port (default 9342):

Terminal window
# DNS resolution
getent hosts web-prod-01.company.com
# TCP reachability of the Tarsus listen port
nc -vz web-prod-01.company.com 9342
# Inspect the target's certificate over TLS
openssl s_client -connect web-prod-01.company.com:9342 -servername web-prod-01.company.com </dev/null

The pre-flight check and the deployment preview API (POST /api/v1/deployments/preview) report the variables that will be applied to a deployment, including which prompted values are still required. Run the pre-flight check above, or call the preview endpoint, to verify variable resolution before deploying.

InformationSource
Error messageDeployment logs
Target statusTarget list
Command outputLog streaming
System stateTarget machine

For connection issues:

  • Tarsus agent running
  • Network accessible
  • Firewall allows traffic
  • Certificates valid

For command failures:

  • Script syntax correct
  • Dependencies installed
  • Permissions adequate
  • Resources available

For timeout issues:

  • Network bandwidth
  • Disk I/O performance
  • CPU/memory load
  • Command complexity
Terminal window
# Deploy to a single target first
mantisctl deployment create --solution-id customer-portal \
--source-version 1.3.0 \
--target web-prod-01

Confirm the issue is fixed before deploying to all targets.

CodeMeaning
0Success
1General error
126Permission denied
127Command not found
128+NKilled by signal N
137Killed (SIGKILL, likely OOM)
143Terminated (SIGTERM)
255Exit status out of range
ErrorMeaningSolution
ECONNREFUSEDConnection refusedCheck Tarsus is running
ETIMEDOUTConnection timeoutCheck network path
ENOTFOUNDDNS lookup failedVerify hostname
EACCESPermission deniedFix file permissions
ENOENTFile not foundCheck paths in scripts
ENOMEMOut of memoryFree memory or increase
ENOSPCNo space leftFree disk space
  1. Identify affected targets
  2. Determine previous working version
  3. Deploy previous version to affected targets
Terminal window
# Rollback specific targets to the previous version
mantisctl deployment create --solution-id customer-portal \
--source-version 1.2.0 \
--target web-prod-01 \
--target web-prod-02

If deployments are consistently failing:

  1. Stop - Cancel active deployments
  2. Assess - Review system state
  3. Stabilize - Rollback if needed
  4. Diagnose - Find root cause
  5. Fix - Address underlying issue
  6. Test - Verify in lower environment
  7. Deploy - Retry with fix
  • Watch for early failures
  • Review logs in real-time
  • Set up alerts for failures
Phase 1: 1 target (canary)
Phase 2: 10% of targets
Phase 3: 50% of targets
Phase 4: Remaining targets

Always deploy to development/staging first.

  • Know the previous working version
  • Verify rollback works before production
  • Document rollback procedure

After resolving issues:

  1. Document what happened
  2. Identify root cause
  3. Implement prevention
  4. Update procedures
  • Review action and script documentation
  • Verify configuration matches examples
  • Check for known issues

Provide:

  • Deployment ID
  • Error messages
  • Target details
  • Steps to reproduce
  • GitHub Issues
  • Community forums
  • Knowledge base