My Space has been stuck in the building state for over an hour

:frowning: Is there something wrong on your end?

1 Like

ummm hel[p

1 Like

I don’t think there are any major issues on the HF infrastructure side at the moment…

Among problems that can be resolved at the code level, one that occasionally occurs is when the build progresses but never finishes. This can happen when the build of a specific library fails, causing it to get stuck in a loop of rebuilding.


Triage checklist for a Space stuck in Building

1) Rule out a platform-wide issue (30 seconds)

  • Check Hugging Face status: Spaces / Spaces Proxy should be “Operational”. (Hugging Peace Status)
    If there’s an incident, waiting is usually the only “fix”.

2) Identify where it’s stuck (most important)

Open your Space → Logs tab (this is the main way to debug; SSH isn’t generally available). (Hugging Face Forums)

Then classify:

A) Build logs are empty (or nothing changes for a long time)

This often indicates an infra/queue/scheduler problem (“stuck building/no logs” is a common report). (Hugging Face Forums)

Actions (in order):

  1. Restart this Space (top of page)
  2. No-op commit (edit README.md and commit) to force a fresh build
  3. Factory reboot from Settings (rebuilds without cached requirements). (Hugging Face Forums)

If a brand-new blank Space also has empty build logs, it strongly suggests platform-side or account-side issues (not your repo).

B) Build logs show activity, but it’s slow

Look for long-running steps like:

  • dependency installation / compiling wheels
  • large downloads during build

If it’s consistently slow/hanging at the same step, treat it as a reproducible build problem (dependency pinning, removing heavyweight installs, etc.).

C) Build logs finish, but status stays “Building”

Check Container / runtime logs (same Logs area). This usually means “built OK, but the app crashes or never starts.”


3) Validate Space configuration (common silent failure)

Confirm your README.md YAML block is correct (SDK, app_file, python_version, etc.). The full list of supported keys is here. (Hugging Face)
Misconfigured sdk / missing app_file can prevent a proper launch even if the repo “looks fine”.


4) Check secrets and required environment variables

If your app expects API keys or other env vars, confirm they’re set in Settings → Secrets (missing secrets often show up as runtime crashes). (Hugging Face)