Possible race condition with poetry install inside docker
See original GitHub issue- I am on the latest Poetry version.
- I have searched the issues of this repo and believe that this is not a duplicate.
- If an exception occurs when executing a command, I executed it again in debug mode (
-vvv
option).
- OS version and name: Ubuntu 18.04
- Poetry version: 1.1.4
- Link of a Gist with the contents of your pyproject.toml file: https://gist.github.com/jacek-jablonski/1824e5fe154869f885c0af187a495e79
Issue
I have noticed that after upgrading to poetry 1.1.x branch I started getting EnvCommandError errors when poetry is used inside docker.
---> Running in 97471832e9f0
Skipping virtualenv creation, as specified in config file.
Installing dependencies from lock file
Package operations: 120 installs, 0 updates, 0 removals
• Installing pyasn1 (0.4.8)
• Installing six (1.15.0)
EnvCommandError
Command ['/usr/local/bin/python', '-m', 'pip', 'install', '--no-deps', '/home/apps/.cache/pypoetry/artifacts/7b/3a/54/42ce43b579bda01b9d79022fb733811594441e7a32e9f9a5a98f672bdc/pyasn1-0.4.8-py2.py3-none-any.whl'] errored with the following return code 1, and output:
Looking in indexes: https://pypi.org/simple, https://****@xxx/pypi
Processing /home/apps/.cache/pypoetry/artifacts/7b/3a/54/42ce43b579bda01b9d79022fb733811594441e7a32e9f9a5a98f672bdc/pyasn1-0.4.8-py2.py3-none-any.whl
Installing collected packages: pyasn1
ERROR: Could not install packages due to an EnvironmentError: [Errno 17] File exists: '/home/apps/.local/lib/python3.9/site-packages'
at /opt/poetry/lib/poetry/utils/env.py:1074 in _run
1070│ output = subprocess.check_output(
1071│ cmd, stderr=subprocess.STDOUT, **kwargs
1072│ )
1073│ except CalledProcessError as e:
→ 1074│ raise EnvCommandError(e, input=input_)
1075│
1076│ return decode(output)
1077│
1078│ def execute(self, bin, *args, **kwargs):
Here the problem is with already existing /home/apps/.local/lib/python3.9/site-packages
, but sometimes it points to other files in /home/apps/.local/
as well. Rerunning build without any changes usually ends with success.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:15
- Comments:11
Top Results From Across the Web
Integrating Python Poetry with Docker - Stack Overflow
There are several things to keep in mind when using poetry together with docker . Installation. Official way to install poetry is via:...
Read more >Announcing Poetry 1.2.0 | Blog
Due to bugs in older versions of pip, the parallel installer may sometimes experience race conditions. Modern pip versions should be highly ...
Read more >Advanced Workflows with Parallel steps · Codefresh | Docs
Learn how to create complex workflows in Codefresh with step dependencies. ... If there are race conditions between your parallel steps, (e.g. multiple ......
Read more >Can you share your experience with race conditions ... - Reddit
Can you share your experience with race conditions in production? I am trying to understand pitfalls of race conditions as a backend developer ......
Read more >Alpine makes Python Docker builds slower, and images larger
I solved the problem by installing inotify into the container, ... and make debugging harder, race condition never happened to me anyway.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
here is my workaround:
Having a similar issue in a similar environment: