Python Gradio Space stuck in "restarting"

Made a tiny mod in app..py, commited and space is stuck in “restarting”. Did the factory rebuild and it completed and now stuck in restarting. The only log entry is:

===== Application Startup at 2026-03-01 15:04:32 =====

This identical app.py code runs fine in Gradio on my PC in VS2022.

Edit:

After a few hours, doing a manual restart (in settings) got it running.

1 Like

This is a known issue with Gradio Spaces. Check for infinite loops in initialization, try adding timeout parameter, or use factory reset option.

1 Like

Having same problem again today (stuck in restarting). Have tried factory rebuild several times.

I don’t know how to “check for infinite loops in initialization” or where to add a timeout parameter.

Any help will be appreciated.

1 Like

Add’l info: It apparently finally started and now I’m getting the following runtime error:

Exit code: 137. Reason: The container could not be located when the pod was terminated

From googling I gather this is some kind of Docker or Kubernetes error ??

Edit: After yet another factory rebuild the space is starting and running OK.

1 Like

Hmm… Not sure related or not but maybe near issue: Sleeping spaces are not restarting

It’s probably an error on the HF infrastructure side or its backend, so restarting it (normally) a little later might fix it in some cases…