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

When calling zappa deploy dev AttributeError: 'Template' object has no attribute 'add_description' #1016

Closed
omar-enrique opened this issue Jul 26, 2021 · 9 comments

Comments

@omar-enrique
Copy link

I'm trying to build and deploy a new Zappa app for the first time, and when I ran Zappa deploy I got the following error:

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/zappa/cli.py", line 3422, in handle
    sys.exit(cli.handle())
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/zappa/cli.py", line 588, in handle
    self.dispatch_command(self.command, stage)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/zappa/cli.py", line 644, in dispatch_command
    self.vargs["docker_image_uri"],
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/zappa/cli.py", line 1194, in update
    endpoint_configuration=self.endpoint_configuration,
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/zappa/core.py", line 2417, in create_stack_template
    self.cf_template.add_description("Automatically generated with Zappa")
AttributeError: 'Template' object has no attribute 'add_description'

Context

I am running python 3.7.2 and am using a virtual environment. Zappa init ran just fine and I was able to generate a zappa_settings.json file.

Here is my pip freeze:

argcomplete==1.12.3
asgiref==3.4.1
boto3==1.18.6
botocore==1.21.6
certifi==2021.5.30
cfn-flip==1.2.3
charset-normalizer==2.0.3
click==8.0.1
Django==3.2.5
durationpy==0.5
future==0.18.2
hjson==3.0.2
idna==3.2
importlib-metadata==4.6.1
jmespath==0.10.0
kappa==0.6.0
pep517==0.11.0
pip-tools==6.2.0
placebo==0.9.0
python-dateutil==2.8.2
python-slugify==5.0.2
pytz==2021.1
PyYAML==5.4.1
requests==2.26.0
s3transfer==0.5.0
six==1.16.0
sqlparse==0.4.1
text-unidecode==1.3
toml==0.10.2
tomli==1.1.0
tqdm==4.61.2
troposphere==2.4.1
typing-extensions==3.10.0.0
urllib3==1.26.6
Werkzeug==0.16.1
wsgi-request-logger==0.4.6
zappa==0.53.0
zipp==3.5.0

Expected Behavior

Zappa should deploy correctly.

Actual Behavior

It looks like a lambda function is created for my Zappa project, but no API gateway is created, so it only gets so far in the deployment process before it fails, and the failure is the traceback as see above.

Your Environment

I am using OSX 11.2.3, and my zappa_settings.json file is:

{
    "dev": {
        "aws_region": "us-east-1",
        "django_settings": "scribox.settings",
        "profile_name": "default",
        "project_name": "django-lambda-i",
        "runtime": "python3.7",
        "s3_bucket": "MY_BUCKET"
    }
}
@Yaronn44
Copy link

Duplicated issue : #999 #1001 #1013

@omar-enrique
Copy link
Author

omar-enrique commented Jul 27, 2021

Thank you for the quick response. I see that there is a pull request in to resolve this issue, and it is currently under code review at #999.

The other two issues have been closed, but should not have been because this issue has still not been resolved. I believe this issue should stay open until #999 gets pulled to master.

@programmingwithalex
Copy link

I can confirm I am having the same issue on Windows 10 with zappa version 0.53.0 installed.

@omar-enrique
Copy link
Author

omar-enrique commented Jul 28, 2021

Not sure when the #999 pull request is going to be reviewed, merged, and released, but for now to get myself unblocked, I manually went into the installed Zappa package I had in my Python modules, and manually edited the line that's breaking. The issue is that the troposphere 3.0.0 version replaces add_description with set_description, so I changed that function in line 2417 in zappa/core.py from add_description to set_description.

https://github.com/zappa/Zappa/blob/master/zappa/core.py#L2417

With that change my app is now deploying just fine.

@gvisalli
Copy link

I also have this problem with deploy.

Need this PR reviewed so I can proceed with using zappa for deploy.

@121940kz
Copy link

This is really still not fixed? Same issue.

@banananeer
Copy link

I just encountered this issue as well

@121940kz
Copy link

121940kz commented Aug 26, 2021

I just encountered this issue as well

omar-enrique has the solution above, if you need help finding the file in windows let me know. It depends on if you use a virtual environment or not, but his answer above got me working.

@rafagan
Copy link

rafagan commented Aug 30, 2021

Zappa is still under maintenance? How could a simply problem like that not be solved fast. Where's the compatibility with flask 2?

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

8 participants