Miserlou / Zappa

Serverless Python
https://blog.zappa.io/
MIT License
11.89k stars 1.2k forks source link

Getting error InvalidParameterValueException: An error occurred (InvalidParameterValueException) #1541

Closed nielsonsantana closed 6 years ago

nielsonsantana commented 6 years ago

I tried debug Zappa, but I don't know how.

Context

Python 2.7 Zappa 0.46.1

Expected Behavior

That the code be deployed

Actual Behavior

Possible Fix

I don't know how debug zappa.

Steps to Reproduce

Zappa docker image to deploy

 alias zappashell27='docker run -ti -e AWS_PROFILE=$AWS_PROFILE -e AWS_DEFAULT_REGION=$AWS_DEFAULT_REGION -v $HOME/.virtualenvs/$(getdirname):/var/venv -v $(pwd):/var/task -v ~/.aws/:/root/.aws --rm dockerrepository/zappa:2.7 bash'
  1. $ zappashell27
  2. $ pip install -r requirements.txt
  3. $ zappa update staging

Your Environment

Traceback


Creating zappa-permissions policy on parceiros-staging-ZappaLambdaExecutionRole IAM Role.
Packaging project as zip.

Warning: Application zip package is likely to be too large for AWS Lambda. Try setting "slim_handler" to true in your Zappa settings file.

Uploading parceiros-staging-1529508166.zip (96.3MiB)..
100%|███████████████████████████████████| 101M/101M [00:35<00:00, 754KB/s]

Updating Lambda function code..
Oh no! An error occurred! :(

==============

Traceback (most recent call last):
  File "/var/venv/lib/python2.7/site-packages/zappa/cli.py", line 2693, in handle
    sys.exit(cli.handle())
  File "/var/venv/lib/python2.7/site-packages/zappa/cli.py", line 504, in handle
    self.dispatch_command(self.command, stage)
  File "/var/venv/lib/python2.7/site-packages/zappa/cli.py", line 551, in dispatch_command
    self.update(self.vargs['zip'], self.vargs['no_upload'])
  File "/var/venv/lib/python2.7/site-packages/zappa/cli.py", line 936, in update
    num_revisions=self.num_retained_versions
  File "/var/venv/lib/python2.7/site-packages/zappa/core.py", line 1100, in update_lambda_function
    response = self.lambda_client.update_function_code(**kwargs)
  File "/var/venv/lib/python2.7/site-packages/botocore/client.py", line 314, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/var/venv/lib/python2.7/site-packages/botocore/client.py", line 612, in _make_api_call
    raise error_class(parsed_response, operation_name)
InvalidParameterValueException: An error occurred (InvalidParameterValueException) when calling the UpdateFunctionCode operation: Unzipped size must be smaller than 262144000 bytes```
scoates commented 6 years ago

Please read through the output. It's very clear what needs to be done and why. Specifically look for any Warnings.