-
Notifications
You must be signed in to change notification settings - Fork 293
Problem with pip cache permissions #62
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
Comments
If I take the -u uid:gid option off of the docker call it works. It seems my uid (501) is not in the docker image, so it barfed when trying to write to /tmp. Also I had to upgrade go because I was getting a "split stack overflow", but that may just be a docker issue. Is it permissible to remove the -u option from the docker command? |
Yeah, that's reasonable. Maybe a |
+1 been having this problem months ago on OS-X. I started manually packaging that project, but a new project I wanted to use this and found this bug report just now. Removing the -u option fixed this for me. I wouldn't mind creating a MR to help fix this... but I'm not sure the right way to fix this. I can do a noDockerUser as suggested above, or perhaps detect the host OS and skip the -u option altogether if on OS-X. Thoughts/ideas/feedback from other contributors? |
I'm ok with detecting OS. If you check for |
I've released this in version |
Thanks guys... just tried the patch locally also, works great on OS-X. Cheers! |
@AndrewFarley and @dschep I'm seeing this issue on Ubuntu. Is the fix here supposed to work on other OSes? Or is there an alternative workaround suggested? |
@fernando-mc checkout the v4 beta release, I just merged #145 which may help with this. ( |
@dschep this still seems to be failing for me (I turned on the debug logs if it helps):
Here's the stack trace:
And my environment info:
Any suggestions? |
@dschep I think this might actually be related to either #158 or a bug with Ubuntu. https://bugs.launchpad.net/ubuntu/+source/python-pip/+bug/1635463 When I removed the pkg-resources line in my requirements.txt this worked fine. |
Thanks for the report @fernando-mc. Was the |
@dschep yep! Just removing the line resolved this. Not sure it will break anything on other OSes doing this but it resolved the issue on Ubuntu 16.04. |
I think I'm seeing the same issue on Ubuntu 16.04, running
I don't have Is this the same issue of docker not running pip as the correct user, or an error with this wheels package? |
Hmm. are you using a custom docker image? |
@dschep No I'm using the default lambci/lambda image. |
Same error/problem here. @dschep How are you starting the docker image? |
Hey @simlu and @danbovey and anyone else with this caching issue still, can you guys do me/us a favor and try my PR to improve caching? See if this solves the problem? In the PR we are making caching an actual feature, not something you "kinda hack in poorly" with a pip option. Additionally, the PR significantly changes (and limits) the scope of what docker does, which should eliminate all permissions issues. To do this...
Then in your serverless.yml enable the cache with...
Then try a few full deploys... see if that works. The first time might be slow (normal speed, filling the download cache), but the second should be faster. If that works for you, please also then try the following to enable the "static" cache (which caches the outputs of pip, not just the downloads). To do this...
And if that works, you'll see your builds go super-fast after the first time as long as your requirements.txt doesn't change (which it rarely does). Let me know how that works, and if that solves your problem. Thanks! |
For now I've fixed this by using pipCmdExtraArgs:
- --no-cache-dir I'll try your branch next |
Getting an error when trying to install as you described:
|
Tried with but still getting the same permission error. I should highlight that we use our own docker container and then run sls deploy inside it. So we have |
@simlu Ahh... alright, well, your issue is a bit different than most of the rest above whose problem revolves around this plugin using docker. You've got a bit of a custom thing going... that sounds like you just need to add a chown to one of your steps in your Dockerfile to fix that. Or if your Docker container mounts volumes containing the parent code and that's where you're running serverless from, then that would explain things. |
I tried that initially and couldn't get it to work. So I thought this might be a nice and easy workaround. Why does your approach not work for our use case then? |
Because my fork still tries to use and pip cache inside the users home directory (sort of) but I bet your dockerfile and the files in your docker file are mounted via a volume which gives them an invalid/null owner which freaks pip out. If you don’t mind sharing your dockerfile and the script and or command you use to deploy your serverless stacks I’d gladly look at it and either advise you what to change or submit a patch to this software. The problem you are facing is specific to pip, not this plugin. :) |
Well, not really. It's using the user coming from the OS so files are accessed/written with the same permissions. For sure, it's from py-gardener which is published under MIT: We run Thank you very much for helping! |
I'm getting some issues with the docker based build and file permissions inside of the container. Any ideas?
Here are the configuration options:
And here is the error message I'm getting:
The text was updated successfully, but these errors were encountered: