{"record":{"id":"c79db61b9276ea6f","repo":"coollabsio/coolify","slug":"unhandled-event-type-type","errorCode":null,"errorMessage":"Unhandled event type: {$type}","messagePattern":"Unhandled event type: (.+?)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"info","filePath":"app/Jobs/StripeProcessJob.php","lineNumber":345,"sourceCode":"                case 'customer.subscription.deleted':\n                    $customerId = data_get($data, 'customer');\n                    $subscriptionId = data_get($data, 'id');\n                    $subscription = Subscription::where('stripe_customer_id', $customerId)->where('stripe_subscription_id', $subscriptionId)->first();\n                    if ($subscription) {\n                        $team = data_get($subscription, 'team');\n                        if ($team) {\n                            $team->subscriptionEnded();\n                        } else {\n                            // send_internal_notification('Subscription deleted but no team found in Coolify for customer: '.$customerId);\n                            throw new \\RuntimeException(\"No team found in Coolify for customer: {$customerId}\");\n                        }\n                    } else {\n                        // send_internal_notification('Subscription deleted but no subscription found in Coolify for customer: '.$customerId);\n                        break;\n                    }\n                    break;\n                default:\n                    throw new \\RuntimeException(\"Unhandled event type: {$type}\");\n            }\n        } catch (\\Exception $e) {\n            send_internal_notification('StripeProcessJob error: '.$e->getMessage());\n        }\n    }\n}\n","sourceCodeStart":327,"sourceCodeEnd":352,"githubUrl":"https://github.com/coollabsio/coolify/blob/70b9acc42467278373e00de77abb40684e25b395/app/Jobs/StripeProcessJob.php#L327-L352","documentation":"The switch in StripeProcessJob covers a fixed set of Stripe event types (radar.early_fraud_warning.created, checkout.session.completed, invoice.paid, invoice.payment_failed, payment_intent.payment_failed, customer.subscription.created/updated/deleted). Any event type outside that set falls through to the default branch and throws this RuntimeException. The catch block turns it into an internal notification, so the job finishes - it signals that Stripe sent an event Coolify does not act on.","triggerScenarios":"The Stripe webhook endpoint receives an event type with no matching `case`, e.g. `invoice.payment_succeeded`, `customer.updated`, or any type introduced by a Stripe API version bump.","commonSituations":"The webhook endpoint in Stripe configured to send all events instead of only the types Coolify subscribes to; Stripe API version upgrades introducing new event types; manually sent test events from the Stripe dashboard.","solutions":["Read the internal notification to see the exact event type; if it is irrelevant to Coolify (e.g. invoice or customer events), restrict the webhook in the Stripe dashboard to only the event types Coolify handles","If the event matters for billing state, update Coolify - a newer release may handle it - or add a `case` for the type in StripeProcessJob","No action if benign: the throw is already caught and only notifies"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// filter at the webhook controller before dispatching the job\n$handled = [\n    'radar.early_fraud_warning.created',\n    'checkout.session.completed',\n    'invoice.paid',\n    'invoice.payment_failed',\n    'payment_intent.payment_failed',\n    'customer.subscription.created',\n    'customer.subscription.updated',\n    'customer.subscription.deleted',\n];\nif (! in_array($event->type, $handled, true)) {\n    return response()->json(['ignored' => $event->type]); // ack so Stripe stops retrying\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["In the Stripe dashboard, subscribe the Coolify webhook endpoint only to the event types Coolify actually processes","After a Stripe API version bump, diff the new event types against the switch in StripeProcessJob","Acknowledge (200) unknown events instead of erroring, so Stripe does not retry them for days"],"tags":["stripe","webhook","event-routing","billing"],"backgroundTag":"unhandled-webhook-event-type","analyzedSha":"70b9acc42467278373e00de77abb40684e25b395","analyzedAt":"2026-08-17T01:41:01.313Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}