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

538
Views
(nodo: 42790) UnhandledPromiseRejectionWarning: Error: el socket cuelga

Estoy tratando de enviar una solicitud POST desde un script de NodeJs al servidor Python (ejecutándose con matraz y camarera).
La mayoría de las veces, la solicitud falla con el siguiente error.

 (node:42790) UnhandledPromiseRejectionWarning: Error: socket hang up at connResetException (internal/errors.js:639:14) at TLSSocket.socketOnEnd (_http_client.js:499:23) at TLSSocket.emit (events.js:412:35) at endReadableNT (internal/streams/readable.js:1334:12) at processTicksAndRejections (internal/process/task_queues.js:82:21) (Use `node --trace-warnings ...` to show where the warning was created) (node:42790) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2) (node:42790) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Estoy usando NodeJs con el paquete axios para enviar la solicitud y la configuración es la siguiente:

 let axiosClient = axios.create({ timeOut: 300000, maxContentLength: Infinity, maxBodyLength: Infinity, httpsAgent: new https.Agent({ keepAlive: true }), httpAgent: new http.Agent({ keepAlive: true }), }); let response = await axiosClient.post(end_point_url, data);

Y cuando revisé en el servidor pude ver que se está enviando la respuesta 200, sin embargo, en el cliente arroja un error.

Mi expectativa es que debería tener éxito en el primer intento, por lo tanto, detectar el error y volver a intentarlo puede no ayudar en mi caso, ya que la mayoría de las veces falla de todos modos.

¿Podría guiarme para encontrar la causa raíz y solucionarlo?

Gracias

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

let response = await axiosClient.post(end_point_url, data);

Debe verificar los puntos finales correctamente y usarlos en el bloque de prueba y captura

about 4 years ago · Juan Pablo Isaza 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!