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

Permission error running Lambda #8

Closed
xgp opened this issue Jan 20, 2021 · 6 comments
Closed

Permission error running Lambda #8

xgp opened this issue Jan 20, 2021 · 6 comments

Comments

@xgp
Copy link

xgp commented Jan 20, 2021

Hi! Thanks for the great module. I'm having some problems when the notifier Lambda runs. I see the following permissions error in the log stream:

[ERROR] PermissionError: [Errno 13] Permission denied: '/var/task/notifier.py'Traceback (most recent call last):  File "/var/lang/lib/python3.8/imp.py", line 300, in find_module    with open(file_path, 'rb') as file:

any ideas?

@xgp
Copy link
Author

xgp commented Jan 21, 2021

Quick update. The notifier.py file in the .terraform/modules/code_pipeline.codepipeline_notifications/lambdas/notifier.zip bundle has permissions -rw-rw----. When I change it to -rw-r--r-- and destroy/create the lambda, it works fine. FYI I'm using release 1.1.0.

@kjagiello
Copy link
Owner

kjagiello commented Jan 21, 2021

Hi and thanks for your bug report! What version of Terraform are you running? And what permissions does the source notifier.py have on your system?

@xgp
Copy link
Author

xgp commented Jan 21, 2021

Terraform version: 0.13.2

[garth:production (master)]$ ls -lah .terraform/modules/code_pipeline.codepipeline_notifications/lambdas/
total 8
drwxrwx---   4 garth  staff   128B Jan 20 22:19 .
drwxrwx---  13 garth  staff   416B Jan 20 20:41 ..
drwxrwx---   4 garth  staff   128B Jan 20 20:41 notifier
-rw-rw----   1 garth  staff   1.5K Jan 20 22:19 notifier.zip
[garth:production (master)]$ ls -lah .terraform/modules/code_pipeline.codepipeline_notifications/lambdas/notifier
total 24
drwxrwx---  4 garth  staff   128B Jan 20 20:41 .
drwxrwx---  4 garth  staff   128B Jan 20 22:19 ..
-rw-rw----  1 garth  staff   3.8K Jan 20 20:41 notifier.py
-rw-rw----  1 garth  staff   5.4K Jan 20 20:41 tests.py

@kjagiello
Copy link
Owner

Great, thanks! I'll look into it and get back to you!

@kjagiello
Copy link
Owner

This might give you some clue regarding what might be the issue. hashicorp/terraform-provider-archive#59 It seems like you possibly have custom umask set? Nevertheless, it looks like I'll not be able to control the access control flags in the generated archive from the module as archive_file does not expose any way of doing that.

@xgp
Copy link
Author

xgp commented Mar 19, 2021

Thanks for following up. Everyone on my team seems to have the same problem, so it may be how we have our environments set up. I'll check.

@xgp xgp closed this as completed Mar 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants