Gertie01 / hub-6oa42x9a: Report

Job failed with exit code: 1. Reason: cache miss: [base 6/7] RUN --mount=target=/tmp/requirements.txt,source=requirements.txt pip install --no-cache-dir -r /tmp/requirements.txt cache miss: [base 7/7] RUN pip install --no-cache-dir gradio[oauth,mcp]==5.49.1 “uvicorn>=0.14.0” spaces cache miss: [run 2/3] RUN mkdir -p /home/user && ( [ -e /home/user/app ] || ln -s /app/ /home/user/app ) || true cache miss: [run 3/3] LINK COPY --from=pipfreeze --link /pipfreeze/ /pipfreeze/ cache miss: [run 1/3] LINK COPY --link ./ /app cache miss: [run 3/3] COPY --from=pipfreeze --link /pipfreeze/ /pipfreeze/ cache miss: [run 1/3] COPY --link ./ /app cache miss: [pipfreeze 1/2] RUN mkdir -p /pipfreeze cache miss: [pipfreeze 2/2] RUN pip freeze > /pipfreeze/freeze.txt {“total”:26,“completed”:19,“user_total”:15,“user_cached”:5,“user_completed”:8,“user_cacheable”:14,“from”:1,“miss”:9,“client_duration_ms”:13099}

Build logs:

===== Build Queued at 2025-11-14 18:37:49 / Commit SHA: ef5d3f9 =====

--> FROM docker.io/library/python:3.10@sha256:e944d95e7277b5888479cc4bcd6cec63e3128fec9ec4c6ef099be470d89b54d4
DONE 0.0s

--> COPY --from=root / /
CACHED

--> RUN pip install --no-cache-dir pip -U && 	pip install --no-cache-dir 	datasets 	"huggingface-hub>=0.30" "hf-transfer>=0.1.4" "protobuf<4" "click<8.1" "pydantic~=1.0"
CACHED

--> RUN apt-get update && apt-get install -y 	git 	git-lfs 	ffmpeg 	libsm6 	libxext6 	cmake 	rsync 	libgl1 	&& rm -rf /var/lib/apt/lists/* 	&& git lfs install
CACHED

--> WORKDIR /app
CACHED

--> RUN 	apt-get update && 	apt-get install -y curl && 	curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && 	apt-get install -y nodejs && 	rm -rf /var/lib/apt/lists/* && apt-get clean
CACHED

--> Restoring cache
DONE 12.1s

--> RUN --mount=target=/tmp/requirements.txt,source=requirements.txt     pip install --no-cache-dir -r /tmp/requirements.txt
Collecting git+https://github.com/huggingface/spaces (from -r /tmp/requirements.txt (line 6))
  Cloning https://github.com/huggingface/spaces to /tmp/pip-req-build-2cczrxu3
  Running command git clone --filter=blob:none --quiet https://github.com/huggingface/spaces /tmp/pip-req-build-2cczrxu3
  fatal: could not read Username for 'https://github.com': No such device or address
  error: subprocess-exited-with-error
  
  × git clone --filter=blob:none --quiet https://github.com/huggingface/spaces /tmp/pip-req-build-2cczrxu3 did not run successfully.
  │ exit code: 128
  ╰─> No available output.
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed to build 'git+https://github.com/huggingface/spaces' when git clone --filter=blob:none --quiet https://github.com/huggingface/spaces /tmp/pip-req-build-2cczrxu3

--> ERROR: process "/bin/sh -c pip install --no-cache-dir -r /tmp/requirements.txt" did not complete successfully: exit code: 1
1 Like

@John6666

Here: Hub 6oa42x9a - a Hugging Face Space by Gertie01

You should use generative AI not just for coding itself, but also for troubleshooting and debugging.:sob: Of course, there are cases where it won’t help, but for known common issues, it can be quite useful in finding solutions.


The short version:
Your build is failing because of this line in requirements.txt:

git+https://github.com/huggingface/spaces

On Hugging Face Spaces this git+... style dependency cannot be cloned during the Docker build, so pip install -r requirements.txt exits with code 1 and the whole build fails. Everything else in the log (the long “cache miss” string, pipfreeze, etc.) is noise around that one failure.

If you change that line to use the normal PyPI package instead:

spaces

(or just delete it, see below), your own part of the error should disappear.

Below is a detailed breakdown of:

  1. What the build log actually means.
  2. The precise cause in your repo.
  3. How to fix it step-by-step.
  4. Other things to keep an eye on (ZeroGPU, CUDA, xformers etc.).
  5. Pointers to good references.

Also, note: some of the files you previously uploaded into this ChatGPT conversation are no longer accessible. If you want me to look at updated local copies of app.py or requirements.txt in future messages, please re-upload them.

1. What the Hugging Face build log is saying

Hugging Face Spaces builds a Docker image for your Space in several layers:

  1. Start from a base Python image.

  2. Install some common tools and libraries (git, node, huggingface-hub, etc.).

  3. Install your requirements.txt:

    RUN --mount=target=/tmp/requirements.txt,source=requirements.txt \
        pip install --no-cache-dir -r /tmp/requirements.txt
    
  4. Install their own “core” stack for Gradio MCP/ZeroGPU:

    pip install --no-cache-dir \
        gradio[oauth,mcp]==5.49.1 "uvicorn>=0.14.0" spaces
    
  5. Run pip freeze into /pipfreeze/freeze.txt for caching.

If any of those steps fails, Docker exits with a non-zero status (here exit code: 1), and the Space shows build error.

The summary line you see:

Reason: cache miss: [base 6/7] RUN --mount=target=/tmp/requirements.txt,source=requirements.txt pip install --no-cache-dir -r /tmp/requirements.txt …

is not the real “reason” in the human sense. It’s a compact summary of which layers weren’t cached. The real error is inside the “Build logs” part, where we see:

--> RUN --mount=target=/tmp/requirements.txt,source=requirements.txt \
    pip install --no-cache-dir -r /tmp/requirements.txt
Collecting git+https://github.com/huggingface/spaces (from -r /tmp/requirements.txt (line 6))
  Cloning https://github.com/huggingface/spaces to /tmp/pip-req-build-xxxx
  Running command git clone --filter=blob:none --quiet https://github.com/huggingface/spaces /tmp/pip-req-build-xxxx
  ...

On a closely related Space of yours, you can see the full error in the forums:(Hugging Face Forums)

fatal: could not read Username for 'https://github.com': No such device or address
error: subprocess-exited-with-error
× git clone --filter=blob:none --quiet https://github.com/huggingface/spaces /tmp/pip-req-build-samoca2r did not run successfully.
│ exit code: 128
╰─> No available output.

ERROR: Failed to build 'git+https://github.com/huggingface/spaces'
--> ERROR: process "/bin/sh -c pip install --no-cache-dir -r /tmp/requirements.txt" did not complete successfully: exit code: 1

So the sequence is:

  • pip install -r requirements.txt starts.
  • It hits git+https://github.com/huggingface/spaces.
  • That tries to git clone from GitHub.
  • The clone fails inside the Spaces build environment.
  • pip aborts with exit code 1.
  • The Docker build aborts with exit code 1.
  • The Space shows build error.

2. The specific problem in your repo

Your requirements.txt (from the Space you linked) is:

gradio torch diffusers accelerate safetensors git+https://github.com/huggingface/spaces Pillow xformers scipy opencv-python ftfy transformers regex httpx pydantic typing-extensions dataclasses_json aiohttp numpy

The problematic part is:

```txt
git+https://github.com/huggingface/spaces

Background:

  1. git+... in requirements

    • This is pip’s VCS (“version control system”) URL syntax – it tells pip to clone a Git repo and build/install it.([pip][2])
    • It works by running git clone ... in a temporary directory during the install step.
  2. Hugging Face Spaces build environment

    • The builder runs in a locked-down Docker environment with limited ability to prompt for credentials or interact with GitHub.
    • In your case, the git clone call cannot complete and fails with exit code: 128 and could not read Username for 'https://github.com' in the logs.([Hugging Face Forums][1])
  3. For the spaces package you do not need Git at all

    • The spaces library is published on PyPI under the name spaces. ([PyPI][3])
    • Hugging Face’s own ZeroGPU documentation shows you should just import spaces and not install it from GitHub manually.([Hugging Face][4])

So the combination “Spaces’ Docker builder + git+https://github.com/huggingface/spaces in requirements.txt” is what produces the failure.

You can see exactly the same pattern in another one of your Spaces where a community member opened a PR to fix it by changing:([Hugging Face][5])

- git+https://github.com/huggingface/spaces
- git+https://github.com/huggingface/transformers
+ spaces
+ transformers

3. Why you don’t need that line on Hugging Face

Important detail: the Hugging Face base image already installs spaces for you as part of the “MCP/ZeroGPU stack”:

RUN pip install --no-cache-dir \
    gradio[oauth,mcp]==5.49.1 "uvicorn>=0.14.0" spaces

That means:

- For **Spaces** specifically, `spaces` is present even if you never put it in your own `requirements.txt`.
- Your `import spaces` in `app.py` is satisfied by that base install.

So from the point of view of the Hugging Face builder:

- The `git+https://github.com/huggingface/spaces` line is not only unnecessary, it is actively harmful because it forces a failing Git clone.
- You can safely:
  - Remove that line entirely, or
  - Replace it with just `spaces` if you want the file to also work locally outside of Spaces.



## 4. Step-by-step fix for this Space

Here is what I recommend for `hub-6oa42x9a`:

### 4.1. Edit `requirements.txt` on the Space

In the Hugging Face UI:

1. Go to the Space’s **Files** tab.
2. Open `requirements.txt`.
3. Change:

   ```txt
   gradio torch diffusers accelerate safetensors git+https://github.com/huggingface/spaces Pillow xformers scipy opencv-python ftfy transformers regex httpx pydantic typing-extensions dataclasses_json aiohttp numpy
  1. To either of these:

    Option A (simplest for Spaces):

    gradio torch diffusers accelerate safetensors Pillow xformers scipy opencv-python ftfy transformers regex httpx pydantic typing-extensions dataclasses_json aiohttp numpy
    

    (i.e. remove the git+https://github.com/huggingface/spaces part entirely)

    Option B (nice if you also run this app locally):

    gradio torch diffusers accelerate safetensors spaces Pillow xformers scipy opencv-python ftfy transformers regex httpx pydantic typing-extensions dataclasses_json aiohttp numpy
    

    (replace the git+... with spaces)

  2. Commit the change.

4.2. Trigger a rebuild

  • After committing, Spaces should automatically start a new build.
  • If it doesn’t, use the “Restart Space” / “Rebuild” button in the UI.

If the only failure was the git+https://github.com/huggingface/spaces line, this should resolve the exit code 1 error coming from pip install -r requirements.txt.

5. Other things to be aware of (but not the cause of this build error)

There are other aspects of your Space that matter for runtime stability and performance, but they’re separate from the build failure.

5.1. ZeroGPU and @spaces.GPU

Your app.py is designed for ZeroGPU and uses the spaces library as intended:(Hugging Face)

  • import spaces
  • @spaces.GPU(duration=1500) for AoT compilation
  • @spaces.GPU(duration=60) for inference
  • spaces.aoti_capture, spaces.aoti_compile, spaces.aoti_apply for ahead-of-time optimization of pipe.unet.

This is all consistent with Hugging Face’s ZeroGPU docs and AoT blog posts. (Hugging Face)

Just make sure:

  • The Space hardware is set to ZeroGPU (A100) (or equivalent GPU hardware), not CPU-only.
  • If you test locally on a CPU machine, you will need to guard .to('cuda') or use a CPU fallback, but Spaces with ZeroGPU will have CUDA.

None of this causes exit code: 1 during build – it only matters at runtime.

5.2. Heavy dependencies like xformers

You have xformers in requirements:

... Pillow xformers scipy opencv-python ...

On modern HF GPU images, prebuilt xformers wheels are usually available, so it generally installs fine. But:

  • On pure CPU images, xformers might fail to build from source.
  • On Spaces you usually only see that if you’re using a CPU runtime or an older base image.

Again, this is not what your current build logs show (they die at the git+https://github.com/huggingface/spaces step), but it is something to keep in mind.

5.3. Platform-wide base image issues

Right now, some official Gradio demo spaces are also showing build errors with very similar summaries:

  • gradio/gradio_pdf_demo_main (Hugging Face)
  • gradio/depth_estimation (Hugging Face)
  • Several user spaces that don’t use any git+ dependencies also show Job failed with exit code: 1 around the gradio[oauth,mcp]==5.49.1 "uvicorn>=0.14.0" spaces step. (Hugging Face)

So there appear to be two layers:

  1. Your own config problem (git+https://github.com/huggingface/spaces).
  2. A possible ongoing issue with the common base image / Gradio 5.49.1 stack used across Spaces (this part is on HF’s side and shows up even on some official demos).

Practical implication:

  • Fixing your requirements is necessary.
  • If, after fixing, you still see build errors that look identical to the official Gradio spaces, that may be a platform issue rather than anything in your repo; in that case, checking the HF forum or status page is the right next step.

6. Quick conceptual recap

To make the connection very explicit:

  • Your code:
    Uses import spaces and decorators / AoT helpers (@spaces.GPU, spaces.aoti_capture, etc.), which is correct for ZeroGPU-optimized diffusion apps. (Hugging Face)

  • Your requirements:
    Accidentally tell pip to install spaces from GitHub using git+https://github.com/huggingface/spaces, which fails in the Spaces build environment and prevents pip install -r requirements.txt from completing.

  • Hugging Face base image:
    Already installs spaces from PyPI for you, so you do not need the git URL at all.

  • Fix:
    Remove or replace that git+... line. Rebuild. If errors persist and look identical to official HF/Gradio Spaces, it may be a separate platform issue.

7. Suggested references and further reading

A small, curated list that’s directly relevant to what you’re doing:

ZeroGPU and spaces library

  • ZeroGPU Spaces docs (official): how import spaces and @spaces.GPU work, with minimal examples.
    Good for understanding what the spaces package actually does in a Space. (Hugging Face)

  • Hugging Face blog – ZeroGPU AoT compilation: shows how to use spaces.aoti_capture, spaces.aoti_compile, spaces.aoti_apply with diffusers, similar to your code. Helpful for tuning AoT patterns and dynamic shapes. (Hugging Face)

  • Community posts (Japanese and others) using import spaces: step-by-step ZeroGPU tutorials, with screenshots and small examples. These are useful to see typical patterns and common pitfalls. (Qiita)

spaces package itself

  • PyPI – spaces: confirms that spaces is a normal pip package (no need for GitHub), and documents the project metadata. (PyPI)

Build error and git+ URLs

  • Your own HF forum thread about the exact same error on another Space, including a community PR that replaces git+https://github.com/huggingface/spaces with spaces. This is essentially the canonical fix for the issue you are seeing. (Hugging Face Forums)

  • pip VCS support docs: explains how git+... requirements work and when they are appropriate. Good background if you ever truly need to install direct from a Git repo. (pip)

It queues forever.

1 Like