Troubleshooting Playbook
Where to look first
Everything operational lands in three places (see Observability for the model):
pipeline_executions— did the run exist, and where did it stop? Admin: Observability → Executions; API:/api/pipeline-executions.logs— search bytrace_id/span_name, oraction=searchon the error text (Observability → Logs //api/logs).trigger.fired/pipeline.failedaudit rows bracket the run. Netlify function logs carry what never reached the DB (missing env vars, dispatch failures).webhook_deliveries— outbound HTTP stages and integrations (Configs → Deliveries //api/deliveries):last_error,response_status,next_attempt_at;POST /api/deliveries?action=retryre-fires an outbound delivery.
Escalating to framework support
When the fault is inside .framework/ (don't patch core) or you've run the isolation procedure and still can't name the cause:
- Report at support.spine-framework.com — the framework's support channel for consumers.
- Attach diagnostics:
npx spine-framework doctor --ticket <id>writes a sanitized diagnostic bundle intodata.diagnosticsof anitemsrow in your own project database (e.g. a ticket record your app keeps) — it does not send anything to the support site. Create or pick the ticket item first, run the command, then reference that ticket in your support report. - Include: the symptom + signature row you hit, the doctor output,
system manifestversion, and whether it's reproducible on a clean install.
Common failure signatures
Trigger-dispatched pipeline never runs
Symptom: pipeline_executions row sits at queued, no spans — until the sweeper marks it failed (~10 min) with stale execution: runner died before terminal write (swept) (.framework/functions/_shared/pipeline-runner.ts). Causes, in order of likelihood:
INTERNAL_INVOKE_SECRETunset.dispatchTriggerPipelinelogsINTERNAL_INVOKE_SECRET not set — cannot dispatch trigger pipelineand returns — the queued row is the only artifact (.framework/functions/_shared/trigger-engine.ts). Fix: set it (openssl rand -hex 32), redeploy.- Wrong
SITE_URL/URL— dispatch POSTs to{SITE_URL}/.netlify/functions/pipeline-runner-background; a mis-pointed base URL sends the run elsewhere (or times out after 5s).
integration.credential_* on generic-http
These stages run through executeOutbound with integration_slug: 'generic-http' (.framework/functions/_shared/pipeline-runner.ts). Read the audit event first — only one of them is fatal:
integration.credential_env_missingfails the call — anenv_varentry names a variable that isn't set in the function env (.framework/functions/_shared/resolve-credentials.ts). Fix the integration row (Configs → Integrations) or deploy the env var.integration.credential_missing/credential_emptywithskipped: trueare informational — no credential is configured, so the request went out with noAuthorizationheader (.framework/functions/integration-outbound.ts). If the target then 401s, the endpoint actually needs auth: set a realapi_token(source: "env_var"preferred) or passaction_config.headers.
403 for a system admin: the system-admin dead role key
record_permissions keys match roles.slug verbatim — nothing normalizes hyphens. A design schema granting "system-admin" silently denies the real system_admin role (.framework/functions/_shared/permissions.ts, the DOC-LEARNING note on resolveFirstSurfacePermissions). Valid keys are real slugs (system_admin, member, support, …) or the all wildcard. Same class of bug: a people.role_id that resolves to no role gets the default-deny result — check the people → roles join, not the UI.
member grants do nothing
member and member_admin are seeded by .framework/migrations/073_seed_member_roles.sql. On a database that predates that migration the slugs exist only when an app seeds them (install-app applies seed/roles.json) or someone creates them via /api/roles. With no member row in public.roles, record_permissions.member grants nobody anything — a guaranteed-deny that looks like a permissions bug.
Trigger never fires at all
- Event names are singular-kind +
_created|_updated|_deleted—item_created,message_updated,person_created.ENTITY_EVENT_NAMEmapsitems→item,people→person, etc. (.framework/functions/_shared/trigger-engine.ts), so a trigger configured foritems_createdorrecord_createdmatches nothing. triggers.is_activemust be true;config.entity_type,config.type_slug, andconfig.filtersfurther narrow matches — checktrigger_executionsandtrigger.fired/trigger.failedaudit rows.- The admin-data delete path does not fire
item_deletedtriggers.
HTTP 200 that is actually a denial
The envelope is always {data, error, meta}; a handler that returns (not throws) a refusal produces HTTP 200 with the denial inside data (Errors and Envelopes) — e.g. POST /api/api-keys?action=validate returns {is_valid: false, error: 'Insufficient permissions'} at 200 (.framework/functions/api-keys.ts). Inspect data/error, not just the status. Conversely, a thrown Error without statusCode maps to 500, so many 500s are intentional refusals (Invalid action or method, Record not found or access denied), not crashes — read the error text.
Edits to functions "do nothing"
netlify dev serves the assembled snapshot in .assembled/netlify/functions, not .framework/functions. Re-run npm run assemble (or restart dev:netlify) after editing function code — see Deployment.
dev:netlify fails with "Could not acquire required port"
Ports 8888 (netlify dev) and 3001 (Vite) are fixed in manifest-protected files — there is no supported alternate-port path, and moving only one side cross-connects the /api proxy to whatever still listens on 8888 (often a second Spine project's dev stack). scripts/dev-netlify.sh only kills processes it owns; find the holder (lsof -i :8888 -i :3001) and stop it yourself. Failed to fetch AI Gateway token … Unauthorized in the same output is unrelated Netlify CLI noise, not a Spine fault.
Migration state looks wrong
migrations list/status read the _spine_migrations ledger (filename, applied_at) that migrate writes and compare it against the collected files (.framework/cli/commands/migrations.ts). migrate --dry-run lists every collected file, not only pending ones, and file numbering is non-contiguous — retired migrations are removed rather than renumbered, so gaps are expected (see Migrations).
Reading pipeline_executions
| Status | Meaning |
|---|---|
pending | created via /api/pipeline-executions POST, not yet claimed |
queued | trigger reserved the row; dispatch may or may not have landed |
running | pipeline-runner-background claimed it |
completed / failed | terminal; error_message + per-stage results name the failure |
cancelled | manually cancelled via PATCH |
Any of pending/queued/running untouched for >10 minutes is swept to failed by sweepStaleExecutions — a wedged row is evidence, not the bug; find why it never reached its terminal write. Useful queries: /api/pipeline-executions?status=failed&pipeline_id=…, ?action=running, ?action=stats.
Related
- Observability — logs/executions/deliveries model
- Errors and Envelopes — the 200-wrapped-denial contract
- Security Checklist · Migrations · Deployment · Backup and recovery