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

Pipenv attempts to read entire filesystem when creating new virtualenvs, gets stuck on /keybase #4898

Open
1 task done
icy-ux opened this issue Dec 22, 2021 · 4 comments
Open
1 task done
Labels
Category: Performance Issue relates to performance Type: Possible Bug This issue describes a possible bug in pipenv.

Comments

@icy-ux
Copy link

icy-ux commented Dec 22, 2021

Description

I attempt to create a new virtualenv in /home/user/my/project. Since I have keybase on my system, there is a /keybase directory, representing a mounted kbfs filesystem. Accessing files in this directory results in network traffic and other strange phenomena. This appears to be causing pipenv to choke

$ strace pipenv -v
newfstatat(AT_FDCWD, "/run", {st_mode=S_IFDIR|0755, st_size=1000, ...}, 0) = 0
newfstatat(AT_FDCWD, "/etc", {st_mode=S_IFDIR|0755, st_size=12288, ...}, 0) = 0
newfstatat(AT_FDCWD, "/lib", {st_mode=S_IFDIR|0555, st_size=4096, ...}, 0) = 0
newfstatat(AT_FDCWD, "/keybase", 0x7ffe32a8e590, 0) = -1 (errno 18446744073709551354)
+++ killed by SIGKILL +++
Killed

Expected behavior

Pipenv should not try to access every directory on the filesystem when creating a virtualenv. Just the current and parent directories.

pip version

2021.11.23

Python version

Python 3.9.9

OS

Fedora 34

How to Reproduce

  1. Install Keybase
  2. Install pipenv, etc
  3. Install strace (to watch the system calls)
  4. Create a project directory in /home/user/my/project
  5. From inside the directory, execute strace pipenv -v (strace is optional, but will show where things hang)

Output

See above

Code of Conduct

@matteius
Copy link
Member

@icy-ux You did not include output from pipenv --support. I wonder if this a case where you would have better results with a --user install of pipenv over a global system one, but again not entirely sure what you are working with without that detail in the report.

@matteius
Copy link
Member

I see on my global install of pipenv, it does have a call to every root directory, and my local install version does the same, so probably a bad hunch I had just now @icy-ux

newfstatat(AT_FDCWD, "/mnt", {st_mode=S_IFDIR|0755, st_size=4096, ...}, 0) = 0
newfstatat(AT_FDCWD, "/media", {st_mode=S_IFDIR|0755, st_size=4096, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home", {st_mode=S_IFDIR|0755, st_size=4096, ...}, 0) = 0
newfstatat(AT_FDCWD, "/libx32", {st_mode=S_IFDIR|0755, st_size=4096, ...}, 0) = 0
newfstatat(AT_FDCWD, "/sbin", {st_mode=S_IFDIR|0755, st_size=20480, ...}, 0) = 0
newfstatat(AT_FDCWD, "/dev", {st_mode=S_IFDIR|0755, st_size=4160, ...}, 0) = 0
newfstatat(AT_FDCWD, "/snap", {st_mode=S_IFDIR|0755, st_size=4096, ...}, 0) = 0
newfstatat(AT_FDCWD, "/root", {st_mode=S_IFDIR|0700, st_size=4096, ...}, 0) = 0
newfstatat(AT_FDCWD, "/srv", {st_mode=S_IFDIR|0755, st_size=4096, ...}, 0) = 0
newfstatat(AT_FDCWD, "/lib", {st_mode=S_IFDIR|0755, st_size=4096, ...}, 0) = 0
newfstatat(AT_FDCWD, "/var", {st_mode=S_IFDIR|0755, st_size=4096, ...}, 0) = 0
newfstatat(AT_FDCWD, "/run", {st_mode=S_IFDIR|0755, st_size=940, ...}, 0) = 0
newfstatat(AT_FDCWD, "/boot", {st_mode=S_IFDIR|0755, st_size=4096, ...}, 0) = 0
newfstatat(AT_FDCWD, "/lib64", {st_mode=S_IFDIR|0755, st_size=4096, ...}, 0) = 0
newfstatat(AT_FDCWD, "/tmp", {st_mode=S_IFDIR|S_ISVTX|0777, st_size=16384, ...}, 0) = 0
newfstatat(AT_FDCWD, "/lost+found", {st_mode=S_IFDIR|0700, st_size=16384, ...}, 0) = 0
newfstatat(AT_FDCWD, "/bin", {st_mode=S_IFDIR|0755, st_size=36864, ...}, 0) = 0
newfstatat(AT_FDCWD, "/etc", {st_mode=S_IFDIR|0755, st_size=12288, ...}, 0) = 0
newfstatat(AT_FDCWD, "/opt", {st_mode=S_IFDIR|0755, st_size=4096, ...}, 0) = 0
newfstatat(AT_FDCWD, "/cdrom", {st_mode=S_IFDIR|0775, st_size=4096, ...}, 0) = 0
newfstatat(AT_FDCWD, "/proc", {st_mode=S_IFDIR|0555, st_size=0, ...}, 0) = 0
newfstatat(AT_FDCWD, "/swapfile", {st_mode=S_IFREG|0600, st_size=1581271040, ...}, 0) = 0
newfstatat(AT_FDCWD, "/lib32", {st_mode=S_IFDIR|0755, st_size=4096, ...}, 0) = 0
newfstatat(AT_FDCWD, "/usr", {st_mode=S_IFDIR|0755, st_size=4096, ...}, 0) = 0
newfstatat(AT_FDCWD, "/sys", {st_mode=S_IFDIR|0555, st_size=0, ...}, 0) = 0

@matteius matteius added Category: Performance Issue relates to performance Type: Possible Bug This issue describes a possible bug in pipenv. labels Dec 24, 2021
@icy-ux
Copy link
Author

icy-ux commented Dec 25, 2021 via email

@tokeefe
Copy link

tokeefe commented Mar 9, 2022

I was seeing this as well. Try creating a Pipfile with something in it that's valid TOML e.g.,

echo '[foo]' > Pipfile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Performance Issue relates to performance Type: Possible Bug This issue describes a possible bug in pipenv.
Projects
None yet
Development

No branches or pull requests

3 participants