Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

588
Vistas
aws-serverless-express connection error - socket hangup

I have a lambda function accessed via API gateway. The function receives username and password and performs authentication on a given active directory.

If the user is found then it calls the database to fetch the user by username > generates JWT and returns it in the response.

For last few days I have been getting CORS errors on the login page. On further inspection of the CloudWatch logs I see these errors

{
    "errno": "ETIMEDOUT",
    "code": "ETIMEDOUT",
    "syscall": "connect",
    "address": "10.1.2.39",
    "port": 389
}
error.code Error: connect ETIMEDOUT 10.1.2.39:389    
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1144:16) 
{  errno: 'ETIMEDOUT',  code: 'ETIMEDOUT',  syscall: 'connect',  address: '10.1.2.39',  port: 389}
ERROR: aws-serverless-express connection error

ERROR   Error: socket hang up    
at connResetException (internal/errors.js:609:14)    
at Socket.socketOnEnd (_http_client.js:458:23)    
at Socket.emit (events.js:326:22)    
at endReadableNT (_stream_readable.js:1241:12)    
at processTicksAndRejections (internal/process/task_queues.js:84:21) {  code: 'ECONNRESET'}

The weird thing is, when I try to log into the application for the first time, I get these errors, but let's say I wait for some 15-20 minutes and then try logging again, no error appears and I am logged in smoothly.

The AD is maintained by the customer and they claim nothing is wrong on their end. This issue started happening recently even though the application has been in production for the last six months.

I am using the activedirectory module for AD authentication. If I run a simple authenticate code locally with the same username and password then it works so there is no problem with AD authentication or the credentials.

I am using Node 12 in my lambda. Also I am using aws-serverless-koa and not express so I am assuming that the error is coming from some dependency (probably activedirectory).

over 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda