den-api production: POST /v1/org, GET /v1/inference-providers(/usage) 自 #4358 (PlanetScale 迁移 0097 从未应用) 之后,在 14:59Z 后就一直出现失败
作者: yomgui创建于 2026年9月11日更新于 2026年9月11日
Summary Since 14:59Z on 2026-09-11 den-api production returns 500 on POST /v1/org, GET /v1/inference-providers and GET /v1/inference-providers/usage. Root cause: migration 0097_gateway_access_matrix from #4358 has never applied to production PlanetScale — the Den DB Migrate workflow has failed on every run since the #4358 push (14:49Z) and every 30-minute self-heal tick since — while the den-api code from #4358 already reads the renamed/new gateway_* tables. A second, shorter incident at ~16:41Z (den-api + gateway fatal at boot, DEN-API-3W / INFERENCE-6) was an env change: GATEWAY_ENABLED=true set on both Render services without a valid GATEWAY_PUBLIC_BASE_URL; corrected by ~16:47Z. Not caused by the API-quality stack (#4475, #4700–#4705, #4707): none of those 8 commits touch any file, table, migration or env var involved. ## Sentry issues (project den-api, environment=production) | Issue | First seen | Release | Transaction | Failing table | Source | --- | --- | --- | --- | --- | --- | DEN-API-3V | 14:59:20Z | 4fa023235 (#4358) | POST /v1/org | gateway_keys | gateway-keys.ts ensureMemberGatewayKey ← orgs.ts createOrganizationRecord | DEN-API-3W + INFERENCE-6 | 16:41:30Z | 667b450fd | boot (fatal) | — | ee/packages/utils/src/gateway-env.ts gatewayOrigin ← parseGatewayDeploymentEnv | DEN-API-3X | ≤16:47Z | 667b450fd | GET /v1/inference-providers | gateway_providers | routes/org/inference-providers.ts | DEN-API-3Y | 17:08:27Z | 667b450fd | GET /v1/inference-providers/usage | gateway_request_logs | routes/org/gateway-usage.ts | 3V is on release 4fa023235 — i.e. it started on the #4358 deploy itself, before #4888 (667b450fd, merged 15:50Z) existed. #4888 is unrelated. ## Evidence: Den DB Migrate failures gh run list --workflow den-db-migrate.yml: success at 13:29, 13:54, 14:29Z; failure at 14:49:16Z (push, 4fa023235) and every scheduled tick after (14:53, 15:28, 15:53, 16:30, 16:53, 17:26Z). First run (34612414683) — 0095 and 0096 applied, then 0097's embedded preflight fails because Vitess routes the INSERT … SELECT … FROM information_schema.tables to the primary keyspace and strips the qualifier: DrizzleQueryError: Failed query: INSERT INTO __gateway_0097_preflight (failure) SELECT '0097_requires_complete_0096_schema' WHERE (SELECT COUNT() FROM information_schema.tables … cause: target: .-.primary: vttablet: Table '.tables' doesn't exist (errno 1146) (sqlstate 42S02) Sql: "select :vtg1 from dual where (select count() from tables where table_schema = database() …" Every retry since (e.g. 34627695206) fails one statement earlier — drizzle's MySQL migrator runs inside a transaction and Vitess refuses the temp-table DDL there: CREATE TEMPORARY TABLE __gateway_0097_preflight (… errno: 1105 sqlMessage: 'target: .-.primary: vttablet: DDL statement executed inside a transaction' Replies starting at 0097 (not 0095) confirm …
内容来源: different-ai/openwork