#1880·Zappa

SQLite ImproperlyConfigured exception

Author: ebridgesCreated May 31, 2019Updated Oct 4, 2023

Exception:

raise ImproperlyConfigured('SQLite 3.8.3 or later is required (found %s).' % Database.sqlite_version)

Expected Behavior

An HTTP GET to the API Gateway URL should show the default Django "welcome" page, as is shown when invoking open http://127.0.0.1:8080 on a new Django project.

Actual Behavior

$ zappa deploy
...
Calling deploy for stage dev..
Creating testing-dev-ZappaLambdaExecutionRole IAM Role..
Creating zappa-permissions policy on testing-dev-ZappaLambdaExecutionRole IAM Role.
Downloading and installing dependencies..
 - sqlite==python3: Using precompiled lambda package
'python3.7'
Packaging project as zip.
Uploading testing-dev-1559325136.zip (14.8MiB)..
100%|██████████████████████████████████████████████| 15.6M/15.6M [00:07<00:00, 1.93MB/s]
Scheduling..
Scheduled testing-dev-zappa-keep-warm-handler.keep_warm_callback with expression rate(4 minutes)!
Uploading testing-dev-template-1559325160.json (1.6KiB)..
100%|██████████████████████████████████████████████| 1.60K/1.60K [00:00<00:00, 16.5KB/s]
Waiting for stack testing-dev to create (this can take a bit)..
 75%|███████████████████████████████████████             | 3/4 [00:13<00:05,  5.59s/res]
Deploying API Gateway..
Error: Warning! Status check on the deployed lambda failed. A GET request to '/' yielded a 500 response code.
$ zappa tail
...
[1559325174623] [ERROR] ImproperlyConfigured: SQLite 3.8.3 or later is required (found 3    raise ImproperlyConfigured('SQLite 3.8.3 or later is required (found %s).' % Database.sqlite_version)
...
$ curl https://qzgbmw28gk.execute-api.us-east-1.amazonaws.com/dev
"{'message': 'An uncaught exception happened while servicing this request. You can investigate this with the `zappa tail` command.', 'traceback': ['Traceback (most recent call last):\\n', '  File \"/var/task/handler.py\", line 531, in handler\\n    with Response.from_app(self.wsgi_app, environ) as response:\\n', '  File \"/var/task/werkzeug/wrappers/base_response.py\", line 287, in from_app\\n    return cls(*_run_wsgi_app(app, environ, buffered))\\n', '  File \"/var/task/werkzeug/test.py\", line 1119, in run_wsgi_app\\n    app_rv = app(environ, start_response)\\n', \"TypeError: 'NoneType' object is not callable\\n\"]}"

Steps to Reproduce

bash
mkdir testing
cd testing
poetry init --name=testing --author='[email protected]' 
poetry add django zappa
source $(dirname $(poetry run which python))/activate # activate venv
django-admin startproject myproject .
python manage.py runserver
open http://127.0.0.1:8000/ # confirm all works
zappa init
zappa deploy dev
zappa tail
zappa status

Your Environment

$ sw_vers
ProductName:	Mac OS X
ProductVersion:	10.14.4
BuildVersion:	18E226
$ poetry --version
Poetry 0.12.11
$ python --version
Python 3.7.0
$ django-admin --version
2.2.1
$ zappa --version
0.48.2
Complete list of packages installed in venv
$ poetry show
argcomplete         1.9.3    Bash tab completion for argparse
boto3               1.9.159  The AWS SDK for Python
botocore            1.12.159 Low-level, data-driven core of boto 3.
certifi             2019.3.9 Python package for providing Mozilla's CA Bundle.
cfn-flip            1.2.0    Convert AWS CloudFormation templates between JSON and YAML formats
chardet             3.0.4    Universal encoding detector for Python 2 and 3
click               7.0      Composable command line interface toolkit
django              2.2.1    A high-level Python Web framework that encourages rapid development and clean, pragmatic design.
docutils            0.14     Docutils -- Python Documentation Utilities
durationpy          0.5      Module for converting between datetime.timedelta and Go's Duration strings.
future              0.16.0   Clean single-source support for Python 3 and 2
hjson               3.0.1    Hjson, a user interface for JSON.
idna                2.8      Internationalized Domain Names in Applications (IDNA)
jmespath            0.9.3    JSON Matching Expressions
kappa               0.6.0    A CLI tool for AWS Lambda developers
lambda-packages     0.20.0   AWS Lambda Packages
placebo             0.9.0    Make boto3 calls that look real but have no effect
python-dateutil     2.6.1    Extensions to the standard Python datetime module
python-slugify      1.2.4    A Python Slugify application that handles Unicode
pytz                2019.1   World timezone definitions, modern and historical
pyyaml              5.1      YAML parser and emitter for Python
requests            2.22.0   Python HTTP for Humans.
s3transfer          0.2.0    An Amazon S3 Transfer Manager
six                 1.12.0   Python 2 and 3 compatibility utilities
sqlparse            0.3.0    Non-validating SQL parser
toml                0.10.0   Python Library for Tom's Obvious, Minimal Language
tqdm                4.19.1   Fast, Extensible Progress Meter
troposphere         2.4.7    AWS CloudFormation creation library
unidecode           1.0.23   ASCII transliterations of Unicode text
urllib3             1.25.3   HTTP library with thread-safe connection pooling, file post, and more.
werkzeug            0.15.4   The comprehensive WSGI web application library.
wheel               0.33.4   A built-package format for Python.
wsgi-request-logger 0.4.6    Apache-like combined logging for WSGI Web Applications
zappa               0.48.2   Server-less Python Web Services for AWS Lambda and API Gateway

Zappa settings:

{
    "dev": {
        "aws_region": "us-east-1",
        "django_settings": "myproject.settings",
        "profile_name": "ebridges@roja",
        "project_name": "testing",
        "runtime": "python3.7",
        "s3_bucket": "mybucket"
    }
}