Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Django App Times Out on Lambda (Runs Successfully Locally) #1380

Closed
hammadzz opened this issue Feb 6, 2018 · 4 comments
Closed

Django App Times Out on Lambda (Runs Successfully Locally) #1380

hammadzz opened this issue Feb 6, 2018 · 4 comments
Labels

Comments

@hammadzz
Copy link

hammadzz commented Feb 6, 2018

Context

The app runs fine locally but times out in Lambda. It is setup in a private subnet and can access the database as I was able to successfully run migrations through manage command on Zappa. I am even able to create a superuser through Zappa cli.

Expected Behavior

When trying to access the admin page ...amazonaws.com/staging/admin it should load the admin page. If I try to access ...amazonaws.com/staging/ it successfully loads then debug page because of invalid url path.

Actual Behavior

When trying to access the admin page ...amazonaws.com/staging/admin it throws {"message": "Endpoint request timed out"}

Possible Fix

Remove all local apps from INSTALLED_APPS change database connection on RDS to Postgres only and remove Django GIS functionality. Remove GIS related library path in settings.py (GEOS and GDAL).

These attempts to fix didn't work.

Next things: TRIM EVERYTHING (REDIS, CELERY, ETC). If this fails then try with a new project to see if there is an issue with DB Connection or VPC or Security Groups. Any sample projects I can try to deploy in my VPC?

Steps to Reproduce

Sorry unable to provide right now. Will try to start a new project and see if I face the same issue.

Your Environment

  • Zappa version used: 0.45.1
  • Operating System and Python version: OSX 10.13.2 Python 3.6.1
  • Link to your project (optional):
  • Your zappa_settings.py:
staging:
  profile_name: myprofile
  aws_region: us-east-1
  s3_bucket: myproject-zappa
  project_name: myproject-django
  runtime": python3.6
  django_settings: config.settings.zappa
  keep_warm_expression: rate(8 minutes)
  delete_s3_zip: false
  timeout_seconds: 30
  vpc_config:
    SubnetIds:
      - subnet-xxx
      - subnet-xxx
    SecurityGroupIds:
      - sg-xxx
  tags:
    Stage: Staging
  aws_environment_variables:
    GDAL_DATA: "/var/task/gdal_data/"
@hammadzz
Copy link
Author

hammadzz commented Feb 6, 2018

Related to Django Storages, it seems it couldn't access S3. Must be something to do with VPC or Security Group that needs access to the S3 bucket to list static objects.

@Miserlou Miserlou added the aws label Feb 23, 2018
@Miserlou
Copy link
Owner

This is related to your VPC config.

@khixer
Copy link

khixer commented Jul 30, 2021

@hammadzz any solution :)

@hammadzz
Copy link
Author

@khixer sorry unfortunately can't recall it's been far too long

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants