# PermissionError hot-dog space example

**URL:** <https://discuss.huggingface.co/t/permissionerror-hot-dog-space-example/160917>\
**Category:** Spaces\
**Created:** [June 27, 2025, 4:21pm UTC](https://discuss.huggingface.co/t/permissionerror-hot-dog-space-example/160917 "2025-06-27T16:21:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bachstelze](https://avatars.discourse-cdn.com/v4/letter/b/df705f/32.png) [@Bachstelze](https://discuss.huggingface.co/u/Bachstelze)\
**Post date:** [June 27, 2025, 4:21pm UTC](https://discuss.huggingface.co/t/permissionerror-hot-dog-space-example/160917/1 "2025-06-27T16:21:47Z")

</div>

I get the following error by executing the hot-dog space example from [https://huggingface.co/docs/hub/en/spaces-sdks-streamlit:](https://huggingface.co/docs/hub/en/spaces-sdks-streamlit:)

```auto
OSError: PermissionError at /.cache when downloading julien-c/hotdog-not-hotdog. Check cache directory permissions. Common causes: 1) another user is downloading the same model (please wait); 2) a previous download was canceled and the lock file needs manual removal.
Traceback:

File "/app/src/streamlit_app.py", line 5, in <module>
    pipeline = pipeline(task="image-classification", model="julien-c/hotdog-not-hotdog")
File "/usr/local/lib/python3.9/site-packages/transformers/pipelines/ __init__.py", line 892, in pipeline
    resolved_config_file = cached_file(
File "/usr/local/lib/python3.9/site-packages/transformers/utils/hub.py", line 312, in cached_file
    file = cached_files(path_or_repo_id=path_or_repo_id, filenames=[filename], **kwargs)
File "/usr/local/lib/python3.9/site-packages/transformers/utils/hub.py", line 515, in cached_files
    raise OSError(

```

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](https://discuss.huggingface.co/u/John6666)\
**Post date:** [June 28, 2025, 1:48am UTC](https://discuss.huggingface.co/t/permissionerror-hot-dog-space-example/160917/2 "2025-06-28T01:48:17Z")

</div>

Hmm…? Seems it works.

> **[Hotdog Streamlit - a Hugging Face Space by John6666](https://huggingface.co/spaces/John6666/hotdog-streamlit)**
>
> Discover amazing ML apps made by the community

---

<div class="post-metadata">

**Author:** ![Bachstelze](https://avatars.discourse-cdn.com/v4/letter/b/df705f/32.png) [@Bachstelze](https://discuss.huggingface.co/u/Bachstelze)\
**Post date:** [June 28, 2025, 10:21am UTC](https://discuss.huggingface.co/t/permissionerror-hot-dog-space-example/160917/3 "2025-06-28T10:21:24Z")

</div>

How do you do it without docker?  
My hot-dog space is built upon docker: [Hot Dog Test - a Hugging Face Space by Bachstelze](https://huggingface.co/spaces/Bachstelze/hot-dog-test)

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](https://discuss.huggingface.co/u/John6666)\
**Post date:** [June 28, 2025, 11:43am UTC](https://discuss.huggingface.co/t/permissionerror-hot-dog-space-example/160917/4 "2025-06-28T11:43:01Z")

</div>

> How do you do it without docker?

In my case, I simply copied an existing Streamlit space and modified it. For Docker spaces, it seems that user permission settings are required.

> **[Hot Dog Test - a Hugging Face Space by John6666](https://huggingface.co/spaces/John6666/hot-dog-test-docker)**
>
> Streamlit template space

```dockerfile
FROM python:3.9-slim

WORKDIR /app

RUN apt-get update && apt-get install -y \
    build-essential \
    curl \
    software-properties-common \
    git \
    && rm -rf /var/lib/apt/lists/*

COPY requirements.txt ./
COPY src/ ./src/

RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user\
	PATH=/home/user/.local/bin:$PATH
WORKDIR $HOME/app
RUN pip install --no-cache-dir --upgrade pip
COPY --chown=user . $HOME/app

RUN pip3 install -r requirements.txt

EXPOSE 8501

HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health

ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]

```

> [@Permission denied for writing files within Spaces?](https://discuss.huggingface.co/t/permission-denied-for-writing-files-within-spaces/29799/6):
>
> Hello @radames , I also tried to your fix but I’m trying to run an airflow container (for education purposes) but I still get error. Here is the file: # Use an official Airflow image as base FROM apache/airflow:2.7.0 # Set environment variables ENV AIRFLOW\_HOME=/opt/airflow ENV AIRFLOW\_\_CORE\_\_LOAD\_EXAMPLES=False ENV AIRFLOW\_\_CORE\_\_EXECUTOR=SequentialExecutor ENV AIRFLOW\_\_WEBSERVER\_\_WEB\_SERVER\_MASTER\_TIMEOUT=300 ENV AIRFLOW\_\_WEBSERVER\_\_WORKER\_CLASS=gevent ENV AIRFLOW\_\_WEBSERVER\_\_WEB\_SERVER\_PORT…
