# RepoSpace — FIX-DISASTER **Date:** 2026-10-03 17:40 PT (Europe/Berlin) **Space:** https://huggingface.co/spaces/2Btainment/repospace **App:** https://2btainment-repospace.hf.space **Verified runtime / Space commit:** `20df9002264cec9e184389a3d45c09b7fc4e2471` **Local git fix commit:** `c46ea3a817864c68aedec3b9a70c1fff23cf0812` **Stage when verified:** RUNNING (replica after this build; Python 3.12.15, Node 22.23.3) ## What users actually hit The landing page was fine (dark Einswarm UI, `GET /` 200). The preview loop was not. 1. **Every Node repo died during `npm install`.** A 1024 MB `RLIMIT_AS` was applied to the sandbox. V8 aborts when it cannot reserve virtual address space, even if RSS is ~10 MB. Live log from `heroku/node-js-getting-started` on the previous revision: `FATAL ERROR: NewSpace::EnsureCurrentCapacity Allocation failed - JavaScript heap out of memory` then `RuntimeError: npm install failed with code -6` (SIGABRT). Status went `failed`. The iframe never appeared. 2. **Many non-static repos showed the wrong page (or a blank shell).** Detection served the first nested `index.html` it found. `heroku/python-getting-started` (Django) was marked `running` / `static` because of `hello/templates/index.html`. The iframe returned HTTP 200 of the raw template (`{% extends "base.html" %}`), not the app. The same early check treated CRA/Vite `public/index.html` as a finished site, so the preview was an empty shell instead of `npm install` + build. 3. **False 429 on create after a restart.** SQLite rows left in `pending` / `building` / `running` still counted toward `MAX_CONCURRENT_SESSIONS` even when no process existed. `POST /api/sessions` mapped that to **429** `Too many concurrent sessions`. Status/log polls were already on a separate 600/min budget (previous commit); a 25-request burst on this build stayed **200**. ## Fix - Do not set `RLIMIT_AS` unless `REPOSPACE_AS_MB` is at least 4096. Default is off. Wall-clock build/start timeouts still apply. CPU rlimit default is off so a live server is not SIGXCPU'd. - Detect order: prebuilt `dist/` `build/` `out/` only, then `package.json`, then Python (including `manage.py`), then a real static `index.html`. Skip `templates/`, `public/` when a Node app exists, and HTML that contains `{%`, `{{`, or `