Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

591
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda