Netflix-Skunkworks / raven-python-lambda

Sentry/Raven SDK Integration For AWS Lambda (python) and Serverless
Apache License 2.0
47 stars 15 forks source link

Requires boto3 as a dependency? #18

Closed Tethik closed 6 years ago

Tethik commented 6 years ago

I get the following error when trying to invoke locally (i.e. serverless invoke local). However deployed on aws it works fine, presumably because boto3 is already installed as a system package.

Fixed by installing boto3. Should it be required as a dependency though?

Traceback (most recent call last):
  File "/home/tethik/.nvm/versions/node/v8.4.0/lib/node_modules/serverless/lib/plugins/aws/invokeLocal/invoke.py", line 57, in <module>
    module = import_module(args.handler_path.replace('/', '.'))
  File "/home/tethik/.python-envs/<censored>-txyGfC0o/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 978, in _gcd_import
  File "<frozen importlib._bootstrap>", line 961, in _find_and_load
  File "<frozen importlib._bootstrap>", line 950, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 205, in _call_with_frames_removed
  File "./circlebot/handler.py", line 37, in <module>
    from raven_python_lambda import RavenLambdaWrapper
  File "/home/tethik/.python-envs/<censored>-txyGfC0o/lib/python3.6/site-packages/raven_python_lambda/__init__.py", line 23, in <module>
    from raven_python_lambda.sqs_transport import SQSTransport
  File "/home/tethik/.python-envs/<censored>-txyGfC0o/lib/python3.6/site-packages/raven_python_lambda/sqs_transport.py", line 12, in <module>
    import boto3
ModuleNotFoundError: No module named 'boto3'
kevgliss commented 6 years ago

So, we use SQS as a transport to avoid having our Lambda function deployed to VPCs. I think lambda functions always come with boto3 which is probably why we missed this. Adding boto3 as a dependency seems pretty safe.