Zappa: Unable to update lambda function

Context

With the latest release of Zappa (0.48.0), I’m no longer able to update my functions via the zappa update command. I reverted to 0.47.0 and found that it worked as expected.

Initially, when using 0.48.0, the update command failed because it lacked the UpdateAlias lambda permissions. I updated the permissions and retried and it failed with the below error:

Traceback (most recent call last):
  File "/home/circleci/repo/env/lib/python2.7/site-packages/zappa/cli.py", line 2759, in handle
    sys.exit(cli.handle())
  File "/home/circleci/repo/env/lib/python2.7/site-packages/zappa/cli.py", line 509, in handle
    self.dispatch_command(self.command, stage)
  File "/home/circleci/repo/env/lib/python2.7/site-packages/zappa/cli.py", line 556, in dispatch_command
    self.update(self.vargs['zip'], self.vargs['no_upload'])
  File "/home/circleci/repo/env/lib/python2.7/site-packages/zappa/cli.py", line 950, in update
    self.lambda_arn = self.zappa.update_lambda_function(**kwargs)
  File "/home/circleci/repo/env/lib/python2.7/site-packages/zappa/core.py", line 1135, in update_lambda_function
    Name=ALB_LAMBDA_ALIAS,
  File "/home/circleci/repo/env/lib/python2.7/site-packages/botocore/client.py", line 357, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/home/circleci/repo/env/lib/python2.7/site-packages/botocore/client.py", line 661, in _make_api_call
    raise error_class(parsed_response, operation_name)
ResourceNotFoundException: An error occurred (ResourceNotFoundException) when calling the UpdateAlias operation: Alias not found: arn:aws:lambda:us-west-2:xxx:function:xxx-xxx-xxx:current-alb-version

Expected Behavior

The lambda function is updated when calling zappa update without errors.

Actual Behavior

The update command fails with the above error.

Possible Fix

Steps to Reproduce

  1. pip install zappa (installs 0.48.0)
  2. zappa update test (deploy lambda for test environment)
  3. See above error ResourceNotFoundException

Your Environment

  • Zappa version used: 0.48.0
  • Operating System and Python version: Ubuntu 18.04, Python 2.7.15rc1
  • The output of pip freeze:
argcomplete==1.9.3
backoff==1.8.0
boto3==1.9.116
botocore==1.12.116
certifi==2019.3.9
cfn-flip==1.1.0.post1
chardet==3.0.4
Click==7.0
deepdiff==3.3.0
docutils==0.14
durationpy==0.5
flexmock==0.10.3
freezegun==0.3.11
funcsigs==1.0.2
future==0.16.0
futures==3.2.0
fuzzyset==0.0.19
googlemaps==3.0.2
hjson==3.0.1
idna==2.8
jmespath==0.9.3
jsonpickle==1.1
kappa==0.6.0
lambda-packages==0.20.0
mock==2.0.0
pbr==5.1.3
peewee==2.10.2
phonenumbers==8.10.7
placebo==0.9.0
pprint==0.1
PyMySQL==0.9.3
pyshmht==0.0.2
python-dateutil==2.6.1
python-Levenshtein==0.12.0
python-slugify==1.2.4
PyYAML==3.13
requests==2.21.0
s3transfer==0.2.0
six==1.12.0
texttable==1.6.1
toml==0.10.0
tqdm==4.19.1
troposphere==2.4.5
typing==3.6.6
Unidecode==1.0.23
urllib3==1.24.1
urlnorm==1.1.4
Werkzeug==0.14.1
wsgi-request-logger==0.4.6
zappa==0.47.0
  • Link to your project (optional):
  • Your zappa_settings.py:
{
    "test": {
        "app_function": "app.handler",
        "aws_region": "us-west-2",
        "project_name": "xxx-muns",
        "s3_bucket": "zappa-xxx-xxx-xxx-xxx",
        "runtime": "python2.7",
        "memory_size": 1280,
        "keep_warm": false,
        "apigateway_enabled": false,
        "timeout_seconds": 300,
        "log_level": "INFO",
        "events": [
            {
                "function": "app.handler",
                "event_source": {
                    "arn": "arn:aws:kinesis:us-west-2:xxx:stream/xxx-xxx-xxx-xxx",
                    "starting_position": "TRIM_HORIZON",
                    "batch_size": 1,
                    "enabled": true
            }
          }
        ],
        "tags": { 
           "xxx": "xxx",
           "environment": "test"
       },
        "vpc_config": {
          "SubnetIds": [
            "subnet-41649119",
            "subnet-32c44b56"
          ],
          "SecurityGroupIds": [
            "sg-53db3c35"
          ]
        }
    }
}

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 4
  • Comments: 16 (8 by maintainers)

Most upvoted comments

@bruceduhamel yep, I’ve got a patch I’m testing locally.

@cl1ent that’s basically what I’m doing in this PR.