---
name: serverless-debugging-b91f79fd44c2
description: Debug serverless and edge functions—limited logs, cold starts, timeouts, env/config mismatches. Use for Lambda, Cloud Functions, Workers, Vercel/Netlify functions. Triggers: "serverless", "Lambda", "edge function", "cold start", "function timeout".
---

# Serverless Debugging

Systematic debugging when traditional server logs and SSH are unavailable. Complements `test-failure-triage` with environment-specific constraints.

## When to use

- Intermittent 5xx from functions
- Timeout or memory limit errors
- Works locally but fails when deployed

## When not to use

- Long-running container services with full shell access
- Client-only bugs (use browser DevTools skills)

## Workflow

1. **Reproduce** — identify trigger (HTTP event, queue, schedule)
2. **Logs** — cloud provider log group/stream; filter by request ID
3. **Config** — compare env vars/secrets: local vs deployed (names only, never log values)
4. **Limits** — timeout, memory, payload size, concurrency
5. **Cold start** — init duration, heavy imports, VPC ENI delay
6. **Dependencies** — outbound network, IAM permissions, region mismatch
7. **Minimal fix** — smallest change; redeploy; verify with structured log line

## Common failure modes

| Symptom | Likely cause |
|---------|----------------|
| Task timed out | Slow downstream, missing async, too much work in handler |
| Cannot find module | Bundle/packaging; wrong runtime |
| Access denied | IAM role, resource policy |
| Connection timeout | VPC/subnet/NAT; wrong security group |
| Works once then fails | State in `/tmp`; connection pool reuse |

## Practices

- Structured JSON logs with `requestId`, `stage`, `durationMs`
- Fail fast on missing required env with clear error message (no secret values)
- Use X-Ray or vendor tracing for cross-service calls
- Keep handlers thin; push heavy work to async queues when needed

## Related skills

- `dynamic-config-management` — env validation
- `observability-slo` — alerts and SLOs for functions
- `gstack/investigate` — general root-cause discipline

*Clean-room workflow for serverless environments.*


---
Source attribution: charlieviettq
Original project: https://github.com/charlieviettq/awesome-agent-skill/blob/c567ae426d55fa498e919fc0f5a37c582d5c7a2c/.cursor/skills/reliability-ops/serverless-debugging/SKILL.md
License: MIT
License information: https://opensource.org/license/mit
Original upstream instructions; downloaded from Dave AI.

## Upstream license notice

MIT License

Copyright (c) 2026 charlieviettq

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.



# Dave AI resource metadata

Creator / publisher: charlieviettq
Original project: https://github.com/charlieviettq/awesome-agent-skill/blob/c567ae426d55fa498e919fc0f5a37c582d5c7a2c/.cursor/skills/reliability-ops/serverless-debugging/SKILL.md
Attribution basis: Source repository record

Fields of work: Development & Engineering
Roles: DevOps / SRE, Backend Developer, Full-Stack Developer
Specialties: Backend
Tools: AWS, GCP, Vercel, Netlify
Country applicability: Country not specified
Classification basis: Source category, role and specialization labels
Instruction SHA-256: 1b74927bfbc9446e4ec13039778c2c931d4b2ae4935e8433315919c7669aa815
