aws / aws/chalice

AttributeError: 'App' object has no attribute '_features_used'

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

Description

I am creating API gateway by Chalice in my CDK application construct.
I have the below dependency packages:

aws-cdk-lib==2.150.0
constructs>=10.0.0,<11.0.0
aws-cdk.aws-lambda-python-alpha==2.150.0a0
boto3
chalice
chalice[cdkv2]
pyyaml
pylint
pylint-exit
schema
aws_lambda_powertools
aws_assume_role_lib
requests

I am getting error while `cdk synth -v`

File "/root/venv/lib/python3.11/site-packages/jsii/_runtime.py", line 118, in __call__
--
863 | inst = super(JSIIMeta, cast(JSIIMeta, cls)).__call__(*args, **kwargs)
864 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
865 | File "/root/venv/lib/python3.11/site-packages/chalice/cdk/construct.py", line 75, in __init__
866 | self._package_app()
867 | File "/root/venv/lib/python3.11/site-packages/chalice/cdk/construct.py", line 91, in _package_app
868 | api.package_app(
869 | File "/root/venv/lib/python3.11/site-packages/chalice/api/__init__.py", line 27, in package_app
870 | packager.package_app(config, output_dir, stage)
871 | File "/root/venv/lib/python3.11/site-packages/chalice/package.py", line 1481, in package_app
872 | resources = self._resource_builder.construct_resources(
873 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
874 | File "/root/venv/lib/python3.11/site-packages/chalice/package.py", line 115, in construct_resources
875 | application = self._application_builder.build(
876 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
877 | File "/root/venv/lib/python3.11/site-packages/chalice/deploy/appgraph.py", line 29, in build
878 | for function in config.chalice_app.pure_lambda_functions:
879 | ^^^^^^^^^^^^^^^^^^
880 | File "/root/venv/lib/python3.11/site-packages/chalice/config.py", line 136, in chalice_app
881 | app = v()
882 | ^^^
883 | File "/root/venv/lib/python3.11/site-packages/chalice/cli/factory.py", line 325, in load_chalice_app
884 | validate.validate_feature_flags(chalice_app)
885 | File "/root/venv/lib/python3.11/site-packages/chalice/deploy/validate.py", line 91, in validate_feature_flags
886 | for feature in chalice_app._features_used:
887 | ^^^^^^^^^^^^^^^^^^^^^^^^^^
888 | AttributeError: 'App' object has no attribute '_features_used'
889 | [13:50:35] failed command: python3 app.py
890 | [13:50:35] Notices refreshed
891 |  
892 | Subprocess exited with error 1
893 | [13:50:35] Error: Subprocess exited with error 1
894 | at ChildProcess. (/usr/local/lib/node_modules/aws-cdk/lib/index.js:452:50678)
895 | at ChildProcess.emit (node:events:517:28)
896 | at ChildProcess.emit (node:domain:489:12)
897 | at ChildProcess._handle.onexit (node:internal/child_process:292:12)
898 |  
899 | [Container] 2024/07/29 13:50:35.126067 Command did not exit successfully cdk synth -v exit status 1
900 | [Container] 2024/07/29 13:50:35.134211 Phase complete: BUILD State: FAILED_WITH_ABORT
901 | [Container] 2024/07/29 13:50:35.134230 Phase context status code: COMMAND_EXECUTION_ERROR Message: Error while executing command: cdk synth -v. Reason: exit status 1









I am stuck here for long...Any hint will be highly appreciated :)

Contributor guide

Open the contributing guide

Research direction

Reproduce `cdk synth -v` with the listed dependency versions and inspect the traceback entry points in `chalice/cdk/construct.py`, `chalice/config.py`, and `chalice/deploy/validate.py`. Trace how the `App` instance is created and validated; done means the reported `_features_used` AttributeError no longer occurs during synthesis.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, python
Domain
api, backend, cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.