aws / aws/chalice

'NoneType' object has no attribute 'context' when executing chalice deploy

Open
#374 3 comments 1 reaction 0 assignees View on GitHub
feature-request
Dominant language
Python
Stars
11.1k
Forks
1k
Avg merge
1d 22h
Merged PRs (30d)
2

Description

While executing:

`chalice deploy --no-autogen-policy --stage beta`

I get this error: 'NoneType' object has no attribute 'context'

I have narrowed it down to a single line of code in my application.

```python
def param_value(name):
stage = app.current_request.context['stage']
return stage_param_value(stage, name)
```

If I comment out the line that retrieves the stage from the current_request and replace it with
```python
stage = 'beta'
```

then chalice deploy executes successfully.

Contributor guide

Open the contributing guide

Research direction

Start with the application code containing param_value and reproduce the issue with `chalice deploy --no-autogen-policy --stage beta`. Trace why the current request context is unavailable during deployment; done means deployment succeeds without replacing the stage lookup with a hardcoded value.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, python
Domain
backend, 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.