Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Incorrect permissions on chalice/app.py and chalice/__init__.py #1606

Open
danerwilliams opened this issue Dec 18, 2020 · 2 comments
Open

Incorrect permissions on chalice/app.py and chalice/__init__.py #1606

danerwilliams opened this issue Dec 18, 2020 · 2 comments

Comments

@danerwilliams
Copy link

When using chalice deploy to deploy a project from Mac OS 11.1, the permissions of files chalice/app.py and chalice/__init__.py that are packaged by chalice are not open enough, leading to the following error:
Screen Shot 2020-12-17 at 9 33 58 PM

If you look at the deployment it becomes apparent that chalice/app.py and chalice/__init__.py do not have 644 permissions as required by lambda:
Screen Shot 2020-12-17 at 9 33 04 PM

I was able to fix this by simply using chmod 644 to change the permissions on chalice source code:
Screen Shot 2020-12-17 at 9 37 35 PM

Now it is packaged with the appropriate level of permissions:
Screen Shot 2020-12-17 at 9 38 00 PM

Not sure what the best way forward would be as far as making sure the permissions are correct by default when installing chalice with pip, but I figured I would at least post this to give a solution for others running in to the same issue.

@jamesls
Copy link
Member

jamesls commented Jan 7, 2021

I believe what's happening is that if you install chalice globally, it uses -rw------- for the chalice library files. We preserve the file permissions when we zip a file so we should be able to special case the built-in chalice files to ensure they're always readable by all.

However, I would recommend using a virtualenv if possible, it should also fix this issue for you.

@dan-glass
Copy link

We are experienced the same issue. Is there a mechanism in Chalice to trigger a script locally prior to creating the zip so that file permissions can be correctly set?

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

3 participants