0

So i deployed my django project on AWS account through Zappa. Then i added the 'timeout_seconds' parameter and set it to 300 in zappa_settings.json. On running 'zappa update dev', it gives the following error:

"botocore.exceptions.ParamValidationError: Parameter validation failed:
Invalid type for parameter Timeout, value:  300,, type: <class 'str'>, valid types: <class 'int'>"

I want to increase the timeout of the lambda function to 300 seconds.

Here is the full error traceback:

(venv) C:\Users\tansingh\Downloads\PriceAPP\Code & Sample Input\Aws_pricing>zappa update dev
(s3transfer 0.2.0 (c:\users\tansingh\downloads\priceapp\code & sample input\aws_pricing\venv\lib\site-packages), Requirement.parse('s3transfer<0.2.0,>=0.1.10'), {'boto3'})
Calling update for stage dev..
Downloading and installing dependencies..
 - pandas==0.23.3: Using locally cached manylinux wheel
 - numpy==1.14.5: Using locally cached manylinux wheel
 - sqlite==python3: Using precompiled lambda package
'python3.7'
Packaging project as zip.
Uploading aws-pricing-app-dev-1559297372.zip (36.9MiB)..
100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 38.7M/38.7M [00:07<00:00, 3.52MB/s]
Updating Lambda function code..
Updating Lambda function configuration..
Oh no! An error occurred! :(

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

Traceback (most recent call last):
  File "c:\users\tansingh\downloads\priceapp\code & sample input\aws_pricing\venv\lib\site-packages\zappa\cli.py", line 2779, in handle
    sys.exit(cli.handle())
  File "c:\users\tansingh\downloads\priceapp\code & sample input\aws_pricing\venv\lib\site-packages\zappa\cli.py", line 509, in handle
    self.dispatch_command(self.command, stage)
  File "c:\users\tansingh\downloads\priceapp\code & sample input\aws_pricing\venv\lib\site-packages\zappa\cli.py", line 556, in dispatch_command
    self.update(self.vargs['zip'], self.vargs['no_upload'])
  File "c:\users\tansingh\downloads\priceapp\code & sample input\aws_pricing\venv\lib\site-packages\zappa\cli.py", line 970, in update
    aws_kms_key_arn=self.aws_kms_key_arn
  File "c:\users\tansingh\downloads\priceapp\code & sample input\aws_pricing\venv\lib\site-packages\zappa\core.py", line 1223, in update_lambda_configuration
    'Mode': 'Active' if self.xray_tracing else 'PassThrough'
  File "c:\users\tansingh\downloads\priceapp\code & sample input\aws_pricing\venv\lib\site-packages\botocore\client.py", line 357, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "c:\users\tansingh\downloads\priceapp\code & sample input\aws_pricing\venv\lib\site-packages\botocore\client.py", line 634, in _make_api_call
    api_params, operation_model, context=request_context)
  File "c:\users\tansingh\downloads\priceapp\code & sample input\aws_pricing\venv\lib\site-packages\botocore\client.py", line 682, in _convert_to_request_dict
    api_params, operation_model)
  File "c:\users\tansingh\downloads\priceapp\code & sample input\aws_pricing\venv\lib\site-packages\botocore\validate.py", line 297, in serialize_to_request
    raise ParamValidationError(report=report.generate_report())
botocore.exceptions.ParamValidationError: Parameter validation failed:
Invalid type for parameter Timeout, value:  300,, type: <class 'str'>, valid types: <class 'int'>

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

This is the zappa_settings.json file:

{
    "dev": {
        "aws_region": "us-east-1",
        "django_settings": "uploads.settings",
        "profile_name": "default",
        "project_name": "aws-pricing-app",
        "runtime": "python3.7",
        "s3_bucket": "od-aws-pricing",
        "timeout_seconds": 300,
        "manage_roles": true,
        "cors": true
    }
}

Can someone help with this? Thanks.

Jay
  • 2,861
  • 3
  • 29
  • 51
jonsnow
  • 89
  • 4
  • Might be helpful to post the part of your json file with the timeout value shown. Make sure the value is an integer and not a string. `300` vs `"300"` – Austin May 31 '19 at 10:36
  • Thanks for the reply Austin, I just update the question with the json file – jonsnow May 31 '19 at 11:26
  • The error suggests that your `zappa_settings.json` has the line: `"timeout_seconds": " 300,"` - check for typos? – Jay May 31 '19 at 11:50
  • I have checked many times Jay, everything seems fine. There are no quotes around 300. It's an integer only. – jonsnow May 31 '19 at 12:00

0 Answers0