setup-cog icon indicating copy to clipboard operation
setup-cog copied to clipboard

FileNotFoundError: [Errno 2] No usable temporary directory found in ['/tmp', '/var/tmp', '/usr/tmp', '/']

Open jaweii opened this issue 1 year ago • 0 comments

An error occurred during the Push To Replicate phase:

#...

#14 8.080   Downloading websockets-12.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (130 kB)
#14 8.354 Installing collected packages: typing-extensions, sniffio, idna, exceptiongroup, h11, click, anyio, websockets, watchfiles, uvloop, uvicorn, urllib3, starlette, PyYAML, python-dotenv, pydantic, httptools, charset-normalizer, certifi, structlog, requests, fastapi, attrs, cog
#14 10.53 Successfully installed PyYAML-6.0.1 anyio-4.4.0 attrs-23.2.0 certifi-2024.7.4 charset-normalizer-3.3.2 click-8.1.7 cog-0.9.8 exceptiongroup-1.2.2 fastapi-0.98.0 h11-0.14.0 httptools-0.6.1 idna-3.7 pydantic-1.10.17 python-dotenv-1.0.1 requests-2.32.3 sniffio-1.3.1 starlette-0.27.0 structlog-24.4.0 typing-extensions-4.12.2 urllib3-2.2.2 uvicorn-0.30.3 uvloop-0.19.0 watchfiles-0.22.0 websockets-12.0
#14 10.91 WARNING: You are using pip version 20.3.1; however, version 24.1.2 is available.
#14 10.91 You should consider upgrading via the '/usr/local/bin/python -m pip install --upgrade pip' command.
#14 ...

#10 [stage-1 1/8] FROM docker.io/nvidia/cuda:11.7.1-cudnn8-devel-ubuntu22.04@sha256:38e59267704b5d91ef63c7d8f613359c629fab0aead1283d59ca7821029e73bc
#10 extracting sha256:04a0569fb825c0ec2c178909e86ceec2c2243abcd6061e01b0dcc90ad234229a 7.8s
#10 ...

#14 [deps 3/5] RUN --mount=type=cache,target=/root/.cache/pip pip install -t /dep /tmp/cog-0.0.1.dev-py3-none-any.whl
#14 DONE 12.1s

#10 [stage-1 1/8] FROM docker.io/nvidia/cuda:11.7.1-cudnn8-devel-ubuntu22.04@sha256:38e59267704b5d91ef63c7d8f613359c629fab0aead1283d59ca7821029e73bc
#10 ...

#15 [deps 4/5] COPY .cog/tmp/build2307638308/requirements.txt /tmp/requirements.txt
#15 DONE 0.5s

#10 [stage-1 1/8] FROM docker.io/nvidia/cuda:11.7.1-cudnn8-devel-ubuntu22.04@sha256:38e59267704b5d91ef63c7d8f613359c629fab0aead1283d59ca7821029e73bc
#10 CANCELED

#16 [deps 5/5] RUN --mount=type=cache,target=/root/.cache/pip pip install -t /dep -r /tmp/requirements.txt
#16 0.955 ERROR: Exception:
#16 0.955 Traceback (most recent call last):
#16 0.955   File "/usr/local/lib/python3.9/site-packages/pip/_internal/cli/base_command.py", line 224, in _main
#16 0.955     status = self.run(options, args)
#16 0.955   File "/usr/local/lib/python3.9/site-packages/pip/_internal/cli/req_command.py", line 180, in wrapper
#16 0.955     return func(self, options, args)
#16 0.955   File "/usr/local/lib/python3.9/site-packages/pip/_internal/commands/install.py", line 265, in run
#16 0.955     target_temp_dir = TempDirectory(kind="target")
#16 0.955   File "/usr/local/lib/python3.9/site-packages/pip/_internal/utils/temp_dir.py", line 141, in __init__
#16 0.955     path = self._create(kind)
#16 0.955   File "/usr/local/lib/python3.9/site-packages/pip/_internal/utils/temp_dir.py", line 189, in _create
#16 0.955     tempfile.mkdtemp(prefix="pip-{}-".format(kind))
#16 0.955   File "/usr/local/lib/python3.9/tempfile.py", line 348, in mkdtemp
#16 0.955     prefix, suffix, dir, output_type = _sanitize_params(prefix, suffix, dir)
#16 0.955   File "/usr/local/lib/python3.9/tempfile.py", line 118, in _sanitize_params
#16 0.955     dir = gettempdir()
#16 0.955   File "/usr/local/lib/python3.9/tempfile.py", line 287, in gettempdir
#16 0.955     tempdir = _get_default_tempdir()
#16 0.955   File "/usr/local/lib/python3.9/tempfile.py", line 219, in _get_default_tempdir
#16 0.955     raise FileNotFoundError(_errno.ENOENT,
#16 0.955 FileNotFoundError: [Errno 2] No usable temporary directory found in ['/tmp', '/var/tmp', '/usr/tmp', '/']
#16 1.002 WARNING: You are using pip version 20.3.1; however, version 24.1.2 is available.
#16 1.002 You should consider upgrading via the '/usr/local/bin/python -m pip install --upgrade pip' command.
#16 ERROR: process "/bin/sh -c pip install -t /dep -r /tmp/requirements.txt" did not complete successfully: exit code: 2
------
 > [deps 5/5] RUN --mount=type=cache,target=/root/.cache/pip pip install -t /dep -r /tmp/requirements.txt:
0.955     prefix, suffix, dir, output_type = _sanitize_params(prefix, suffix, dir)
0.955   File "/usr/local/lib/python3.9/tempfile.py", line 118, in _sanitize_params
0.955     dir = gettempdir()
0.955   File "/usr/local/lib/python3.9/tempfile.py", line 287, in gettempdir
0.955     tempdir = _get_default_tempdir()
0.955   File "/usr/local/lib/python3.9/tempfile.py", line 219, in _get_default_tempdir
0.955     raise FileNotFoundError(_errno.ENOENT,
0.955 FileNotFoundError: [Errno 2] No usable temporary directory found in ['/tmp', '/var/tmp', '/usr/tmp', '/']
1.002 WARNING: You are using pip version 20.3.1; however, version 24.1.2 is available.
1.002 You should consider upgrading via the '/usr/local/bin/python -m pip install --upgrade pip' command.
------
Dockerfile:6
--------------------
   4 |     RUN --mount=type=cache,target=/root/.cache/pip pip install -t /dep /tmp/cog-0.0.1.dev-py3-none-any.whl
   5 |     COPY .cog/tmp/build2307638308/requirements.txt /tmp/requirements.txt
   6 | >>> RUN --mount=type=cache,target=/root/.cache/pip pip install -t /dep -r /tmp/requirements.txt
   7 |     FROM nvidia/cuda:11.7.1-cudnn8-devel-ubuntu22.04
   8 |     ENV DEBIAN_FRONTEND=noninteractive
--------------------
ERROR: failed to solve: process "/bin/sh -c pip install -t /dep -r /tmp/requirements.txt" did not complete successfully: exit code: 2
ⅹ Failed to build Docker image: exit status 1
Error: Process completed with exit code 1.

My cog.yaml:

image: "r8.im/jaweii/anytext"
build:
  gpu: true
  cuda: "11.7"
  python_version: "3.9.0"
  python_requirements: requirements.txt
  run:
    - "echo env is ready!"
predict: "predict.py:Predictor"

It seems like it doesn't have permission to access the temporary directory in the docker machine?

jaweii avatar Jul 24 '24 08:07 jaweii