-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Infinite loop on pip when lockfile can't acquire a lock #3532
Comments
@MinchinWeb Does adding |
@xavfernandez , yes that seems to solve it. both |
So this looks like a duplicate of #3245. Could you investigate with a step-by-step debugger to check where pip is hanging ? |
Running with verbose mode on (in a new virtualenv) provides the following:
[ it stalls here, so I end it with CTRL+C ]
So if I read that right, it can't create the lock file because one already exists, so it's waiting for the lock folder to disappear (probably to try again). My guess is this is the infinite loop it's stuck in. Deleting the lock folder in question doesn't seem to help running processes, but does allow a new process to install Sphinx. Update: Turns out there was another rogue lock folder ( Does there need to be a limit applied to how long it will wait? Should some procedure be put in place to clear out old lock folders? Or at least tell the user which lock folder is holding up pip? As a minimum, if you break out of the pip (without using the verbose options), it should tell you what lock folder it's hung up on. |
@xavfernandez : Have I provided enough information to fix the issue? |
Also seeing this infinite loop issue with pip v8.1.1 after installing any package. |
I had the same issue so to bypass it I had to delete the cache .lock of pip as @MinchinWeb has said or I had to put a return after line 56 in mkdirlockfile.py to avoid the time.sleep function |
Hi, and the same solution as done by @Reston, fixes the issues. Before this every pip install got stuck after the successfully installed message |
I'm running into this issue as well and it basically boils down to mkdirlockfile getting stuck because the timeout is You get stuck hitting the time.sleep() and while loop endlessly here: This happens to me on OSX Sierra using python and pip installed via brew.
|
Perhaps the simplest is to add |
Since this is still open, and I've had this issue multiple times, I'm adding info from my side (it's happened multiple times but it has sort of resolved itself after a while, don't actually know why).
EDIT:
|
Deleting The bug I think is rather that some earlier usage of pip leaves a lock-file in place? ( |
The approach @MinchinWeb used worked for me as well. Thanks for bringing this up! |
Happened to me just now with 9.0.1 on Mac OS X. Not sure where the lock file is though to remove it. :-( (Edit: Removing |
I'm experiencing this problem. I'm using The output of a regular
And then it hangs. The final part of the output of
After I interrupt it, two tracebacks are shown:
I set a breakpoint at the line where it freezes. At this point:
The cache directory is on a networked file system and may be shared between multiple hosts. It may be that pip running on either this or another machine got violently interrupted and failed to clean up after itself. Now it's stuck forever. |
I can also confirm that deleting (or renaming) the directory |
This seems to be a bug in the lockfile module which we vendor. We don't normally modify vendored libraries, rather asking for bugs to be reported to the vendored package's maintainers, and we'll pick up the fix when we re-vendor. However, in this case, lockfile has apparently been deprecated (from the PyPI page, "Note: This package is deprecated. It is highly preferred that instead of using this code base that instead fasteners or oslo.concurrency is used instead."). Unfortunately, migrating to another library is a non-trivial exercise, and the two suggested options may be problematic - fasteners doesn't seem to have seen much recent activity, and oslo.concurrency seems much broader in scope. @pypa/pip-committers what's the best option here? We do carry some patches to vendored code in the |
Thanks @pradyunsg - I missed that issue when I was looking (annoying, as I did recall we'd raised the question previously). |
You're welcome! ^>^ I remember thinking that all issues that mention lockfile should get linked to that, for completely connecting things and tying loose ends, but never actually got to it. I'll see if I get the time for that. |
I am not sure if this is the same bug as the one I linked fro virtualenv but in my case an upgrade of httplib2 (py27) did help be avoid having to clean the cache (which is something that should never be needed).
I know for sure that the version I already had on the system (0.9.2) was buggy. |
Otherwise we might run into some weird infinite loop issues within pip's cache handling under certain circumstances, and we really don't want to risk that in the field. See also #2543 for another issue worked around by this, and pypa/pip#3532 for the core issue
10 versions later, still bugged. Possibly unique bug.
|
here's a strace dump:
|
For folks who want to help resolve this issue, #4766 is likely the best way to fix this. |
We've fixed this via #4766. |
It's a little bit amazing to see the winding, 3 year road from bug report to fix. Keep up the good work! |
Description:
pip list -o
with Sphinx 1.3.6 (the current version) causes pip to go into some sort of infinite loop. Nothing is printed to the console.pip install sphinx -U
) starts an infinite loop and nothing seems to happenWhat I've run:
The text was updated successfully, but these errors were encountered: