Help: Space stuck on "building" forever

I don’t know why its been happening lately, but my space (free one) is stuck on “building” whenever I make a commit (git push). The only change I remember after which it started happening was in my app.py:

# Download chrome
def download_chrome():
    os.system("apt-get update") # Update package lists
    os.system("apt-get install -y curl") # Ensure curl is installed
    os.system("curl -O https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb") # Download the package
    os.system("apt-get install -y ./google-chrome-stable_current_amd64.deb") # Install the package
    print("Google Chrome downloaded and installed.")

download_chrome()

I made a couple of changes here and there as well, but this is the major one. I’ve tried restarting, force rebuild etc but the situation persists. i have tried creating new spaces, but the issue occurs in them as well whenever I commit. The logs are also completely empty

3 Likes

The app is getting stuck because it’s trying to install Chrome every time it starts up, which takes too long and causes the build to hang.

Solution: In the app.py file, just comment out or remove this line:

python

download_chrome() # Comment out this line

1 Like

here is Step-by-Step Fix

Step 1: Open the file
-Go to your Hugging Face Space

  • Open the app.py file

Step 2: Find the problem line

  • Look for this line at the bottom of your code:

python

download_chrome()

Step 3: Comment it out

Add # at the beginning of that line:

python

# download_chrome()

Step 4: Save and commit

Save the file
Commit the changes (git push)

Step 5: Wait for a while

  • The space should now build successfully instead of getting stuck
1 Like

Hey, thanks for the prompt response.
I also thought the same and had commented this piece of code for quite sometime now but to no avail. I’ll factory reset once more just to be sure. Will update soon
Thanks

1 Like

Well it looks like the space is broken. Its still showing “Building” no matter how many times i commit commented code or wait.

1 Like

It seems be affecting mulitple people right now

1 Like

I see. Well all we can do is wait I guess.
Thanks for this update

2 Likes

I’m having the same issues and HF support is gaslighting me to upgrade to a PRO account to use ZeroGPU. What a clown show.

2 Likes

Same issue with me. Trying for a last few hours.

1 Like

Perhaps related info.