Host 500s every request on non-base domains when GET /api/tenants/bindings 404s — no fallback, and no runtime ships the route
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 42/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- typescript
- 領域
- api, backend, infrastructure
調査の方向性
Start with host/src/services/binding-resolver.ts, then check the deployed API contract and the api plugin documentation in skills/api-and-auth. Trace how a missing bindings route and an unrecognized Host header affect resolution, and inspect the base-host matching behavior for www aliases. Done when the reported non-base domains serve successfully and the runtime provides the bindings route or handles its absence as requested.
索引モデルが issue の本文から書いたものです。
説明
Environment
- Child runtime:
bos://nearbuilding.near/nearbuilders.org(extends: bos://dev.everything.near/everything.dev),platform: 2.0.0-rc.27 - Host image:
ghcr.io/nearbuilders/everything-dev:v2.0.0-rc.27, host bundle gitShab86f6407cdb75441c7176065a157c4d832f42562(version manifest405e6695ffee5c1fon cdn.everything.dev) - Serve via the Railway template per the self-deploy guide
Symptom
Viewing the deployed app through anything other than the runtime's configured domain returns 500 on every page:
Tenant bindings unavailable (cached failure, 6s remaining) — last fetch of http://localhost:8080/api/tenants/bindings failed
(localhost:8080 is the host's in-container API; the failure is real, not a client echo.)
The API itself is healthy — GET /api/_health returns status: "ready" with all plugins loaded. Sending the gateway host header serves the app fine:
$ curl -H "Host: nearbuilders.org" https://app-production-5363.up.railway.app/ # → 200, full page
$ curl https://app-production-5363.up.railway.app/ # → 500
$ curl https://app-production-5363.up.railway.app/api/tenants/bindings # → 404 Not Found
Root cause (host/src/services/binding-resolver.ts, as built into the rc.27 host bundle)
createBindingResolver.resolve()treats any hostname that failsisBaseHostas a tenant lookup and callsensureBindingsLoaded().isBaseHostis an exact match:hostname === gatewayId || hostname === "localhost" || hostname === "127.0.0.1".fetchBindingsFromApi()throws on any non-OK response:GET ${endpoint} failed with HTTP ${status}.- On failure with no stale entries to fall back on, the failure is cached (
failedUntil: Date.now() + FAILURE_TTL_MS) and rethrown — turning into a site-wide 500 for every non-base-host request (this is theTenant resolution is unavailablecase inskills/super-appandskills/extends-config). - No deployed runtime actually exposes
GET /api/tenants/bindings. The base runtime's own production API returns 404 for it (https://everything.dev/api/tenants/bindings→ 404), and child APIs built from the rc.27 scaffold have no tenants contract either (our published API spec has 90 paths, none tenant-related) —everything.devitself serves 200 only because requests there match the base domain and never enter tenant resolution.
Impact
- Every self-deployed child runtime is one unrecognized
Hostheader away from a full site 500 — e.g. before the real domain is attached in DNS, the Railway (*.up.railway.app) URL is unviewable. www.<domain>also failsisBaseHost's exact match, so standard www→apex setups will trigger tenant lookup too.
Asks
- Graceful degradation: a 404 from the bindings endpoint should mean "no tenants configured" — resolve to an empty map (warn log) and serve the base runtime for unrecognized hostnames, rather than 500ing the request. (503 keeps the current "API plugin failed to load" hard error; the two failure modes can stay distinct.)
- Ship the route: the host expects
GET /tenants/bindingson the platform API, but no published runtime ships it — either the base runtime API exposes it, or the scaffold's api contract includes thetenantstable + lookup routes (skills/api-and-authalready documents "theapiplugin owns thetenantstable and exposes public lookup routes"). isBaseHost: relax exact-match so conventionalwww.aliases resolve as the base runtime (or provide a redirect path).
Repro
Deploy any child runtime per docs/self-deploy.md (Railway template, BOS_ACCOUNT/BOS_GATEWAY), then open the *.up.railway.app URL, or:
curl -H "Host: <gateway>" <deploy-url>/ # 200
curl <deploy-url>/ # 500
curl <deploy-url>/api/tenants/bindings # 404
- 主要言語
- TypeScript
- スター
- 5
- フォーク
- 3
- 平均マージ
- 9時間 37分
- マージ済み PR(30日)
- 157
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
NEARBuilders/everything-dev のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
NEARBuilders/everything-dev#628 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
NEARBuilders/everything-dev#400 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
NEARBuilders/everything-dev#667 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 42/100
NEARBuilders/everything-dev#666 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
NEARBuilders/everything-dev#664 ·
メンテナーはふだん 1 日以内に返信
NEARBuilders/everything-dev の issue をすべて見る
似ている issue
-
area:cli bug P4
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
bug from-studio
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
esengine/DeepSeek-Reasonix#14868 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
linxiv-dev/linXiv#384 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
scope:core type:security
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
mailgun/mailgun.js#544 ·