Ошибка при попытке доступа к S3 из лямбды (python) - PullRequest
1 голос
/ 24 октября 2019

Я пытаюсь получить доступ к S3 из лямбды (zappa + фляга + питон),

, класс Logicos (): def newlogics (): s3 = boto3.resource ('s3'), возвращают «Работает»

Я получаю приведенную ниже ошибку в строке s3 = boto3.resource ('s3'):

1571927898414] File "/var/task/newlogic_serverless.py", line 34, in newlogics


 [1571927898414] s3 = boto3.resource('s3')
[1571927898414] File "/var/runtime/boto3/__init__.py", line 100, in resource
[1571927898414] return _get_default_session().resource(*args, **kwargs)
[1571927898414] File "/var/runtime/boto3/session.py", line 389, in resource
[1571927898414] aws_session_token=aws_session_token, config=config)
[1571927898414] File "/var/runtime/boto3/session.py", line 263, in client
[1571927898414] aws_session_token=aws_session_token, config=config)
[1571927898414] File "/var/runtime/botocore/session.py", line 827, in create_client

[1571927898414] credentials = self.get_credentials()
[1571927898414] File "/var/runtime/botocore/session.py", line 426, in get_credentials
[1571927898414] 'credential_provider').load_credentials()
[1571927898414] File "/var/runtime/botocore/session.py", line 903, in get_component
[1571927898414] self._components[name] = factory()
[1571927898414] File "/var/runtime/botocore/session.py", line 145, in <lambda>
[1571927898414] lambda:  botocore.credentials.create_credential_resolver(self))
[1571927898414] File "/var/runtime/botocore/credentials.py", line 70, in create_credential_resolver
[1571927898414] container_provider = ContainerProvider()
[1571927898414] File "/var/runtime/botocore/credentials.py", line 1789, in __init__
[1571927898414] fetcher = ContainerMetadataFetcher()
[1571927898414] File "/var/runtime/botocore/utils.py", line 1238, in __init__
[1571927898414] timeout=self.TIMEOUT_SECONDS
[1571927898414] File "/var/runtime/botocore/httpsession.py", line 179, in __init__
[1571927898414] self._manager = PoolManager(**self._get_pool_manager_kwargs())
[1571927898414] File "/var/runtime/botocore/httpsession.py", line 187, in _get_pool_manager_kwargs
[1571927898414] 'ssl_context': self._get_ssl_context(),
[1571927898414] File "/var/runtime/botocore/httpsession.py", line 196, in _get_ssl_context
[1571927898414] return create_urllib3_context()
[1571927898414] File "/var/runtime/botocore/httpsession.py", line 71, in create_urllib3_context
[1571927898414] context.options |= options
[1571927898414] File "/var/lang/lib/python3.7/ssl.py", line 518, in options
[1571927898414] super(SSLContext, SSLContext).options.__set__(self, value)
[1571927898414] File "/var/lang/lib/python3.7/ssl.py", line 518, in options
[1571927898414] super(SSLContext, SSLContext).options.__set__(self, value)
[1571927898414] File "/var/lang/lib/python3.7/ssl.py", line 518, in options
[1571927898414] super(SSLContext, SSLContext).options.__set__(self, value)
[1571927898414] [Previous line repeated 477 more times]
[1571927898414] RecursionError: maximum recursion depth exceeded while calling a Python object

, но, если я запускаю ту же строку кода без zappa, она работает нормально.

Пожалуйста, помогите в этом

1 Ответ

0 голосов
/ 26 октября 2019

Я установил gevent, и это вызвало ошибку. После удаления gevent все работает хорошо

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...