12

Since a few days ago, zappa deploy fails with the following error (zappa version 0.50.0):

Traceback (most recent call last):
  File "/root/repo/venv/lib/python3.6/site-packages/zappa/cli.py", line 2785, in handle
    sys.exit(cli.handle())
  File "/root/repo/venv/lib/python3.6/site-packages/zappa/cli.py", line 510, in handle
    self.dispatch_command(self.command, stage)
  File "/root/repo/venv/lib/python3.6/site-packages/zappa/cli.py", line 557, in dispatch_command
    self.update(self.vargs['zip'], self.vargs['no_upload'])
  File "/root/repo/venv/lib/python3.6/site-packages/zappa/cli.py", line 993, in update
    endpoint_configuration=self.endpoint_configuration
  File "/root/repo/venv/lib/python3.6/site-packages/zappa/core.py", line 2106, in create_stack_template
    self.cf_template.add_description('Automatically generated with Zappa')
AttributeError: 'Template' object has no attribute 'add_description'
nbeuchat
  • 6,575
  • 5
  • 36
  • 50

2 Answers2

18

Since version 3.0.0, the package troposphere removed the deprecated Template methods (see the changelog).

Breaking changes: * Python 3.6+ (Python 2.x and earlier Python 3.x support is now deprecated due to Python EOL) * Remove previously deprecated Template methods.

The above issue can be fixed by adding troposphere<3 in the requirements file.

nbeuchat
  • 6,575
  • 5
  • 36
  • 50
  • 2
    I also had to delete my function on AWS console and redeploy. Otherwise I was getting some Cloud Formation error. – mLstudent33 Aug 08 '21 at 02:14
  • In requirements.txt, I changed troposphere==3.0.3 to troposphere<3, ran `zappa update dev` but got the same error. Any other ideas? – Vee Sep 09 '21 at 05:23
  • A related issue that many people face is with the most recent version of setuptools. See: https://stackoverflow.com/a/69337822/1855919 – nbeuchat Oct 08 '21 at 08:33
1

The answer by nbeuchat might not work for everyone, an alternative solution that might help would be to change the line in venv/lib/python3.6{or 7,8, etc.}/site-packages/zappa/core.py from add_description() to set_description().

Troposphere updated add_description to set_description along with other previously deprecated template methods which is why you see the problem.

Source

MarMar
  • 180
  • 2
  • 8