8

I am fetching videos from the facebook graph api(24*7) using nodejs. My code is working fine but after every 3 or 4 days it stops working and gives the following error: (Ignore the I'm in loop statements)

Error file

Error: connect ENETUNREACH 2a03:2990:f015:12:face:b00c:0:2:443 - Local (:::0)
at Object._errnoException (util.js:1003:13)
at _exceptionWithHostPort (util.js.1024:20)
...

Jason Aller
  • 3,541
  • 28
  • 38
  • 38
saeed
  • 112
  • 1
  • 1
  • 7
  • I get a similar error when I try to run a node.js program from rc.local. Runs fine when I run it manually. Curious to see a suggestion on how to troubleshoot this. – Paulo S. Abreu Oct 06 '18 at 15:02
  • 1
    Solved my problem by making sure network services were up before rc.local was run. This was done by running `raspi-config` on my RaspberryPi (where I am running the scripts) and setting `boot options … wait for network at boot … yes` – Paulo S. Abreu Oct 06 '18 at 20:21

4 Answers4

4

Check you internet connection . That solved my problem as ENETUNREACH is a network issue such as host unreachable or your gateway not working .

Cap Barracudas
  • 2,347
  • 4
  • 23
  • 54
-1

In my case, I just changed the localhost property to 127.0.0.1 as follows:

var connection = mysql.createConnection({
  // host     : 'localhost', // localhost causes somehow this error
  host: '127.0.0.1',
Asqan
  • 4,319
  • 11
  • 61
  • 100
-1

I had a similar error, I disabled IPv6 on my computer and then the error stopped occurring.

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Nov 04 '22 at 04:43
  • It also worked on my side – cactuschibre Aug 09 '23 at 09:39
-3

I got the same issue. My problem was I still have the corp proxy settings in npm config. My resolution:

  1. Check if any proxy settings in place
npm config list
  1. Remove them
npm config delete https-proxy

You may have more. But after that, the error's gone.

Dharman
  • 30,962
  • 25
  • 85
  • 135
tuan.dinh
  • 334
  • 1
  • 3
  • 12