mcpField
A
app-platform-troubleshooting

app-platform-troubleshooting

github.com/digitalocean-labsCloud & DevOps3891 installsUpdated 4d ago
Repository

About app-platform-troubleshooting

A troubleshooting skill for DigitalOcean App Platform developers. It guides diagnosis through live container access or log analysis, with a debug container for isolating infrastructure problems.

Key features

  1. 01Live shell diagnostics through SDK
  2. 02Runtime, build, and crash log analysis
  3. 03Infrastructure validation with debug container
  4. 04Quick references for errors and fixes

Use cases

  1. 01Investigating a deployed app through its shell
  2. 02Diagnosing failed builds or deployments from logs
  3. 03Separating infrastructure faults from app issues

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/digitalocean-labs/do-app-platform-skills --skill app-platform-troubleshooting

After installing, type/app-platform-troubleshootingin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

README.md
reference/
app-maintenance.md
debug-container.md
diagnostic-scripts.md
live-troubleshooting.md
logs-analysis.md
networking-issues.md

Details

From the project README

App Platform Troubleshooting Skill

Transform debugging from guessing to rapid diagnosis and fix.

Philosophy

Traditional: See error → Guess → Change → Push → Wait 5-7 min → Repeat
With skill:  See error → Diagnose → Fix → Verify → Commit proper fix

Quick Decision

Is the app deployed with running containers?
├── YES → Can we access the shell?
│         ├── YES → LIVE MODE (SDK shell access)
│         └── NO  → LOGS-ONLY MODE (fetch logs)
└── NO (build/deploy failed) → LOGS-ONLY MODE

Mode 1: Live Troubleshooting (Quick Start)

from do_app_sandbox import Sandbox

app = Sandbox.get_from_id(app_id="<app-id>", component="web")

# Diagnostics
app.exec("env | grep DATABASE")
app.exec("curl -v localhost:8080/health")
app.exec("ps aux | head -10")

Full guide: See live-troubleshooting.md


Mode 2: Logs-Only (Quick Start)

# Runtime logs
doctl apps logs <app_id> <component> --type run

# Build logs
doctl apps logs <app_id> <component> --type build

# Crash logs
doctl apps logs <app_id> --type=run_restarted

Full guide: See logs-analysis.md


Debug Container (Infrastructure Issues)

Deploy in ~30-45 seconds to isolate infrastructure from application:

services:
  - name: debug
    image:
      registry_type: GHCR
      registry: ghcr.io
      repository: bikramkgupta/debug-python
      tag: latest
    http_port: 8080
    envs:
      - key: DATABASE_URL
        value: ${db.DATABASE_URL}
# Run validation suite
validate-infra all
validate-infra database
validate-infra kafka

Full guide: See debug-container.md


Quick Reference: Exit Codes

CodeSignalMeaning
0-Clean exit (shouldn't exit)
1-General error
127-Command not found
137SIGKILLOOM killed
143SIGTERMGraceful shutdown

Quick Reference: Common Fixes

ProblemQuick Fix
App exits immediatelyCheck if listening on $PORT
502 errorsCheck health endpoint, verify running
Database connection failsUse Debug Container, verify trusted sources
Build failsCheck dependencies, review build logs
OOM killsUpgrade instance size
Health checks failBind to 0.0.0.0, not localhost
Slow startupIncrease initial_delay_seconds

Reference Files


When to Escalate

Contact DigitalOcean Support when:

  • Internal error persists after redeploy
  • Resource limit increases needed
  • Multiple apps affected (platform issue)
  • VPC/networking issues can't be diagnosed

Before escalating, gather:

doctl apps get <app_id> -o json > app_info.json
doctl apps logs <app_id> <component> --type run > runtime.log
doctl apps spec get <app_id> > app_spec.yaml

Integration with Other Skills

  • → deployment: After fixing, deploy proper changes
  • → devcontainers: Reproduce issues locally
  • → postgres: Database-specific configuration
  • → networking: Comprehensive networking docs

Comments

Markdown supported