Space auto-pauses, gets in endless pause/restart loop

I have a strange behavior happening in my space. It always auto-pauses and gets into an endless loop between pausing/restarting.

This has happened multiple times and I can only get the space to work for a day before it suffers from this again.

I have no errors, no logs, no clue what to do. Can anyone shed some light into this? I’ve also thought this is a bug in HF, because in the endless loop, my page keeps refreshing like I was pressing F5 multiple times but I’m not. For this reason, logs are inaccessible since the page is always refreshing in a loop.

I’d mean a lot to me if anyone could shed a light into this. I’ve stumbled upon an AutoTrain thread where a similar issue is discussed, but nothing specific to what I describe here.

1 Like

Using the wrong startup options for FastAPI may cause problems, though I’m not sure about this. If I had the source code, I could probably figure it out a bit more…

Hey, thanks for answering so quickly. I’m indeed using FastAPI and reload was really on. I think one of my other mistakes was loading up must-have scripts to run at the lifespan startup method of FastAPI, making it a bit longer to go up and return 200.

I just rebuilt fixing both of these and hope it works now.

1 Like

The use of tools like Tor is probably prohibited, so I think it might be intentionally blocked…

It has been working for a while now until I realized that I was having problems writing to disk. Part of the app writes to disk and expects files to persist on next start up. That essentially was preventing me from doing any Factory Rebuild.

I’m novice to HF so took me a while to figure out. This means that every time I need to change something I’ll have to rebuild from scratch the whole space.

1 Like

Ah, I see. That’s the issue!
To persist Spaces data, uploading to a Private dataset repo is the cheapest (free) option.
Paid Persistent Storage offers a more seamless experience, but paid…