Skip to content

Permission issue when using Poetry 1.5.1, updated from 1.1.13 #8408

@alejandrofm

Description

@alejandrofm
  • Poetry version: 1.5.1
  • Python version: 3.10
  • OS version and name: Ubuntu (Airflow image)

Have all my repos configured on 1.5.1, read the changelogs and no mention of my issue of similar.

Issue

This is my Dockerfile

FROM apache/airflow:2.7.0-python3.10

RUN pip install pip==23.1
RUN pip install poetry==1.5.1

USER root

RUN if [[ -s packages.txt ]]; then \
    apt-get update && cat packages.txt | xargs apt-get install -y --no-install-recommends \
    && apt-get autoremove -yqq --purge \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/*; \
  fi

USER airflow
COPY ./pyproject.toml ./poetry.lock* ./
RUN poetry config virtualenvs.create false

ARG PIP_USERNAME
ARG PIP_PASSWORD
ENV POETRY_HTTP_BASIC_REPO $PIP_USERNAME

# Install Python packages from poetry.lock
RUN poetry install

if I create the lock file with 1.1.13 and generate the image with the above Dockerfile, everything goes smoothly, Just a warning:

13 [8/8] RUN poetry install
#13 1.636 Skipping virtualenv creation, as specified in config file.
#13 1.714 /home/airflow/.local/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
#13 1.714   warnings.warn(
#13 3.026 Installing dependencies from lock file
#13 4.814 
#13 4.814 Package operations: 3 installs, 133 updates, 2 removals`

when I create the lock file and run it with 1.5.1 I have this log:

#13 [8/8] RUN poetry install
#13 1.622 Skipping virtualenv creation, as specified in config file.
#13 2.281 Installing dependencies from lock file
#13 3.403 
#13 3.403 Package operations: 3 installs, 134 updates, 0 removals
#13 3.403 
#13 3.403   • Updating wrapt (1.15.0 /home/airflow/.local/lib/python3.10/site-packages -> 1.15.0)
#13 4.678 
#13 4.678   PermissionError
#13 4.678 
#13 4.678   [Errno 13] Permission denied: '/usr/local/lib/python3.10/site-packages/wrapt-1.15.0.dist-info'
#13 4.678 
#13 4.678   at /usr/local/lib/python3.10/pathlib.py:1175 in mkdir
#13 4.731       1171│         """
#13 4.731       1172│         Create a new directory at this given path.
#13 4.731       1173│         """
#13 4.731       1174│         try:
#13 4.732     → 1175│             self._accessor.mkdir(self, mode)
#13 4.732       1176│         except FileNotFoundError:
#13 4.732       1177│             if not parents or self.parent == self:
#13 4.732       1178│                 raise
#13 4.732       1179│             self.parent.mkdir(parents=True, exist_ok=True)
#13 4.732 
#13 ERROR: executor failed running [/bin/bash -o pipefail -o errexit -o nounset -o nolog -c poetry install]: exit code: 1

The poetry version is the only thing that changes between a successful and failed build.
Any idea of what could be happening?
Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/distributionRelated to the distribution and installation of Poetry itselfkind/bugSomething isn't working as expectedstatus/triageThis issue needs to be triaged

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions