Skip to content

AttributeError: module 'botocore.vendored.requests' has no attribute 'Session' #21

@underyx

Description

@underyx

Actual Behavior

Lambda functions crash on startup.

Steps to Reproduce the Problem

  1. Deploy a function with addLayers: true with serverless-plugin-datadog@0.5.0

Specifications

  • Datadog Lambda Layer version: whichever "serverless-plugin-datadog": "^0.5.0" adds
  • Python version: 3.7
  • boto3 version: 1.9.225

Stacktrace

[ERROR] AttributeError: module 'botocore.vendored.requests' has no attribute 'Session'
Traceback (most recent call last):
File "/var/lang/lib/python3.7/imp.py", line 234, in load_module
  return load_source(name, filename, file)
File "/var/lang/lib/python3.7/imp.py", line 171, in load_source
  module = _load(spec)
File "<frozen importlib._bootstrap>", line 696, in _load
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/var/task/datadog_handlers/hydrate_users.py", line 3, in <module>
  hydrate_users = datadog_lambda_wrapper(hydrate_users_impl)
File "/opt/python/lib/python3.7/site-packages/datadog_lambda/wrapper.py", line 51, in __init__
  patch_all()
File "/opt/python/lib/python3.7/site-packages/datadog_lambda/patch.py", line 29, in patch_all
  _patch_botocore_requests()
File "/opt/python/lib/python3.7/site-packages/datadog_lambda/patch.py", line 77, in _patch_botocore_requests
  _wrap_requests_request
File "/var/task/wrapt/wrappers.py", line 827, in wrap_function_wrapper
  return wrap_object(module, name, FunctionWrapper, (wrapper,))
File "/var/task/wrapt/wrappers.py", line 773, in wrap_object
  (parent, attribute, original) = resolve_path(module, name)
File "/var/task/wrapt/wrappers.py", line 739, in resolve_path
  original = getattr(parent, attribute)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions