:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
feat: Revert "fix(proxy): let Retry recover " (#68117)
Yasend589b6cd982c
diff --git a/frontend/src/scenes/settings/environment/ManagedReverseProxy.tsx b/frontend/src/scenes/settings/environment/ManagedReverseProxy.tsxindex 948205a6c2e7..7236b74c8707 100644--- a/frontend/src/scenes/settings/environment/ManagedReverseProxy.tsx+++ b/frontend/src/scenes/settings/environment/ManagedReverseProxy.tsx@@ -346,7 +346,7 @@ const ExpandedRow = ({ record }: { record: ProxyRecord }): JSX.Element => {{label: 'Diagnosis',key: 'diagnosis',- content: <DiagnosticReportContent report={report} record={record} />,+ content: <DiagnosticReportContent report={report} />,},]: []),@@ -487,27 +487,20 @@ const checkStatusIcon = (status: DiagnosticCheckStatus): JSX.Element => {}}-function DiagnosticReportContent({ report, record }: { report: DiagnosticReport; record: ProxyRecord }): JSX.Element {+function DiagnosticReportContent({ report }: { report: DiagnosticReport }): JSX.Element {return (<div className="flex flex-col gap-3"><div className="text-xs text-secondary">Ran {new Date(report.ran_at).toLocaleString()}</div><div className="flex flex-col gap-2">{report.checks.map((check) => (- <DiagnosticCheckRow key={check.id} check={check} record={record} />+ <DiagnosticCheckRow key={check.id} check={check} />))}</div></div>)}-// A proxy that's provisioning or being torn down can't be retried — mirror the backend guard so the-// button can't kick off a workflow that would race the in-flight one.-const RETRY_BLOCKING_STATUSES: ProxyRecord['status'][] = ['waiting', 'issuing', 'deleting']--function DiagnosticCheckRow({ check, record }: { check: DiagnosticCheckResult; record: ProxyRecord }): JSX.Element {- const { retryRecord } = useActions(proxyLogic)- const retryBlocked = RETRY_BLOCKING_STATUSES.includes(record.status)-+function DiagnosticCheckRow({ check }: { check: DiagnosticCheckResult }): JSX.Element {return (<div className="border rounded p-3 flex flex-col gap-2 bg-surface-secondary"><div className="flex items-center gap-2">@@ -528,19 +521,6 @@ function DiagnosticCheckRow({ check, record }: { check: DiagnosticCheckResult; r))}</div>)}- {check.remediation.type === 'retry' && (- <div>- <LemonButton- type="secondary"- size="small"- loading={retryBlocked}- disabledReason={retryBlocked ? 'A retry is already in progress' : undefined}- onClick={() => retryRecord(record.id)}- >- Retry- </LemonButton>- </div>- )}</div>)}</div>diff --git a/posthog/api/proxy_record.py b/posthog/api/proxy_record.pyindex 1af84763e98e..b18eb7b91d97 100644--- a/posthog/api/proxy_record.py+++ b/posthog/api/proxy_record.py@@ -324,11 +324,9 @@ class ProxyRecordViewset(TeamAndOrgViewSetMixin, ModelViewSet):return Response(serializer.data)@extend_schema(- description="Retry provisioning of a reverse proxy. "- "Available for any proxy that isn't currently being provisioned or deleted "- "(i.e. not in 'waiting', 'issuing', or 'deleting' status). This includes 'valid' "- "proxies whose diagnostics detected drift (e.g. the Cloudflare custom hostname went "- "missing). Resets the proxy to 'waiting' status and restarts the provisioning workflow.",+ description="Retry provisioning a failed reverse proxy. "+ "Only available for proxies in 'erroring' or 'timed_out' status. "+ "Resets the proxy to 'waiting' status and restarts the provisioning workflow.",request=None,)@action(methods=["POST"], detail=True)@@ -338,13 +336,9 @@ class ProxyRecordViewset(TeamAndOrgViewSetMixin, ModelViewSet):except ProxyRecord.DoesNotExist:raise NotFound()- # Retry re-runs the idempotent create-proxy workflow to re-provision. Block only the- # transitional states where a re-run would race the in-flight provision/delete; every- # settled state (valid/warning/erroring/timed_out) can be re-provisioned to recover drift.- if record.status in (- ProxyRecord.Status.WAITING,- ProxyRecord.Status.ISSUING,- ProxyRecord.Status.DELETING,+ if record.status not in (+ ProxyRecord.Status.ERRORING,+ ProxyRecord.Status.TIMED_OUT,):return Response({"detail": f"Cannot retry proxy in {record.status} state."},diff --git a/posthog/api/test/test_proxy_record.py b/posthog/api/test/test_proxy_record.pyindex 09038304d52c..db5ee55c9a17 100644--- a/posthog/api/test/test_proxy_record.py+++ b/posthog/api/test/test_proxy_record.py@@ -167,10 +167,6 @@ class TestProxyRecordAPI(APIBaseTest):[("erroring", ProxyRecord.Status.ERRORING, "Cloudflare API error"),("timed_out", ProxyRecord.Status.TIMED_OUT, None),- # Settled non-error states are retryable too, so diagnostics that detect drift on a- # live proxy (e.g. the Cloudflare custom hostname went missing) can recover via Retry.- ("valid", ProxyRecord.Status.VALID, None),- ("warning", ProxyRecord.Status.WARNING, "Cloudflare custom hostname missing"),])@patch("posthog.api.proxy_record.sync_connect")@@ -205,10 +201,12 @@ class TestProxyRecordAPI(APIBaseTest):[("waiting", ProxyRecord.Status.WAITING),("issuing", ProxyRecord.Status.ISSUING),+ ("valid", ProxyRecord.Status.VALID),+ ("warning", ProxyRecord.Status.WARNING),("deleting", ProxyRecord.Status.DELETING),])- def test_cannot_retry_proxy_in_transitional_state(self, _name, initial_status):+ def test_cannot_retry_proxy_in_non_error_state(self, _name, initial_status):record = ProxyRecord.objects.create(organization=self.organization,created_by=self.user,diff --git a/services/mcp/src/generated/proxy-records/api.ts b/services/mcp/src/generated/proxy-records/api.tsindex 31b7fdbe1a4a..8cfd8c796b10 100644--- a/services/mcp/src/generated/proxy-records/api.ts+++ b/services/mcp/src/generated/proxy-records/api.ts@@ -73,7 +73,7 @@ export const ProxyRecordsDiagnoseCreateParams = /* @__PURE__ */ zod.object({})/**- * Retry provisioning of a reverse proxy. Available for any proxy that isn't currently being provisioned or deleted (i.e. not in 'waiting', 'issuing', or 'deleting' status). This includes 'valid' proxies whose diagnostics detected drift (e.g. the Cloudflare custom hostname went missing). Resets the proxy to 'waiting' status and restarts the provisioning workflow.+ * Retry provisioning a failed reverse proxy. Only available for proxies in 'erroring' or 'timed_out' status. Resets the proxy to 'waiting' status and restarts the provisioning workflow.*/export const ProxyRecordsRetryCreateParams = /* @__PURE__ */ zod.object({id: zod.string().describe('A UUID string identifying this proxy record.'),