Zappa icon indicating copy to clipboard operation
Zappa copied to clipboard

[Migrated] zappa update errors in docker container with AWS profile/env vars

Open jneves opened this issue 4 years ago • 1 comments

Originally from: https://github.com/Miserlou/Zappa/issues/1934 by SmileSydney

zappa update dev in docker container errors: Warning! Couldn't get function prop-scrape-serverless-dev in ap-southeast-2 - have you deployed yet?

I get this error in either of the two scenrios:

  1. Set AWS_XXXX env vars and removed "profile_name" from zappa_settings.json.
  2. Defined "default" AWS profile and set "profile_name": "default"

Yes virtual on 3.7

Expected Behavior

Should update AWS lambda function

Actual Behavior

Warning! Couldn't get function prop-scrape-serverless-dev in ap-southeast-2 - have you deployed yet?

Possible Fix

Verbose logging would help to understand what the actual problem is

Steps to Reproduce

  1. Set environment vars on docker host (passed in in next step)
  2. docker run --rm -it -e AWS_DEFAULT_REGION="%AWS_DEFAULT_REGION%" -e AWS_ACCESS_KEY_ID="%AWS_ACCESS_KEY_ID%" -e AWS_SECRET_ACCESS_KEY="%AWS_SECRET_ACCESS_KEY%" -v "%CD%":/var/task lambci/lambda:build-python3.7 bash
  3. python -m venv aws_venv
  4. source aws_venv/bin/activate
  5. pip install -r aws_requirements.txt
  6. zappa update

Get error

Your Environment

  • Zappa version used: 0.48.2

  • Operating System and Python version: Docker host: Windows 10 Docker container: lambci/lambda:build-python3.7

  • The output of pip freeze: argcomplete==1.9.3 boto3==1.9.233 botocore==1.12.233 certifi==2019.9.11 cfn-flip==1.2.1 chardet==3.0.4 Click==7.0 docutils==0.14 durationpy==0.5 future==0.16.0 hjson==3.0.1 idna==2.8 jmespath==0.9.3 kappa==0.6.0 lambda-packages==0.20.0 placebo==0.9.0 python-dateutil==2.7.5 python-slugify==1.2.4 PyYAML==5.1.2 requests==2.22.0 s3transfer==0.2.1 selenium==3.141.0 six==1.11.0 SQLAlchemy==1.3.8 toml==0.10.0 tqdm==4.19.1 troposphere==2.5.1 Unidecode==1.1.1 urllib3==1.24.1 Werkzeug==0.16.0 wsgi-request-logger==0.4.6 zappa==0.48.2

  • Link to your project (optional):

  • Your zappa_settings.py: { "dev": { "aws_region": "ap-southeast-2", "project_name": "prop-scrape-serverless", "use_apigateway": false, "runtime": "python3.7", "s3_bucket": "gaia-zappa-deploy", "keep_warm": false, "timeout_seconds": 120, "memory_size": 1024, "environment_variables": { "PATH": "/var/task/chrome" }, "events": [ { "function": "prop_search_scope.lambda_handler", "event_source": { "arn": "arn:aws:sqs:ap-southeast-2:XXXXXXX:YYYYYYYY", "batch_size": 1, "enabled": true } }, { "function": "prop_search_page.lambda_handler", "event_source": { "arn": "arn:aws:sqs:ap-southeast-2:XXXXXXX:YYYYYYYY", "batch_size": 1, "enabled": true } }, { "function": "prop_listing_page.lambda_handler", "event_source": { "arn": "arn:aws:sqs:ap-southeast-2:XXXXXXX:YYYYYYYY", "batch_size": 1, "enabled": true } } ] } }

jneves avatar Feb 20 '21 12:02 jneves

Hi @jneves and @SmileSydney, I think you need to point your update command to your docker image AWS ECR uri also. Read this article here

souravjamwal77 avatar Aug 01 '22 13:08 souravjamwal77

Hi there! Unfortunately, this Issue has not seen any activity for at least 90 days. If the Issue is still relevant to the latest version of Zappa, please comment within the next 10 days if you wish to keep it open. Otherwise, it will be automatically closed.

github-actions[bot] avatar Apr 03 '24 15:04 github-actions[bot]

Hi there! Unfortunately, this Issue was automatically closed as it had not seen any activity in at least 100 days. If the Issue is still relevant to the latest version of Zappa, please open a new Issue.

github-actions[bot] avatar Apr 13 '24 18:04 github-actions[bot]