aws / aws/chalice

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

Open
#1,606 2 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
11.1k
Forks
1k
Avg merge
1d 22h
Merged PRs (30d)
2

Description

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](https://user-images.githubusercontent.com/22798229/102579737-eb89d580-40b1-11eb-8048-3239e11b557c.jpg)

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](https://user-images.githubusercontent.com/22798229/102579825-22f88200-40b2-11eb-8596-3649c4767421.jpg)

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](https://user-images.githubusercontent.com/22798229/102579921-605d0f80-40b2-11eb-8ae5-e5d343ab673a.jpg)

Now it is packaged with the appropriate level of permissions:
![Screen Shot 2020-12-17 at 9 38 00 PM](https://user-images.githubusercontent.com/22798229/102579985-84205580-40b2-11eb-8172-23cb2fcd353a.jpg)

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.

Contributor guide

Open the contributing guide

Research direction

Start by inspecting how `chalice deploy` packages `chalice/app.py` and `chalice/__init__.py`, then reproduce the deployment on Mac OS 11.1. Compare the packaged file permissions with the required 644 permissions and verify that a deployment completes without the reported Lambda error.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, python
Domain
build-system, cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.