yoursunny / NDNts

NDN libraries for the Modern Web
https://ndnts-docs.ndn.today
ISC License
31 stars 9 forks source link

error while connecting to the forwarder (Connection refused) #1

Closed cyclopse87 closed 4 years ago

cyclopse87 commented 4 years ago

I seem to be running into this error when i run this on a raspberry pi 4b its seems to be working fine on my laptop.

I get the following error even when i run nfdc status, but when i run nfd-start everything looks fine


pi@raspberrypi:~ $ NFD version 0.7.0-23-g1752159a starting
Built with Clang version 9.0.0 (http://git-us.linaro.org/toolchain/jenkins-scripts.git d13bb6bafb2139131749cebad3ed0862013bb7b6), with GNU libstdc++ version 20190406, with Boost version 1.62.0, with libpcap version 1.8.1, with WebSocket++ version 0.8.1, with ndn-cxx version 0.7.0-26-g78ffc635
1590914901.724933  INFO: [nfd.FaceTable] Added face id=255 remote=null:// local=null://
1590914901.725080  INFO: [nfd.FaceTable] Added face id=254 remote=contentstore:// local=contentstore://
1590914901.725268  INFO: [nfd.CsPolicy] setLimit 10
1590914901.725558  INFO: [nfd.StrategyChoice] setDefaultStrategy /localhost/nfd/strategy/best-route/%FD%05
1590914901.725907  INFO: [nfd.FaceTable] Added face id=1 remote=internal:// local=internal://
1590914901.727492  WARN: [nfd.CommandAuthenticator] 'certfile any' is intended for demo purposes only and SHOULD NOT be used in production environments
1590914901.728307  INFO: [nfd.StrategyChoice] changeStrategy(/ndn/broadcast) /localhost/nfd/strategy/best-route/%FD%05 -> /localhost/nfd/strategy/multicast/%FD%03
1590914901.728401  INFO: [nfd.StrategyChoice] changeStrategy(/localhost) /localhost/nfd/strategy/best-route/%FD%05 -> /localhost/nfd/strategy/multicast/%FD%03
1590914901.728500  INFO: [nfd.StrategyChoice] changeStrategy(/localhost/nfd) /localhost/nfd/strategy/multicast/%FD%03 -> /localhost/nfd/strategy/best-route/%FD%05
1590914901.728594  INFO: [nfd.CsPolicy] setLimit 65536
1590914901.728632  INFO: [nfd.CsPolicy] setLimit 65536
1590914901.728742  INFO: [nfd.EthernetFactory] enabling multicast on 01:00:5e:00:17:aa
1590914901.728913  INFO: [nfd.TcpChannel] [tcp4://0.0.0.0:6363] Creating channel
1590914901.729076  INFO: [nfd.UdpChannel] [udp4://0.0.0.0:6363] Creating channel
1590914901.729150  INFO: [nfd.UdpChannel] [udp6://[::]:6363] Creating channel
1590914901.729209  INFO: [nfd.UdpFactory] enabling multicast on 224.0.23.170:56363
1590914901.729251  INFO: [nfd.UdpFactory] enabling multicast on [ff02::1234]:56363
1590914901.729389  INFO: [nfd.UnixStreamChannel] [unix:///run/nfd.sock] Creating channel
1590914901.729588  INFO: [nfd.WebSocketChannel] [ws://0.0.0.0:9696] Creating channel
yoursunny commented 4 years ago

Can you post the JavaScript or TypeScript code you’re trying to run?

cyclopse87 commented 4 years ago

I am trying to run the producer.mjs example code on your blog.

I first got the following error after running NDNTS_NFDREG=1 node ./producer.mjs

$ NDNTS_NFDREG=1 node ./producer.mjs
(node:13199) UnhandledPromiseRejectionWarning: Error: connect ECONNREFUSED /run/nfd.sock
    at PipeConnectWrap.afterConnect [as oncomplete] (net.js:1141:16)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:13199) 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: 1)
(node:13199) [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.

On further inspection I also noticed am getting a similar error when i try to run nfdc.

yoursunny commented 4 years ago

The examples in Getting Started with NDNts in Node.js require local NFD to be running. Error: connect ECONNREFUSED /run/nfd.sock indicates NFD is not accepting connections on /run/nfd.sock socket.

On the other hand, this line

1590914901.729389  INFO: [nfd.UnixStreamChannel] [unix:///run/nfd.sock] Creating channel

seems to suggest that the socket listener is opened at the correct path.

Given nfdc is also not working, you'll need to fix NFD problems first. Join nfd-dev mailing list and ask there.

cyclopse87 commented 4 years ago

Ok great wanted to make sure it was an NFD issue as this bit confused me too.

On the other hand, this line

1590914901.729389 INFO: [nfd.UnixStreamChannel] [unix:///run/nfd.sock] Creating channel

seems to suggest that the socket listener is opened at the correct path.

Ok thanks anyway great work on this library BTW.