Troubleshooting
Diagnose and resolve common deployment issues.
Common Issues
Section titled “Common Issues”Target Offline
Section titled “Target Offline”┌─────────────────────────────────────────────────────────────┐│ ✗ 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:
- Check if the server is accessible
- Verify Tarsus agent is running
- Check network/firewall rules
- Review Tarsus logs
Resolution:
# On target machinesystemctl status tarsussystemctl start tarsus
# Check logsjournalctl -u tarsus -fCommand Timeout
Section titled “Command Timeout”┌─────────────────────────────────────────────────────────────┐│ ✗ Error: Command Timeout │├─────────────────────────────────────────────────────────────┤│ ││ Action: deploy-app ││ Timeout: 300 seconds ││ Elapsed: 300 seconds ││ ││ The command did not complete within the timeout period. ││ │└─────────────────────────────────────────────────────────────┘Diagnosis:
- Check what the command was doing
- Look for network or I/O bottlenecks
- Verify resource availability
Resolution:
| Cause | Solution |
|---|---|
| Slow network | Increase timeout or optimize transfer |
| Large file copy | Use streaming or chunked transfer |
| Hung process | Fix underlying issue or add timeout handling |
| Resource exhaustion | Free up disk/memory |
Permission Denied
Section titled “Permission Denied”┌─────────────────────────────────────────────────────────────┐│ ✗ 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:
- Check Tarsus user permissions
- Verify directory ownership
- Review SELinux/AppArmor policies
Resolution:
# Fix directory permissionssudo chown -R tarsus:tarsus /opt/appssudo chmod 755 /opt/apps
# Or run Tarsus with appropriate userConnection Refused
Section titled “Connection Refused”┌─────────────────────────────────────────────────────────────┐│ ✗ Error: Connection Refused │├─────────────────────────────────────────────────────────────┤│ ││ Target: web-prod-01:9342 ││ Error: Connection refused ││ ││ Thorax could not connect to the Tarsus agent. ││ │└─────────────────────────────────────────────────────────────┘Diagnosis:
- Check Tarsus is running and listening
- Verify port is correct
- Check firewall rules
- Verify TLS certificates
Resolution:
# Check if Tarsus is listeningnetstat -tlnp | grep 9342
# Check firewalliptables -L -n | grep 9342
# Test connectivity from Thoraxnc -zv target-hostname 9342Certificate Error
Section titled “Certificate Error”┌─────────────────────────────────────────────────────────────┐│ ✗ Error: Certificate Verification Failed │├─────────────────────────────────────────────────────────────┤│ ││ Target: web-prod-01 ││ Error: certificate has expired ││ ││ The TLS certificate presented by Tarsus is not valid. ││ │└─────────────────────────────────────────────────────────────┘Diagnosis:
- Check certificate expiration
- Verify certificate chain
- Confirm CA trust
Resolution:
# Check certificate expirationopenssl x509 -in /etc/mantis/certs/client.crt -noout -dates
# Regenerate a client certificate (dev helper), then re-pre-register itmantisctl cert generate-client --name web-prod-01mantisctl cert revoke <old-registration-id> --reason "Certificate renewed"mantisctl cert pre-register --name web-prod-01 --from-cert ./certs/web-prod-01-cert.pemVersion Not Found
Section titled “Version Not Found”┌─────────────────────────────────────────────────────────────┐│ ✗ 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:
- Check available versions
- Create the missing version
- Use a different version
Variable Not Set
Section titled “Variable Not Set”┌─────────────────────────────────────────────────────────────┐│ ✗ Error: Required Variable Not Set │├─────────────────────────────────────────────────────────────┤│ ││ Variable: database_host ││ Environment: Production ││ ││ This variable is required but has no value for the ││ target environment. ││ │└─────────────────────────────────────────────────────────────┘Resolution:
- Navigate to solution variables
- Set value for the environment
- Retry deployment
Diagnostic Tools
Section titled “Diagnostic Tools”Deployment Logs
Section titled “Deployment Logs”Access detailed logs:
# View deployment logsmantisctl deployment logs <deployment-id>
# Filter by targetmantisctl deployment logs <deployment-id> --target <target-id>
# Filter by log levelmantisctl deployment logs <deployment-id> --level errorTarget Health Check
Section titled “Target Health Check”Verify target connectivity:
# 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 environmentmantisctl deployment check --solution-id customer-portal --environment-id productionConnection Test
Section titled “Connection Test”Test the network path to a target’s listen port (default 9342):
# DNS resolutiongetent hosts web-prod-01.company.com
# TCP reachability of the Tarsus listen portnc -vz web-prod-01.company.com 9342
# Inspect the target's certificate over TLSopenssl s_client -connect web-prod-01.company.com:9342 -servername web-prod-01.company.com </dev/nullVariable Resolution
Section titled “Variable Resolution”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.
Debugging Steps
Section titled “Debugging Steps”Step 1: Identify the Error
Section titled “Step 1: Identify the Error”Step 2: Gather Information
Section titled “Step 2: Gather Information”| Information | Source |
|---|---|
| Error message | Deployment logs |
| Target status | Target list |
| Command output | Log streaming |
| System state | Target machine |
Step 3: Check Common Causes
Section titled “Step 3: Check Common Causes”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
Step 4: Test Fix
Section titled “Step 4: Test Fix”# Deploy to a single target firstmantisctl deployment create --solution-id customer-portal \ --source-version 1.3.0 \ --target web-prod-01Step 5: Verify Resolution
Section titled “Step 5: Verify Resolution”Confirm the issue is fixed before deploying to all targets.
Error Reference
Section titled “Error Reference”Exit Codes
Section titled “Exit Codes”| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | General error |
| 126 | Permission denied |
| 127 | Command not found |
| 128+N | Killed by signal N |
| 137 | Killed (SIGKILL, likely OOM) |
| 143 | Terminated (SIGTERM) |
| 255 | Exit status out of range |
Common Error Messages
Section titled “Common Error Messages”| Error | Meaning | Solution |
|---|---|---|
ECONNREFUSED | Connection refused | Check Tarsus is running |
ETIMEDOUT | Connection timeout | Check network path |
ENOTFOUND | DNS lookup failed | Verify hostname |
EACCES | Permission denied | Fix file permissions |
ENOENT | File not found | Check paths in scripts |
ENOMEM | Out of memory | Free memory or increase |
ENOSPC | No space left | Free disk space |
Recovery Procedures
Section titled “Recovery Procedures”Failed Deployment Recovery
Section titled “Failed Deployment Recovery”Rollback After Failure
Section titled “Rollback After Failure”- Identify affected targets
- Determine previous working version
- Deploy previous version to affected targets
# Rollback specific targets to the previous versionmantisctl deployment create --solution-id customer-portal \ --source-version 1.2.0 \ --target web-prod-01 \ --target web-prod-02Emergency Recovery
Section titled “Emergency Recovery”If deployments are consistently failing:
- Stop - Cancel active deployments
- Assess - Review system state
- Stabilize - Rollback if needed
- Diagnose - Find root cause
- Fix - Address underlying issue
- Test - Verify in lower environment
- Deploy - Retry with fix
Best Practices
Section titled “Best Practices”1. Monitor Deployments
Section titled “1. Monitor Deployments”- Watch for early failures
- Review logs in real-time
- Set up alerts for failures
2. Use Staged Rollouts
Section titled “2. Use Staged Rollouts”Phase 1: 1 target (canary)Phase 2: 10% of targetsPhase 3: 50% of targetsPhase 4: Remaining targets3. Test in Lower Environments
Section titled “3. Test in Lower Environments”Always deploy to development/staging first.
4. Keep Rollback Ready
Section titled “4. Keep Rollback Ready”- Know the previous working version
- Verify rollback works before production
- Document rollback procedure
5. Post-Incident Review
Section titled “5. Post-Incident Review”After resolving issues:
- Document what happened
- Identify root cause
- Implement prevention
- Update procedures
Getting Help
Section titled “Getting Help”Check Documentation
Section titled “Check Documentation”- Review action and script documentation
- Verify configuration matches examples
- Check for known issues
Contact Support
Section titled “Contact Support”Provide:
- Deployment ID
- Error messages
- Target details
- Steps to reproduce
Community Resources
Section titled “Community Resources”- GitHub Issues
- Community forums
- Knowledge base
Next Steps
Section titled “Next Steps”- Monitoring - Track deployment progress
- Log Streaming - View execution logs
- Cancellation - Stop deployments
- Overview - Return to deployments overview
