Incident case_9c4f21ab77e0 · billing-api / production
TypeError: Cannot read properties of undefined (reading 'unitAmountCents')
- Environment
production- Service
billing-api- Package
2026.8.14- Commit
5e9c7e1- SDK
0.4.0- Captured
Aug 29, 05:12 PM
- Occurrences
41- First seen
Aug 26, 01:49 PM- Last seen
Aug 29, 05:12 PM
Incident status is read-only here. In your own workspace this control writes the status back.
This is what ran before the throw.
Nodes on the rail sit in captured execution order. Arrows are causal claims, and each one carries where it came from.
8 of 8 shown
Drag to pan. Hold ⌘ or ctrl and scroll to zoom.Selected evidence node io-005.
Throw site
src/billing/proration.ts:118118 const unitAmountCents = prorationLines[0].unitAmountCents;The local that mattered
prorationLines = []capturedStack
3 app framescomputeProrationsrc/billing/proration.ts:118
Locals
prorationLines[]capturedsubscription{ "id": "sub_9f21ac04d7", "planId": "plan_growth_2025", "planVersion": 7, "seatCount": 24, "status": "active" }capturedcatalogVersion8capturedplanVersionSkew1derivedComputed during reconstruction from catalogVersion minus subscription.planVersion.replicaLagMs4180capturedproviderResult{ "status": "active", "priceId": "price_scale_2026_v8", "amountDueCents": 0, "latestInvoice": "in_4be21c9a77" }captured
Bound arguments
subscriptionIdsub_9f21ac04d7capturedtargetPlanIdplan_scale_2026capturedseatDelta16captured
applyPlanUpgradesrc/billing/upgrade.ts:204
Locals
chargedUpstreamtruecapturedcatalog{ "version": 8, "loadedAt": "2026-08-29T16:38:00.000Z", "priceCount": 61 }capturedidempotencyKeyupgrade:sub_9f21ac04d7:plan_scale_2026:cbb66b7cffc5captured
Bound arguments
accountIdacct_7d1e4acapturedrequestedPlanIdplan_scale_2026capturedrequestedSeats40captured
upgradeSubscriptionHandlersrc/routes/subscriptions.ts:87
Locals
actorIdusr_31c8bacapturedactorRoleorg:admincapturedrequestBody[redacted by scrub-policy/2026.06: payment_method_token]redactedThe request body carries a provider payment token, which the deny list removes before storage.
Bound arguments
subscriptionIdsub_9f21ac04d7captured
3 node_modules frames
Object.handlernode_modules/fastify/lib/handleRequest.js:133
Locals
Bound arguments
preHandlerCallbacknode_modules/fastify/lib/handleRequest.js:172
Locals
Bound arguments
Object.routeHandlernode_modules/find-my-way/index.js:428
Locals
Bound arguments
Raw I/O evidence
6 operations1GET billing:catalog:versionredis://billing-cache.iad.internal:6379/2- Start
0 ms- Duration
1.2 ms
2SELECT subscriptions BY idpostgres://billing-replica-2.iad.internal:5432/billing- Start
2.4 ms- Duration
11.8 ms
3SELECT plan_prices BY plan_id, versionpostgres://billing-primary.iad.internal:5432/billing- Start
15 ms- Duration
6.4 ms
4POST /v1/subscriptions/sub_9f21ac04d7https://api.polar.sh- Start
22.7 ms- Duration
412.9 ms
5SELECT proration_lines BY subscription_id, plan_versionSDK marked related to throwpostgres://billing-replica-2.iad.internal:5432/billing- Start
437.1 ms- Duration
5.2 ms
6SETEX upgrade:sub_9f21ac04d7 900redis://billing-cache.iad.internal:6379/2- Start
443.6 ms- Duration
0.9 ms
Request
- Method
POST- Route
/v1/subscriptions/:subscriptionId/upgrade- Status code
500- Request ID
req_f423e4004d1fa0373e27- Region
us-east-1
Headers
content-typeapplication/jsoncaptureduser-agentacme-dashboard/4.18.2capturedx-acme-accountacct_7d1e4acapturedidempotency-keyupgrade-cbb66b7cffc5capturedauthorizationBearer [redacted]redactedCredential headers are removed by policy before storage.cookie[redacted]redactedCredential headers are removed by policy before storage.
Body captured with the deny list applied: payment_method_token was removed, planId and seats retained.
Trace
- Trace ID
75063a9988d328659eaf9373acce96ec- Span ID
62c33418a8dc727e- Parent span ID
ae0c52ac01ece3f4- Tracestate
acme=billing-api:1
Process and build
- Node version
v22.23.1- Host
billing-api-7c9f4b6d8-w2xkq- Package version
2026.8.14- Commit SHA
5e9c7e1187da9e39b0d2e04c706ba8f907f5ba0e- Reported environment
production- Release
[email protected]- SDK version
0.4.0- Memory
rss 412 MB, heap 168 MB- Event loop lag
9 ms
Completeness
requestcaptured
localscaptured
bound argscaptured
IOcaptured
Measured coverage
Measured from the reconstructed evidence, not from what the SDK reported about itself.
- request
- partialOne deny-listed body field was removed before storage.
- locals
- exactEvery binding in the throwing frame was serialized within the value cap.
- io
- exactSix operations recorded, none dropped by the sequence bound.
- source
- exactThe release artifact digest matched the deployed build.
Specific gaps
request.body.payment_method_tokenRemoved by the scrub deny list before the envelope was sealed.
Agent access
https://mcp.errorcore.dev/sse- Incident ID
inc_9c4f21ab77e0- Occurrence ID
occ_6c11e6ff62fa4a9c8fa259e8e332f76cff285a190bd8a159189cb968956b69e1
MCP instruction
MCP server: https://mcp.errorcore.dev/sse
Tool: get_failure_context
Arguments: {"occurrence_id":"occ_6c11e6ff62fa4a9c8fa259e8e332f76cff285a190bd8a159189cb968956b69e1"}
Task: Investigate this failure using only the exposed, scrubbed runtime evidence.