最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Error : Connect ENETUNREACH - Stack Overflow

programmeradmin6浏览0评论

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: 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)
...

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: 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)
...

Share Improve this question edited Feb 27, 2018 at 18:56 Jason Aller 3,65228 gold badges41 silver badges39 bronze badges asked Feb 27, 2018 at 18:33 saeedsaeed 1321 gold badge1 silver badge8 bronze badges 2
  • 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 Commented Oct 6, 2018 at 15:02
  • 2 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 Commented Oct 6, 2018 at 20:21
Add a comment  | 

5 Answers 5

Reset to default 6

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

Disabling IPv6 worked for me. Try disabling IPv6 temporarily e.g.

$ sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1
$ sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1
$ sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=1

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

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',

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.

发布评论

评论列表(0)

  1. 暂无评论