Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

1.4K
Views
botocore.exceptions.ConnectTimeoutError: tiempo de espera de conexión en la URL del punto final

Estoy usando boto3 para leer muchos archivos de texto en S3 a través de una función de Lambda Python.

Mis códigos para la conexión a S3 a continuación

 config = Config( read_timeout=900, connect_timeout=900, retries={"max_attempts": 0} ) session = boto3.Session(region_name='ap-southeast-2') s3 = session.resource('s3', config=config) bucket = s3.Bucket(bucket) for obj in bucket.objects.all():

Alrededor de 30 archivos de texto están bien. Pero después, aparece el siguiente mensaje de error.

 [ERROR] 2021-09-01T09:35:08.628Z 6a5bf649-2057-43e4-a3eb-1b4438e582fb Exception on /process [POST] Traceback (most recent call last): File "/opt/python/urllib3/connection.py", line 169, in _new_conn conn = connection.create_connection( File "/opt/python/urllib3/util/connection.py", line 96, in create_connection raise err File "/opt/python/urllib3/util/connection.py", line 86, in create_connection sock.connect(sa) socket.timeout: timed out During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/var/runtime/botocore/httpsession.py", line 323, in send urllib_response = conn.urlopen( File "/var/task/serverless_sdk/vendor/wrapt/wrappers.py", line 602, in __call__ return self._self_wrapper(self.__wrapped__, self._self_instance, File "/opt/python/urllib3/connection.py", line 353, in connect conn = self._new_conn() File "/opt/python/urllib3/connection.py", line 174, in _new_conn raise ConnectTimeoutError( urllib3.exceptions.ConnectTimeoutError: (<botocore.awsrequest.AWSHTTPSConnection object at 0x7fe7b7a3e130>, 'Connection to xxxxxxxxxxxxxxxxxxxxxx.amazonaws.com timed out. (connect timeout=5)') During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/tmp/sls-py-req/flask/app.py", line 2070, in wsgi_app response = self.full_dispatch_request() File "/var/runtime/botocore/httpsession.py", line 356, in send raise ConnectTimeoutError(endpoint_url=request.url, error=e) botocore.exceptions.ConnectTimeoutError: Connect timeout on endpoint URL: "https://xxxxxxxxxxxxxxxxx.s3.ap-southeast-2.amazonaws.com/?encoding-type=url"

¿Alguna forma de resolver esto?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Lambda en una VPC no tiene IP pública y, por lo tanto, no puede acceder a Internet desde subredes públicas. Por lo tanto, puede crear una puerta de enlace NAT en una subred pública y colocar su lambda en una subred privada . Una vez que configure las tablas de rutas para cualquier conexión 0.0.0.0/0 en la subred privada para ir a la NAT, su lambda obtendrá acceso a Internet:

  • ¿Cómo doy acceso a Internet a una función de Lambda que está conectada a una VPC de Amazon?

En su lugar, puede evitar el uso de NAT e Internet con el punto de enlace de la interfaz de VPC para AWS Config.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!