Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Bundle-upload origin should default to the platform upload service — preflight accepts app hosts and fails late with a bare 404

Aperta
#666 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
42/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
cli, devops

Direzione di ricerca

Start with services/deploy/cdn.ts and trace how resolveCdnDeployInputs chooses storageOrigin; compare that with the cdn.origin mapping described in the issue. Read probeStorageOrigin and the login flow in handlers/keys.ts, then check the relevant deploy tests and docs/self-deploy.md. Done means deploy selects the upload service for the platform runtime and rejects an app-site origin before the build with an actionable message.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Environment

  • CLI: everything-dev 2.0.0-rc.27 (bos deploy, interactive, macOS)
  • Session created by bos login --key --site https://everything.dev
  • Runtime: child (extends: bos://dev.everything.near/everything.dev), publishing gateway preview.nearbuilders.org (first publish)

Symptom

bos deploy builds all 12 workspaces, passes preflight, then fails at the first upload leg:

✗ Deploy failed
  Error: [upload] bundle upload for ui failed: 404 Not Found

The uploads went to the app site, not the upload service. Resolution chain in services/deploy/cdn.ts (resolveCdnDeployInputs):

BOS_STORAGE_ORIGIN env  →  session.siteUrl  →  https://<gateway>

With no env var and a login session pinned to --site https://everything.dev, storageOrigin becomes https://everything.dev. Preflight passes because probeStorageOrigin() only checks GET /health → "OK"/empty and GET /.well-known/mcp.json — an app host running the platform API answers both. But bundle uploads POST /api/storage/bundles, which per ADR 0027 is served only by the standalone upload service (https://upload.everything.dev); the app host returns a bare 404 Not Found (non-retryable, non-JSON body, no hint about the actual problem).

BOS_STORAGE_ORIGIN set on the bos login command does not help — the CLI's login flow (handlers/keys.ts) never reads or persists it; only siteUrl (from --site) is stored, and it silently becomes the deploy's upload origin.

Impact

  • Interactive/self-deployed uploads require a per-command BOS_STORAGE_ORIGIN=https://upload.everything.dev prefix (and bos deploy does not load .env — only dev/start flows do), so it is easy to lose and easy to misunderstand.
  • The failure surfaces late (after the full build) with a body of 404 Not Found and no actionable hint.
  • The same weakness applies to the resolved-fallback https://<gateway> — a gateway origin upload is refused per the docs, but only at this late stage.

Asks

  1. Default the upload origin to the platform upload service. When the runtime extends the base platform / inherits cdn.origin: https://cdn.everything.dev, default storageOrigin to https://upload.everything.dev (the standalone write/control service for that CDN) instead of the session siteUrl. Interactive self-deploys then need no env vars at all.
  2. Persist a storage origin at login (or resolve it at deploy time from the platform release manifest / cdn.origin mapping) rather than reusing the session's siteUrl, which is an app site by design.
  3. Strengthen probeStorageOrigin to verify upload capability before the build (e.g. the storage service exposes an identity/capability route, or probe POST-ability of /api/storage/bundles with an empty payload) and fail fast with an actionable message ("your login is pinned to an app site; set BOS_STORAGE_ORIGIN=https://upload.everything.dev").
  4. Load .env in bos deploy (currently only bos dev/bos start flows do, via env/project-env.ts) so per-project defaults work — or document that the var must be exported per command.
  5. Docs: BOS_STORAGE_AUTH_ORIGIN is an upload-service server-side var (apps/upload/src/auth.ts), but its name invites pasting into client CLI commands, where it is a silent no-op (I did exactly that). A client/server var split in docs/self-deploy.md would help.

Repro

bos login --key --site https://everything.dev   # pins session.siteUrl = app site
bos deploy                                       # → builds fine, then:
# [upload] bundle upload for ui failed: 404 Not Found
# origin used: https://everything.dev/api/storage/bundles (app host)

BOS_STORAGE_ORIGIN=https://upload.everything.dev bos deploy   # works
Lingua principale
TypeScript
Stelle
5
Fork
3
Merge medio
9h 37m
PR unite (30g)
157

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di NEARBuilders/everything-dev

Tutte le issue di NEARBuilders/everything-dev

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.