Sahil
Sahil

Reputation: 511

Connection fails: Error: connect ETIMEDOUT

I am using Loopback with MySql. I am getting following error randomly when I run

nodemon .

or

node .
Web server listening at: http://0.0.0.0:3000
Browse your REST API at http://0.0.0.0:3000/explorer
Connection fails: Error: connect ETIMEDOUT
It will be retried for the next request.
events.js:160
      throw er; // Unhandled 'error' event
      ^

Error: connect ETIMEDOUT
    at PoolConnection.Connection._handleConnectTimeout
  1. How should I fix this issue? On Loopback side configuration or MySQL configuration? NOTE: I am using MAMP for MySQL.
  2. It takes lot of time to start successfully without error. What should I do to fast restart?

Upvotes: 3

Views: 6921

Answers (2)

bmaupin
bmaupin

Reputation: 15995

This seems to be a known issue with MySQL and Loopback that causes the connection to time out under heavy load when Loopback is first starting:

https://github.com/strongloop/loopback-connector-mysql/issues/210

A few possible solutions:

Upvotes: 1

Esakki Krishnan
Esakki Krishnan

Reputation: 469

The most probable cause might be that some other service is using the same port, change the port.

I had similar issue with nodemon not with node though, because of not having system32 folder in my path variable.

Upvotes: 0

Related Questions