[Solved] Error: Error on WS Server

folatt@Gildurklaus:~ $ duniter -V
1.5.9
folatt@Gildurklaus:~ $ duniter direct_webstart
2018-01-22T19:52:30+00:00 - debug: Plugging file system...
2018-01-22T19:52:30+00:00 - debug: Loading conf...
2018-01-22T19:52:30+00:00 - debug: Configuration saved.
2018-01-22T19:52:30+00:00 - debug: Opening SQLite database "/home/folatt/.config/duniter/duniter_default/duniter.db"...
2018-01-22T19:52:30+00:00 - debug: Upgrade database...
2018-01-22T19:52:30+00:00 - info: Block resolution: 0 potential blocks after current#121847...
2018-01-22T19:52:30+00:00 - info: Web administration accessible at following address: http://localhost:9220
2018-01-22T19:52:30+00:00 - info: Crawling the network...
2018-01-22T19:52:30+00:00 - info: Pulling blocks from the network...
2018-01-22T19:52:30+00:00 - info: Duniter server listening on http://192.168.178.30:10901
2018-01-22T19:52:30+00:00 - error: Error on WS Server
2018-01-22T19:52:30+00:00 - error:  Error: listen EACCES 2001:983:8610:1:2239:6fcb:6144:21d2:80
    at Object.exports._errnoException (util.js:1020:11)
    at exports._exceptionWithHostPort (util.js:1043:20)
    at Server._listen2 (net.js:1245:19)
    at listen (net.js:1294:10)
    at net.js:1404:9
    at _combinedTickCallback (internal/process/next_tick.js:83:11)
    at process._tickCallback (internal/process/next_tick.js:104:9)
2018-01-22T19:52:30+00:00 - error:  Error: listen EACCES 2001:983:8610:1:2239:6fcb:6144:21d2:80
    at Object.exports._errnoException (util.js:1020:11)
    at exports._exceptionWithHostPort (util.js:1043:20)
    at Server._listen2 (net.js:1245:19)
    at listen (net.js:1294:10)
    at net.js:1404:9
    at _combinedTickCallback (internal/process/next_tick.js:83:11)
    at process._tickCallback (internal/process/next_tick.js:104:9)

It seems your node tries to connect on port 80, on which he can’t. Either because not root, or because a web server is already running…

2 Likes

Or because your IPv6 address changed. It often occurs on my machine.

I thought duniter was meant to be run as non-root?

Yes, that’s why it should not listen on port 80!

2 Likes

Okay, so I’m confused.
Which port should be used instead?
Any port above 1024?
Does that mean port 443 should not be used either?

I have this:

conf.json

...
"endpoints": [
  "BASIC_MERKLE_API guilder-test.eu.org 80"
 ],
...
"port": 10901,
...
"remoteport": "80",

duniter.conf

       ...
       proxy_pass             http://localhost:10901;
       ...

guilder-test.eu.org.conf

...
    listen 80;
    listen [::]:80;
...
    listen 443 ssl;
    listen [::]:443 ssl;
...

And this is how I understand it:

Guilder-Test-Network

Is this picture correct?

Almost :slight_smile:

There is no link between “port” and “port sharing”

Your configuration seems correct. Do you have the same errors ?

1 Like

If the picture is correct, could I set endpoint to "BASIC_MERKLE_API 192.168.[local.ipv4] 80" or even
"BASIC_MERKLE_API local:link:i:p:v:6 80"?

It’s a link between “port” and “no port sharing” to indicate that the link goes via router but does not need any port sharing configuration on the router.

It’s not been changed, so yes.

Yes, you could. Or even, use the DNS instead of the IP.

It is probably another bug… Like @cgeek mentioned. I think you should use the DNS in the endpoint configuration.

1 Like

I have so far only used DNS.
I did not know if port stood for access to localhost only or local network.

"BASIC_MERKLE_API guilder-test.eu.org 80" remains then

The ipv6 address is correct.

admin@Gildurklaus:~ $ ip addr show eth0
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether b8:27:eb:3f:e0:d9 brd ff:ff:ff:ff:ff:ff
    inet 192.168.178.30/24 brd 192.168.178.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 2001:983:8610:1:2239:6fcb:6144:21d2/64 scope global noprefixroute dynamic 
       valid_lft 6487sec preferred_lft 3368sec
    inet6 fe80::7664:c1e:6989:14b0/64 scope link 
       valid_lft forever preferred_lft forever

If it is exactly the same bug, there is something weird going on. Duniter should not try to listen on port 80 given your configuration.

1 Like

The bug is exactly the same apart from the timestamp.

What happened prior is that I updated duniter and before that I had a connection with G1-test, it started downloading and at some point it cut off and was no longer able to connect back to it.

folatt@Gildurklaus:~/.config/duniter/duniter_default $ cat conf.json 
{
 "currency": "g1-test",
 "endpoints": [
  "BASIC_MERKLE_API guilder-test.eu.org 80"
 ],
 "rmEndpoints": [],
 "upInterval": 3600000,
 "c": 0.0488,
 "dt": 86400,
 "dtReeval": 631152,
 "ud0": 1000,
 "stepMax": 5,
 "sigPeriod": 86400,
 "sigValidity": 12623040,
 "msValidity": 6311520,
 "sigQty": 5,
 "xpercent": 0.8,
 "percentRot": 0.67,
 "powDelay": "1200",
 "avgGenTime": 150,
 "dtDiffEval": 12,
 "medianTimeBlocks": 24,
 "httplogs": false,
 "udid2": false,
 "timeout": 3000,
 "isolate": false,
 "forksize": 100,
 "switchOnHeadAdvance": 3,
 "sync": {},
 "port": 10901,
 "msPeriod": 1051920,
 "loglevel": "info",
 "cpu": 0.6,
 "ipv4": "192.168.178.30",
 "remotehost": "guilder-test.eu.org",
 "remoteport": "80",
 "upnp": false,
 "dos": {
  "whitelist": [
   "127.0.0.1"
  ],
  "maxcount": 50,
  "burst": 20,
  "limit": 40,
  "maxexpiry": 10,
  "checkinterval": 1,
  "trustProxy": true,
  "includeUserAgent": true,
  "errormessage": "Error",
  "testmode": false,
  "silent": false,
  "silentStart": false,
  "responseStatus": 429
 },
 "sigStock": 100,
 "sigWindow": 1051920,
 "idtyWindow": 1051920,
 "msWindow": 1051920,
 "rootoffset": 0,
 "remoteipv6": "2001:983:8610:1:2239:6fcb:6144:21d2",
 "ipv6": "2001:983:8610:1:2239:6fcb:6144:21d2",
 "remoteipv4": "None",
 "udTime0": 1496527200,
 "udReevalTime0": 1496570400

Can you unset remoteipv6 ?

1 Like

Yes, and it shows what’s happening.
I should have mentioned this, but I thought I really killed it.

Dunter keeps restarting itself.

folatt@Gildurklaus:~/.config/duniter/duniter_default $ duniter direct_webstart
2018-01-25T17:47:21+00:00 - debug: Plugging file system...
2018-01-25T17:47:21+00:00 - debug: Loading conf...
2018-01-25T17:47:21+00:00 - debug: Configuration saved.
2018-01-25T17:47:21+00:00 - debug: Opening SQLite database "/home/folatt/.config/duniter/duniter_default/duniter.db"...
2018-01-25T17:47:21+00:00 - debug: Upgrade database...
2018-01-25T17:47:21+00:00 - info: Block resolution: 0 potential blocks after current#121847...
2018-01-25T17:47:21+00:00 - info: Web administration accessible at following address: http://localhost:9220
2018-01-25T17:47:21+00:00 - info: Crawling the network...
2018-01-25T17:47:22+00:00 - info: Pulling blocks from the network...
2018-01-25T17:47:22+00:00 - info: Duniter server listening on http://192.168.178.30:10901
2018-01-25T17:47:22+00:00 - error:  Error: listen EADDRINUSE ::1:9220
    at Object.exports._errnoException (util.js:1020:11)
    at exports._exceptionWithHostPort (util.js:1043:20)
    at Server._listen2 (net.js:1258:14)
    at listen (net.js:1294:10)
    at net.js:1404:9
    at GetAddrInfoReqWrap.asyncCallback [as callback] (dns.js:62:16)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:81:10)
folatt@Gildurklaus:~/.config/duniter/duniter_default $ ps -ef | grep duniter
root     18153     1  0 17:22 ?        00:00:09 duniter_default                                                                               
folatt   19847 18302  0 17:47 ?        00:00:00 /bin/bash /usr/bin/duniter webstart
folatt   19849 19847 99 17:47 ?        00:00:01 /opt/duniter//node/bin/node /opt/duniter//bin/duniter webstart
folatt   19856 18324  0 17:47 pts/0    00:00:00 grep --color=auto duniter
folatt@Gildurklaus:~/.config/duniter/duniter_default $ systemctl --user status duniter
â—Ź duniter.service - Duniter node
   Loaded: loaded (/usr/lib/systemd/user/duniter.service; enabled)
   Active: activating (start) since Thu 2018-01-25 17:48:12 UTC; 6s ago
  Control: 19875 (duniter)
   CGroup: /user.slice/user-9514.slice/user@9514.service/duniter.service
           ├─19875 /bin/bash /usr/bin/duniter webstart
           └─19877 /opt/duniter//node/bin/node /opt/duniter//bin/duniter webstart
folatt@Gildurklaus:~/.config/duniter/duniter_default $ systemctl --user status duniter
â—Ź duniter.service - Duniter node
   Loaded: loaded (/usr/lib/systemd/user/duniter.service; enabled)
   Active: activating (start) since Thu 2018-01-25 17:48:51 UTC; 1s ago
  Control: 19941 (duniter)
   CGroup: /user.slice/user-9514.slice/user@9514.service/duniter.service
           ├─19941 /bin/bash /usr/bin/duniter webstart
           └─19943 /opt/duniter//node/bin/node /opt/duniter//bin/duniter webstart
folatt@Gildurklaus:~/.config/duniter/duniter_default $ systemctl --user status duniter
â—Ź duniter.service - Duniter node
   Loaded: loaded (/usr/lib/systemd/user/duniter.service; enabled)
   Active: activating (start) since Thu 2018-01-25 17:49:07 UTC; 301ms ago
  Control: 19970 (duniter)
   CGroup: /user.slice/user-9514.slice/user@9514.service/duniter.service
           ├─19970 /bin/bash /usr/bin/duniter webstart
           └─19972 /opt/duniter//node/bin/node /opt/duniter//bin/duniter webstart
folatt@Gildurklaus:~/.config/duniter/duniter_default $ systemctl --user status duniter
â—Ź duniter.service - Duniter node
   Loaded: loaded (/usr/lib/systemd/user/duniter.service; enabled)
   Active: activating (start) since Thu 2018-01-25 17:49:14 UTC; 640ms ago
  Control: 20004 (duniter)
   CGroup: /user.slice/user-9514.slice/user@9514.service/duniter.service
           ├─20004 /bin/bash /usr/bin/duniter webstart
           └─20006 /opt/duniter//node/bin/node /opt/duniter//bin/duniter webstart

Well you are starting Duniter manually and with systemd at the same time. Obviously you should either stick to systemd, or to manual mode, but not both.

1 Like

Since I already have reserved my ipv4 for another server, so it’s set to none, this is the result:

folatt@Gildurklaus:~ $ duniter direct_webstart
2018-01-25T18:09:51+00:00 - debug: Plugging file system...
2018-01-25T18:09:52+00:00 - debug: Loading conf...
2018-01-25T18:09:52+00:00 - debug: Configuration saved.
2018-01-25T18:09:52+00:00 - debug: Opening SQLite database "/home/folatt/.config/duniter/duniter_default/duniter.db"...
2018-01-25T18:09:52+00:00 - debug: Upgrade database...
2018-01-25T18:09:52+00:00 - info: Block resolution: 0 potential blocks after current#121847...
2018-01-25T18:09:52+00:00 - info: Web administration accessible at following address: http://localhost:9220
2018-01-25T18:09:52+00:00 - info: Crawling the network...
2018-01-25T18:09:52+00:00 - info: Pulling blocks from the network...
2018-01-25T18:09:52+00:00 - info: Duniter server listening on http://192.168.178.30:10901
2018-01-25T18:09:52+00:00 - info: Crawling done.
2018-01-25T18:09:52+00:00 - warn: Local node is not a member. Waiting to be a member before computing a block.
2018-01-25T18:09:52+00:00 - info: Sibling endpoints: 0=BASIC_MERKLED_API guilder-test.eu.org None 2001:983:8610:1:2239:6fcb:6144:21d2 80
2018-01-25T18:09:52+00:00 - warn: Wrong endpoint 'BASIC_MERKLED_API guilder-test.eu.org None 2001:983:8610:1:2239:6fcb:6144:21d2 80': 'Error: Invalid URI "http:///network/peering"'
2018-01-25T18:09:52+00:00 - info: External access: 
2018-01-25T18:09:52+00:00 - debug: Generating server's peering entry based on block#121818...
2018-01-25T18:09:52+00:00 - info: ⬇ PEER AbE4R2fg
2018-01-25T18:09:52+00:00 - info: Block resolution: 0 potential blocks after current#121847...
2018-01-25T18:09:52+00:00 - info: Will pull blocks from the network in 0 min 20 sec
2018-01-25T18:09:52+00:00 - debug: --> new Peer to be sent to 1 peer(s)
2018-01-25T18:09:52+00:00 - info: POST Peer AbE4R2fg4h#121818
2018-01-25T18:09:52+00:00 - debug:  `--> to peer AbE4R2fg4h [------] (guilder-test.eu.org:80)
2018-01-25T18:09:53+00:00 - warn: Could not reach guilder-test.eu.org:80
2018-01-25T18:09:53+00:00 - info: âś” PEER AbE4R2fg
2018-01-25T18:09:53+00:00 - info: Changing conf to: {"prefix":10} on PoW cluster
2018-01-25T18:09:53+00:00 - debug: --> new Peer to be sent to 2 peer(s)
2018-01-25T18:09:53+00:00 - info: POST Peer AbE4R2fg4h#121818
2018-01-25T18:09:53+00:00 - debug:  `--> to peer M0_AbE4R2f [------] ()
2018-01-25T18:09:53+00:00 - debug:  `--> to peer M1_AbE4R2f [------] ()
2018-01-25T18:09:53+00:00 - info: Next peering signal in 5 min
2018-01-25T18:09:53+00:00 - debug: --> new Peer to be sent to 2 peer(s)
2018-01-25T18:09:53+00:00 - info: POST Peer AbE4R2fg4h#121818
2018-01-25T18:09:53+00:00 - debug:  `--> to peer M0_AbE4R2f [------] ()
2018-01-25T18:09:53+00:00 - debug:  `--> to peer M1_AbE4R2f [------] ()
2018-01-25T18:10:02+00:00 - warn: Pulling not finished after 10000 ms, continue PoW
2018-01-25T18:10:12+00:00 - info: Pulling blocks from the network...
2018-01-25T18:10:12+00:00 - info: Block resolution: 0 potential blocks after current#121847...
2018-01-25T18:10:12+00:00 - info: Will pull blocks from the network in 0 min 20 sec
2018-01-25T18:10:22+00:00 - warn: Pulling not finished after 10000 ms, continue PoW
2018-01-25T18:10:32+00:00 - info: Pulling blocks from the network...
2018-01-25T18:10:32+00:00 - info: Block resolution: 0 potential blocks after current#121847...
2018-01-25T18:10:32+00:00 - info: Will pull blocks from the network in 0 min 20 sec
2018-01-25T18:10:42+00:00 - warn: Pulling not finished after 10000 ms, continue PoW
2018-01-25T18:10:52+00:00 - info: Pulling blocks from the network...
2018-01-25T18:10:52+00:00 - info: Block resolution: 0 potential blocks after current#121847...
2018-01-25T18:10:52+00:00 - info: Will pull blocks from the network in 0 min 20 sec
^C^C
aeouaoeu2018-01-25T18:11:01+00:00 - debug: Trying to close SQLite...
2018-01-25T18:11:01+00:00 - info: Database closed.

or this:

folatt@Gildurklaus:~/.config/duniter/duniter_default $ duniter direct_webstart
2018-01-25T18:16:49+00:00 - debug: Plugging file system...
2018-01-25T18:16:49+00:00 - debug: Loading conf...
2018-01-25T18:16:49+00:00 - debug: Configuration saved.
2018-01-25T18:16:49+00:00 - debug: Opening SQLite database "/home/folatt/.config/duniter/duniter_default/duniter.db"...
2018-01-25T18:16:49+00:00 - debug: Upgrade database...
2018-01-25T18:16:49+00:00 - info: Block resolution: 0 potential blocks after current#121847...
2018-01-25T18:16:49+00:00 - info: Web administration accessible at following address: http://localhost:9220
2018-01-25T18:16:49+00:00 - info: Crawling the network...
2018-01-25T18:16:49+00:00 - info: Pulling blocks from the network...
2018-01-25T18:16:49+00:00 - info: Duniter server listening on http://192.168.178.30:10901
2018-01-25T18:16:49+00:00 - error: Error on WS Server
2018-01-25T18:16:49+00:00 - error:  Error: getaddrinfo ENOTFOUND None
    at errnoException (dns.js:28:10)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:76:26)
2018-01-25T18:16:49+00:00 - error:  Error: getaddrinfo ENOTFOUND None
    at errnoException (dns.js:28:10)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:76:26)

I don’t understand. What do you mean by “reserve” an IP ? Why do you write “None” ? You should just put nothing between quotes, or even remove remoteIpv4 or remoteIpv6 from the conf file.

For example here is my config, on yunohost :

{
 "currency": "g1",
 "endpoints": [
  "BMAS g1.duniter.inso.ovh 443"
 ],
 "rmEndpoints": [],
 "upInterval": 3600000,
 "c": 0.0488,
 "dt": 86400,
 "dtReeval": 15778800,
 "ud0": 1000,
 "stepMax": 5,
 "sigPeriod": 432000,
 "sigValidity": 63115200,
 "msValidity": 31557600,
 "sigQty": 5,
 "xpercent": 0.8,
 "percentRot": 0.67,
 "powDelay": 0,
 "avgGenTime": 300,
 "dtDiffEval": 12,
 "medianTimeBlocks": 24,
 "httplogs": false,
 "udid2": false,
 "timeout": 3000,
 "isolate": false,
 "forksize": 100,
 "switchOnHeadAdvance": 3,
 "sync": {},
 "port": 10900,
 "cpu": 0.1,
 "ipv4": "127.0.0.1",
 "remotehost": "g1.duniter.inso.ovh",
 "remoteport": "80",
 "upnp": true,
 "dos": {
  "whitelist": [
   "127.0.0.1"
  ],
  "maxcount": 80,
  "burst": 20,
  "limit": 40,
  "maxexpiry": 10,
  "checkinterval": 1,
  "trustProxy": true,
  "includeUserAgent": true,
  "errormessage": "Error",
  "testmode": false,
  "silent": false,
  "silentStart": true,
  "responseStatus": 429
 },
 "sigStock": 100,
 "sigWindow": 5259600,
 "idtyWindow": 5259600,
 "msWindow": 5259600,
 "rootoffset": 0,
 "udTime0": 1488970800,
 "udReevalTime0": 1490094000,
 "loglevel": "info",
 "msPeriod": 5259600,
 "prefix": 1,
 "nobma": false,
 "bmaWithCrawler": false,
 "ws2p": {
  "uuid": "e7177319",
  "privateAccess": true,
  "publicAccess": false,
  "preferedOnly": false,
  "privilegedOnly": false,
  "upnp": false,
  "maxPrivate": 25,
  "maxPublic": 10,
  "remotepath": ""
 },
 "proxiesConf": {
  "reachingClearEp": "clear",
  "forceTor": false
 },
 "duniter-currency-monit": {},
 "nbCores": 2
}
1 Like

The other server has port 80 and 443 port forwarded to my ipv4 address. Website.

I thought I had to. Thanks for the advice. Finally, I’m in!

2 Likes

Finally ! I’m glad you finally successed :slight_smile: I hope it will be easier for you from now on and that you understand better what you have to do for your currency :slight_smile: