Cannot restart my private space: "503. Something went wrong when restarting this Space."

Space: https://huggingface.co/spaces/Ark-kun/tangent

Tried Restart.

Tried Factory rebuild.

Nothing works.

The Space worked fine before for a minute, then stopped abruptly and cannot be restarted anymore.

503

Something went wrong when restarting this Space.

Request ID: Root=1-6a42562f-1dfaffa84dbd985f5b11284a

Hmm… with only a 503 error, it is hard to narrow this down. If you can see a concrete error in the build or container logs, there may be cases where this can be fixed from the user/repo side. But if no useful logs appear, issues like this often need Hugging Face support to check the Space from their side, e.g. via website@huggingface.co:


I would first separate this into two different situations:

  1. The Space is actually reaching the build/container phase, and the UI logs show a concrete error.
    In that case, this may still be fixable from your side: dependency error, missing secret, wrong port, startup timeout, app crash, etc.

  2. Restart / Factory rebuild fails, but no new Build or Container logs appear at all.
    In that case, I would stop treating it as only an application-code problem. It may be stuck before your app code is even reached: Space lifecycle state, scheduling/build dispatch, stale runtime state, or a policy/lock state that only HF staff can inspect.

Since your Space is private, other forum users cannot see the source, app, logs, or settings. So the most useful next step is not more guessing, but checking what the Space UI shows and whether the logs actually move.

1. First GUI checks I would do

From the Space page, I would check these first, without using CLI/API yet:

Where in the UI What to check Why it matters
Space status / badge Paused, Building, Preparing, Starting, Running, Runtime error, etc. Tells whether the Space is failing before build, during build, during startup, or after startup.
Open Logs Whether Build logs or Container logs update after Restart / Factory rebuild This is the most important split.
Settings Whether Restart / Factory rebuild fails immediately or after some time Immediate failure can mean the operation is not reaching the normal build/container phase.
Files / README.md sdk, app_file, python_version, sdk_version, and Docker app_port if applicable Config mistakes can cause normal build/startup failures.
Warning banners Words like flagged, abusive, disabled, suspicious, quota, capacity, etc. If the UI explicitly shows a lock/policy/quota condition, code edits may not be enough.
Hardware indicator / Settings page Whether hardware/settings controls load normally or spin/fail If settings/runtime metadata is stuck, it may be above the app layer.

Hugging Face’s Docker Space guide shows the normal UI debugging path: use Open Logs, then check the Build tab and Container tab. In a normal Docker Space, Build logs should show build/image/scheduling steps, and Container logs should show the running server status such as Uvicorn running on http://0.0.0.0:7860.

References:

2. Main split: do the Build or Container logs move?

The key question is:

After you click Restart or Factory rebuild, do the Build logs or Container logs get a new timestamp / new lines?

That single observation changes the interpretation a lot.

Observation What I would suspect first
Build logs update and show a dependency/build error Repo/build configuration issue
Build succeeds, Container logs show traceback/crash Runtime/app issue
Container logs show app started but Space is still unhealthy Port/bind/startup/health/routing issue
Build logs do not update at all Build dispatch / scheduler / Space state issue
Container logs do not update at all Container may never be started
Restart and Factory rebuild both immediately return 503 The failure may be happening before normal build/container startup
A new commit does not start a new build More evidence that this may be above the app-code layer

If logs move, there is usually something actionable from the repo side.

If logs do not move, repeatedly editing random files may not help much, because the new code may not be getting built or run at all.

Related examples with similar symptoms, not necessarily the same root cause:

These links are only comparable reports / references. They do not prove that your Space has the same cause.

3. Cases that may still be fixable from your side

If the UI logs show a concrete error, I would first treat it as a normal repo-side or runtime-side issue.

Common repo-side cases:

Log area Possible user-side fix
Build logs Fix requirements.txt, pyproject.toml, apt.txt, Dockerfile, package versions, Python version, missing files, wrong casing
Container logs Fix Python/Node traceback, missing imports, missing environment variables, missing secrets, auth errors
Startup/health Make sure the app listens on the expected host/port and becomes ready in time
Model/data loading Avoid downloading huge files at every startup; move large downloads to build time if possible
Permissions/cache Fix write paths and cache directories, especially in Docker Spaces

For Docker Spaces, I would specifically check:

  • Does README.md have sdk: docker?
  • If using a custom port, does README.md have the correct app_port?
  • Does the app actually listen on that same port?
  • Does it bind to 0.0.0.0, not only 127.0.0.1?
  • Does the root endpoint return quickly enough?
  • Are required secrets/variables configured in Space Settings?

HF’s Docker docs say that the default Docker Space port is 7860, and app_port can be set in the README YAML block. The first Docker Space tutorial also uses uvicorn ... --host 0.0.0.0 --port 7860, which is a useful pattern to compare against.

Useful official references:

Also check startup time. The config reference documents startup_duration_timeout, which is the maximum time the Space is allowed to start before being considered unhealthy. It also documents preload_from_hub, which can help when large models/files would otherwise be downloaded at runtime.

Relevant docs:

4. Cases where editing code may not be enough

If all of these are true:

  • Restart returns 503.
  • Factory rebuild also returns 503.
  • Build logs do not get new lines.
  • Container logs do not get new lines.
  • A new commit does not trigger a new build.
  • The Space stays Paused, Building, Preparing, or Starting.
  • The UI only gives a Root=... request ID.

Then I would not assume the app code is the main thing to debug.

That pattern suggests the failure may be happening before the application is actually built or started. Possible categories are:

Category What it would look like
Build dispatch / scheduler state No new build starts, logs stay stale/empty
Runtime-control / lifecycle state Restart/factory rebuild cannot transition the Space out of a stuck state
Stale runtime metadata UI/status/runtime state does not match the latest repo state
Policy/lock/quota/capacity condition UI or internal runtime state blocks restart/build
Wider infrastructure incident Multiple users report similar failures around the same time

This is where HF staff/support may need to look at server-side state. The community can help interpret public logs and config, but it cannot inspect HF’s backend scheduler/runtime state for a private Space.

The Root=... value is still useful. I would save it together with the exact UTC time and action that produced it, because it may help HF trace the failed backend request. But forum users generally cannot decode that ID by itself.

Also, checking the HF status page can be useful. A green status page does not rule out a Space-specific stuck state, but if there is an active Spaces/Spaces Proxy incident, that changes the interpretation.

5. One branch to check only if the UI explicitly says so: flagged / policy / lock state

I would not assume this from the 503 alone.

However, if the Space UI, logs, or runtime information explicitly says something like:

  • flagged
  • abusive
  • disabled
  • suspicious
  • policy
  • RepoScanner
  • Cloudflare
  • tunnel
  • proxy

then code edits alone may not fully unblock the Space.

There are forum reports where Spaces became paused/blocked and restart/factory rebuild did not recover them until HF-side review. Again, this is only a branch to check if the UI/runtime explicitly shows such wording.

References:

If there is no such warning text, I would not lead with this hypothesis.

6. What I would include if contacting HF support/staff

If the UI does not show useful logs and both Restart and Factory rebuild fail, I would collect a small evidence bundle instead of repeatedly pressing restart.

Useful evidence:

Item Example
Space URL https://huggingface.co/spaces/Ark-kun/tangent
Visibility Private
Exact failed action Restart / Factory rebuild / new commit / hardware change
Error text 503. Something went wrong when restarting this Space.
Root request ID Root=...
UTC timestamp Exact time when the error appeared
Current UI status Paused / Building / Starting / etc.
Build logs Whether they updated after restart/factory rebuild
Container logs Whether they updated after restart/factory rebuild
Last visible log timestamp Helps show whether logs are stale
Warning banner text Only if visible
Safe screenshot Only if it does not expose secrets/tokens/private data

Short version to send:

My private Space cannot be restarted. Restart and Factory rebuild both return 503. No new Build/Container logs appear after the action. Here is the Space URL, Root request ID, UTC timestamp, current UI status, and the last visible log timestamps. Could you check whether the Space is stuck in scheduler/runtime-control/policy state?

Important: do not paste tokens, secrets, private credentials, or sensitive log lines publicly.

7. Optional fallback: CLI/API, but I would not make it the first step here

The UI checks above should probably come first, especially because this is a private Space and CLI/API access requires authentication.

If the UI is not enough, the owner can also use the Hub API or CLI. This is more precise, but it requires a token with access to the private Space.

Official docs:

Optional CLI checks:

hf spaces logs Ark-kun/tangent --build -n 100
hf spaces logs Ark-kun/tangent -n 100

Optional Python check:

from huggingface_hub import HfApi

api = HfApi(token="hf_xxx")  # do not post this token publicly
rt = api.get_space_runtime("Ark-kun/tangent")

print("stage:", rt.stage)
print("hardware:", rt.hardware)
print("requested_hardware:", rt.requested_hardware)
print("raw:", rt.raw)

For a public forum thread, I would only paste the non-sensitive parts, and redact anything private.

So my practical suggestion would be:

  1. Use the Space UI first.
  2. Open Logs and check both Build and Container tabs.
  3. Note whether either log gets a new timestamp after Restart / Factory rebuild.
  4. Check Files / README.md for SDK/config issues.
  5. Check Settings and any warning banner.
  6. If no logs move and both restart actions return 503, collect the Root ID + UTC timestamp + UI state and ask HF support/staff to inspect the Space state from their side.

The most important distinction is:

  • Logs show a concrete error → likely still worth debugging from the repo/config side.
  • No new logs appear at all → likely not enough evidence for code debugging; HF-side inspection may be needed.

I think there is enough information in my post. The “503. Something went wrong when restarting this Space.” is a known HF-issued error that is user-unfixable. This is why I included the “Request ID: Root=1-6a42562f-1dfaffa84dbd985f5b11284a”

Restart / Factory rebuild fails, but no new Build or Container logs appear at all.
In that case, I would stop treating it as only an application-code problem. It may be stuck before your app code is even reached: Space lifecycle state, scheduling/build dispatch, stale runtime state, or a policy/lock state that only HF staff can inspect.

This is my case.
There are no build logs. The builds are not even triggered. The Space looks completely disabled.

HF-side inspection may be needed.

This is why I’ve created this thread to get help from the HF staff.

Um? here is a forum for users to communicate with each other. For example, in rare cases where the issue is caused by a widespread infrastructure problem, HF staff might check it out or take action, but that’s more of an exception.

Well, if it’s an infrastructure issue, it might resolve itself if you just wait.
However, if it’s an individual account-level issue, it generally won’t be resolved unless you contact support via email
If you haven’t already, I recommend contacting support first.

Thank you a lot for the support and suggestions, @John6666 .

I tried to create another similar space and it was too irrecoverably Paused after a minute.
I made it public: Tangent - a Hugging Face Space by Ark-kun
I’ve tried to switch from free CPU to a paid version. But HuggingFace still does not let me restart the Space.

I’ve sent a mail to HF support couple a day+ ago, but did not get a reply.

Nice. But, Oh, Uh, please look at this URL: https://huggingface.co/api/spaces/Ark-kun/tangent-1/runtime. Since it says Flagged as abusive, that means the Space has been deliberately paused by Hugging Face-side systems, not just accidentally broken by the app. So I think repeatedly creating similar duplicates is risky. Details:


The important part is the runtime API, not the 503 page

The restart dialog shows a generic 503, but the runtime API gives the more specific state:

{
  "stage": "PAUSED",
  "hardware": {
    "current": null,
    "requested": "cpu-upgrade"
  },
  "gcTimeout": 300,
  "errorMessage": "Flagged as abusive",
  "replicas": {
    "requested": 1
  },
  "devMode": false,
  "domains": [
    {
      "domain": "ark-kun-tangent-1.hf.space",
      "stage": "READY"
    }
  ]
}

So I would treat this as:

Space state: PAUSED
Runtime message: Flagged as abusive
Likely owner of the next action: Hugging Face-side review

not as:

normal Python crash
normal Docker build failure
normal app_port mismatch
normal hardware allocation problem

This does not prove malicious intent. It also does not tell us which file, dependency, route, command, or behavior triggered the flag. But it does mean that normal rebuild/debug actions are probably not the main path anymore.

Practical decision tree

Observation Meaning Practical next step
Runtime API says stage: PAUSED and errorMessage: Flagged as abusive The Space is in a HF-side flagged/paused state Ask HF to review/unpause; include the runtime API output
UI restart/factory rebuild returns 503 Expected symptom once the Space is held in a paused/flagged state Do not treat the 503 itself as the root cause
Hardware change does not help Consistent with a flag/state issue rather than resource shortage Stop switching hardware as the main fix
A similar duplicate also becomes paused quickly The code/pattern/account state may be re-triggering the flag Avoid repeated full duplication
Build/container logs update and show real errors Then it may still have app-level issues too Debug those only after the flagged state is resolved
Runtime API does not show abuse wording in some other case Then use the normal build/container/healthcheck decision tree Debug logs, port, startup timeout, etc.

For this specific Space, the first row is the key one.

Recommended next move

I would reply to the HF support email thread, or send a new concise request to website@huggingface.co, with the runtime API output included.

Use the runtime API output as the main evidence. Something like:

Subject: Space stuck in PAUSED state - runtime API says "Flagged as abusive"

Hi Hugging Face team,

My Space appears to be stuck in a Hugging Face-side flagged PAUSED state.

Space:
https://huggingface.co/spaces/Ark-kun/tangent-1

Runtime API:
https://huggingface.co/api/spaces/Ark-kun/tangent-1/runtime

The runtime API currently shows:

stage: PAUSED
hardware.current: null
hardware.requested: cpu-upgrade
errorMessage: Flagged as abusive
domain: ark-kun-tangent-1.hf.space
domain stage: READY

The UI restart/factory rebuild actions return 503. Switching hardware and creating a similar Space did not resolve the issue.

If this was triggered by an automated scanner or abuse handler, I believe it may need manual review. The intended purpose of the Space is:

...

It is not intended to provide proxy, tunnel, relay, scraping, spam, remote-browser, or restriction-bypass functionality.

If any part of the implementation is not acceptable on Spaces, please let me know what needs to be removed or changed.

Could you please review whether this is a false positive and, if appropriate, clear or unpause the Space?

Thanks.

The key sentence is:

The runtime API says: "errorMessage": "Flagged as abusive".

That is much more actionable than only saying “restart gives 503”.

Why I would avoid repeated duplication now

The duplicate test was useful once, because it showed that the problem may not be a one-off broken Space record.

But now that the runtime API explicitly says Flagged as abusive, repeatedly creating similar Spaces is risky.

From HF’s side, repeated near-identical Spaces after a flag may look like an attempt to work around a platform-side pause, even if your intent is only debugging.

So I would avoid:

- repeatedly cloning the full Space
- repeatedly switching hardware hoping it clears the flag
- pushing many empty commits
- renaming/rearranging the same functionality just to get past the scanner
- creating many near-identical Spaces while the original is still flagged

A small diagnostic reproduction can still be reasonable, but it should be clearly minimal and documented as a debugging test.

Example of a safer diagnostic test:

Minimal test:
- Docker Space
- nginx only
- static page only
- same app_port
- no writable terminal
- no agent TUI
- no shell-like UI
- no proxy-like routes

If that minimal Space runs normally, then the basic Docker/nginx/app_port setup is probably not the trigger.

Then add one component at a time only if needed, and stop if the flag appears again.

Why this repo may look sensitive to an automated scanner

This is not a judgement about intent. It is only a likely scanner/trust-and-safety interpretation.

The Space appears to expose browser-accessible terminal / coding-agent style interfaces through nginx and WebSocket routes. That kind of structure can resemble a remote management or proxy-like environment from a platform scanner’s point of view.

Sensitive-looking ingredients include:

writable web terminal
ttyd / websocket terminal
nginx proxy_pass routes
WebSocket upgrade routes
browser-accessible shell-like interface
remote coding-agent TUIs
multiple agent/tool routes exposed behind nginx

That is quite different from a normal Gradio/Streamlit demo that exposes one app workflow.

Hugging Face’s Content Policy lists “Platform Abuse, Security Violations and Spam” examples including unauthorized bot APIs or remote management tools, Cloudflare Tunnel, TOR, proxies, VNC, Chrome Remote Server, and similar restriction-bypass patterns.

This does not prove that this Space violates the policy. But it explains why the current design may be easy for an automated scanner to classify as risky.

So I would frame the support request as:

I understand why this may look sensitive. Here is the legitimate use case. It is not intended as a proxy/tunnel/relay/scraper/spam/remote-browser/restriction-bypass service. Please review and tell me what needs to be changed.
What we can conclude vs. what we still cannot conclude

What we can conclude from the public runtime API:

stage: PAUSED
errorMessage: Flagged as abusive
hardware.current: null
hardware.requested: cpu-upgrade

So this is not merely a generic app-level 503.

What we cannot conclude from outside:

which internal rule triggered
which exact file triggered
whether ttyd alone triggered it
whether nginx proxy routes triggered it
whether an agent package triggered it
whether the flag is a false positive
whether HF will approve the design after review

Only HF can see the internal moderation/scanner/backend reason.

The most accurate public wording is probably:

The runtime API confirms that the Space is flagged as abusive. Whether that is a correct policy decision or a false positive needs HF-side review.
Relevant public precedents

These do not prove the same root cause, but they are useful because the visible pattern is similar.

Flagged as abusive + PAUSED + restart/factory rebuild/commits ineffective

In this forum report, the runtime API showed stage: PAUSED and errorMessage: Flagged as abusive, while restart, factory rebuild, hardware changes, and commits did not trigger a new build:

“Flagged as abusive” false positive on ZeroGPU Space — cannot restart

Why it is relevant:

- same runtime message pattern
- restart/factory rebuild ineffective
- commits ineffective
- needs HF-side review

RepoScanner / tunnel / Cloudflare false-positive-style report

In this report, the user said the Space was flagged with:

Detector: RepoScanner
Category: huggingface:tunnel
File: API_DOCUMENTATION.md
Pattern: Cloudflare

They removed the file but the abuse flag persisted, and restart/resume/factory rebuild all returned 503:

Space flagged as abusive false positive - cannot restart after removing flagged file

Why it is relevant:

- scanner flags may persist after code changes
- removing or changing files may not automatically clear the Space state
- HF-side review may be required

trojan proxy on :7860

In another report, the UI only showed restart failure, but the API showed:

errorMessage: Flagged as abusive, reason trojan proxy on :7860

Space flagged as “abusive, reason trojan proxy” need help unblocking

Why it is relevant:

- the UI error was generic
- the runtime/API output revealed the actual branch
- logs alone were not enough
Normal Docker/App debugging is secondary here

There may still be app-level issues in the repo. For example, if HF clears the flag and the Space starts building/running again, then normal Docker debugging may still be needed.

But the flagged state should be handled first.

For normal Docker Spaces, the usual checks would be:

- README YAML uses sdk: docker
- app_port matches the server port
- nginx or app server listens on the configured port
- server binds to 0.0.0.0, not only 127.0.0.1
- Dockerfile EXPOSE and runtime port are consistent
- secrets/environment variables exist
- startup does not exceed timeout
- large downloads are not happening only during startup

Relevant docs:

But again, for this case the runtime API already says:

Flagged as abusive

So port/debug work is not the first-order issue right now.

If the goal is a browser-based coding/development environment

If the intended goal is to have a browser-based development environment on Spaces, I would ask HF what pattern is acceptable before continuing with this exact design.

Hugging Face has official documentation for Spaces Dev Mode. That does not automatically solve this case, and it may depend on plan/features, but it is a more standard development path than exposing a custom writable terminal / remote-agent interface through the public Space surface.

Possible safer redesign directions after HF review:

Option 1:
Use official Spaces Dev Mode for development, instead of a public writable terminal route.

Option 2:
Remove writable shell/terminal access from the public Space UI.

Option 3:
Expose only a narrow app/demo workflow instead of a general shell-like interface.

Option 4:
If agent functionality is needed, wrap it in a constrained app flow rather than exposing arbitrary terminal access.

Option 5:
Document the intended use clearly in README and remove proxy/tunnel/remote-management-looking parts that are not essential.

I would not spend too much time redesigning before HF replies, because only HF can say whether the current flag is a false positive and what exact part is unacceptable.

Final recommendation

At this point, I would treat the case as:

confirmed flagged Space state
not confirmed malicious abuse
not confirmed exact trigger
HF-side review required

So the immediate path is:

1. Send the runtime API output to HF.
2. Explain the legitimate intended use.
3. Avoid repeated full duplicates.
4. Ask what must be removed or changed.
5. Only resume app-level debugging after the flagged PAUSED state is resolved.

If it is a false positive, HF needs to clear it. If it is not a false positive, HF is the only party that can tell you what boundary was crossed.