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…

Another of my Python Gradio spaces is now stuck in restarting for four days now despite forcing restart, factory rebuilding, juggling Gradio SDK version back and forth. It stopped originally due to no change of mine whatsoever. I’m running a gradio client program on a raspberry pi at home that pings this space via the API every two hours and it just stopped connecting, and space would not restart.

I’m using only 4 zero cpu spaces if that matters.

The builds appear to succeed,; image is pushed, and container goes into restarting with this message in the log:

===== Application Startup at 2026-03-16 09:44:20 =====

At this point I guess all I can do is kill this space and create a new one for the app. (??)

1 Like

In this time, maybe infra issue: All my Spaces stuck in Building with empty logs