-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
lambda policies need a virtualenv installation. #193
Comments
I haven't seen that one before. It sounds like an issue with the installed environment that's uploading. Could you provide a few more details around the machine your using to run custodian, specifically
|
Hey - false alarm. I did a fresh install and reran my policies and this issue went away. |
i got a report in gitter 1x1 that
we should check both, linux distros have some variations here wrt to location on install that we should respect. |
Hello Hope I can re-open this as am getting the same thing and unable to get past it based on what has already been discussed. Error when running lambda: I updated mu.py line 205 to be dist-packages but that produced the same error with .extern before it was just:
I have confirmed that pkg_resources exist, tried a fresh AMI, pip install --upgrade setuptools, what python version is this? - 2.7.12 |
at this time.. we need a virtualenv installation for lambda policies |
Thanks virtualenv was installed in usr/lib/python2.7/dist-packages but not installed to usr/local/lib/python2.7/site-packages where pkg_resources is currently I removed and installed it to usr/local/lib/python2.7/site-packages and rebuilt with no success I'm going to try and uninstall and reinstall the packages to the usr/local python, see what that does. |
Could you please suggest how to do this virtualenv installation as well ? I am getting the same error |
$ [sudo] pip install virtualenv |
okay thanks let me try |
it doesn't work. I did below root@ip-10-14-15-77 ec2-user]# pip install virtualenv i see installation files here But still get below error Unable to import module 'custodian_policy': No module named pkg_resources Also there is no files under Please advise what i am doing wrong? |
I am unable to proceed further on this. can anyone help me how to resolve this I ran below commands After that i executed my policy. When i run my lambda function i get the below error Unable to import module 'custodian_policy': No module named pkg_resources Please advise how to resolve this issue |
What OS are you running this on? I resolved the issue by switching OS to ubuntu |
Its amazon linux AMI free tier |
okay thx let me try that |
I spinned-up an Ubuntu server in Amazon and did the following pip install virtualenv The lambda functions that is getting created still throws the below error TART RequestId: 6d15b00a-e701-11e6-879f-891763142e64 Version: $LATEST END RequestId: 6d15b00a-e701-11e6-879f-891763142e64 any suggesting please ? This is blocking our evaluation of cloud custodian |
you have to create and activate the virtualenv, merely installing is not sufficient. ie
|
thx kapil, let me try this |
it didn't work, but i am going to re-create my ubuntu instance and do a clean installation. will let you know. |
Now i get a different error Unable to import module 'custodian_policy': No module named packaging.version please advise what i am doing wrong here |
I just reverted back to Amazon linux AMI and it worked now ( under virtualenv) Thanks for the help Kapil, barundel... |
that packaging.version issue is resolved in 0.8.23.0 release |
thanks kapil will take latest release |
@whit537 could you have a look at this one. |
nutshell we need check both dist-packages/site-packages within virtualenv also some variation on linux distros. |
in the meantime we should update the install docs, till this is resolved. |
Sure thing! |
|
Here's the test case I've whittled down to: Steps
policies:
- name: foo
resource: ec2
mode:
type: cloudtrail
role: arn:aws:iam::644160558196:role/custodian-mu
events:
- RunInstances Expected
Actual
|
In the Amazon Linux case I'm working with, the libraries we need are hiding out in |
Okay! PR in #986. |
I'm now getting "Unable to import module 'custodian_policy': No module named ipaddress" after upgrade so waiting eagerly for fix :) |
if you use a virtualenv for your custodian install this issue won't effect you. this fix is about making it work with system python installations. |
This should be closeable now that #997 is in. |
I've manually tested the mailer and sentry tools on |
awesome |
Getting the following error in the cloudwatch log stream associated with the lambda function provisioned after running a policy:
using the policy below and invoking it with
custodian run -c policy.yml -s out --log-group=/cloud-custodian/dev-account/us-west-2 --region us-west-2 -m
Is there something I'm missing that is causing the mu to not create the lambda function zip file correctly?
The text was updated successfully, but these errors were encountered: