Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ensure_dir() should also check for ENOTEMPTY #6426

Closed
BorisZZZ opened this issue Apr 23, 2019 · 4 comments · Fixed by #6427
Closed

ensure_dir() should also check for ENOTEMPTY #6426

BorisZZZ opened this issue Apr 23, 2019 · 4 comments · Fixed by #6427
Labels
auto-locked Outdated issues that have been locked by automation OS: windows Windows specific

Comments

@BorisZZZ
Copy link
Contributor

Environment

  • pip version:
    pip 19.0.3

  • Python version:
    python 3.7

  • OS:
    'python:3.7-alpine3.9' docker image (docker-ce 17.9) running on Ubuntu 18.04.2 LTS in WSL (Windows)

Description
pip install pipenv fails with the following error:

Could not install packages due to an EnvironmentError: [Errno 39] Directory not empty: '/tmp/pip-install-wx86kab7/pipenv/pipenv'

How to Reproduce

  1. Set up environment as described above (alpine3.9, on docker-ce 17.9, running on Ubuntu in WSL). and run the command.

  2. apk --update add --virtual build-dependencies libffi-dev openssl-dev build-base

  3. pip install --upgrade pip

  4. pip install pipenv

Output

Could not install packages due to an EnvironmentError: [Errno 39] Directory not empty: '/tmp/pip-install-wx86kab7/pipenv/pipenv'

Investigation
Compared strace results of a successful run (on a different env) vs the failed run.
On a successful run, the mkdir command is continually executed with /tmp/pip-install-<hash>/pipenv/pipenv as an argument and fails with an EEXIST error. However, on the failed run the same command fails with an ENOTEMPT error. This has to do with the environment itself (maybe docker/windows related), as the same difference is observed when simply performing mkdir from a shell.

@uranusjr
Copy link
Member

uranusjr commented Apr 24, 2019

Can you provide an example with only mkdir in play instead of pip? I am having trouble believing makedirs could fail with ENOTEMPTY. (And if it does, this seems like a bug in WSL.)

@BorisZZZ
Copy link
Contributor Author

In an environment such as the one described above (python:3.7-alpine3.9 docker image, docker-ce 17.9, running on Ubuntu 18.04.2 LTS in WSL - see https://medium.com/devopslinks/docker-running-seamlessly-in-windows-subsystem-linux-6ef8412377aa for possible setup), running mkdir on a path that represents a directory that already exists either:

  1. succeeds if the directory is empty, or
  2. fails with ENOTEMPTY error.

@uranusjr
Copy link
Member

So, to summarise, this happens when you install Docker in WSL, and run mkdir in it? It would be more suitable to report this to WSL if that’s the case.

@pradyunsg pradyunsg added the S: needs triage Issues/PRs that need to be triaged label Jun 22, 2019
@chrahunt chrahunt added the OS: windows Windows specific label Aug 16, 2019
@triage-new-issues triage-new-issues bot removed the S: needs triage Issues/PRs that need to be triaged label Aug 16, 2019
@chrahunt
Copy link
Member

chrahunt commented Aug 16, 2019

It looks like this change could be related and may help reproducing.

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Dec 28, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Dec 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation OS: windows Windows specific
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants