commonshost / dohnut

🍩 DNS to DNS-over-HTTPS (DoH) proxy server
https://help.commons.host/dohnut/
85 stars 6 forks source link

dohnut.service: Main process exited, code=exited, status=1/FAILURE #25

Open realknotworking opened 3 years ago

realknotworking commented 3 years ago

Hi. Trying to get this working on a Rasperry Pi 3 B+ running the latest Raspian OS. Followed the instructions for setting up Dohnut with systemd (https://help.commons.host/dohnut/systemd/), systemctl status dohnut.socket shows the socket is active, systemctl status dohnut.service shows the status as "activating" (rather than active):

$ systemctl status dohnut.service
● dohnut.service - Dohnut DNS over HTTPS proxy
   Loaded: loaded (/etc/systemd/system/dohnut.service; static; vendor preset: enabled)
   Active: activating (start) since Wed 2021-02-03 11:35:25 EST; 1s ago
 Main PID: 23024 (node)
    Tasks: 7 (limit: 2063)
   CGroup: /system.slice/dohnut.service
           └─23024 npm

Test dig fails with:

$ dig @127.0.0.1 -p 53000 example.com

; <<>> DiG 9.11.5-P4-5.1+deb10u2-Raspbian <<>> @127.0.0.1 -p 53000 example.com
; (1 server found)
;; global options: +cmd
;; connection timed out; no servers could be reached

Error log:

Feb 03 09:42:05 raspberrypi systemd[1]: Starting Dohnut DNS over HTTPS proxy...
Feb 03 09:42:08 raspberrypi dohnut[30609]: Trace: Error: Cannot collect fds meant for pid 30609 in pid 30621
Feb 03 09:42:08 raspberrypi dohnut[30609]:     at Object.module.exports.collect (/home/dohnut/n/lib/node_modules/dohnut/node_modules/socket-activation/src/systemd.js:32:11)
Feb 03 09:42:08 raspberrypi dohnut[30609]:     at parseOptions (/home/dohnut/n/lib/node_modules/dohnut/source/cli.js:78:43)
Feb 03 09:42:08 raspberrypi dohnut[30609]:     at main (/home/dohnut/n/lib/node_modules/dohnut/source/cli.js:213:25)
Feb 03 09:42:08 raspberrypi dohnut[30609]:     at Object.<anonymous> (/home/dohnut/n/lib/node_modules/dohnut/source/cli.js:251:1)
Feb 03 09:42:08 raspberrypi dohnut[30609]:     at Module._compile (node:internal/modules/cjs/loader:1108:14)
Feb 03 09:42:08 raspberrypi dohnut[30609]:     at Object.Module._extensions..js (node:internal/modules/cjs/loader:1137:10)
Feb 03 09:42:08 raspberrypi dohnut[30609]:     at Module.load (node:internal/modules/cjs/loader:973:32)
Feb 03 09:42:08 raspberrypi dohnut[30609]:     at Function.Module._load (node:internal/modules/cjs/loader:813:14)
Feb 03 09:42:08 raspberrypi dohnut[30609]:     at Module.require (node:internal/modules/cjs/loader:997:19)
Feb 03 09:42:08 raspberrypi dohnut[30609]:     at require (node:internal/modules/cjs/helpers:92:18)
Feb 03 09:42:08 raspberrypi dohnut[30609]:     at /home/dohnut/n/lib/node_modules/dohnut/source/cli.js:254:13
Feb 03 09:42:08 raspberrypi dohnut[30609]: npm ERR! code 1
Feb 03 09:42:08 raspberrypi dohnut[30609]: npm ERR! path /home/dohnut
Feb 03 09:42:08 raspberrypi dohnut[30609]: npm ERR! command failed
Feb 03 09:42:08 raspberrypi dohnut[30609]: npm ERR! command sh -c dohnut "--config" "/etc/dohnut/options.json"
Feb 03 09:42:08 raspberrypi dohnut[30609]: npm ERR! A complete log of this run can be found in:
Feb 03 09:42:08 raspberrypi dohnut[30609]: npm ERR!     /home/dohnut/.npm/_logs/2021-02-03T14_42_08_246Z-debug.log
Feb 03 09:42:08 raspberrypi systemd[1]: dohnut.service: Main process exited, code=exited, status=1/FAILURE
Feb 03 09:42:08 raspberrypi systemd[1]: dohnut.service: Failed with result 'exit-code'.

Any ideas what the problem might be?

qoelet commented 3 years ago

I wonder if the file descriptor being collected here is meant for the parent; the socket activation library is complaining that the pid provided by systemd is a mismatch with the current process's pid. cc @sebdeckers

realknotworking commented 3 years ago

Thank you qoelet for the quick reply. I still have it installed, I'd be happy to tweak the code on my Pi to see if we can get it running.

qoelet commented 3 years ago

@realknotworking could you share what's in /etc/dohnut/options.json?

realknotworking commented 3 years ago

This is what it installed

{
  "doh": ["commonshost"],
  "bootstrap": ["1.1.1.1", "8.8.8.8", "9.9.9.9"],
  "countermeasures": ["spoof-queries", "spoof-useragent"],
  "datagram-protocol": "udp4"
}
qoelet commented 3 years ago

@realknotworking thanks. I managed to get my hands on an old RPi 3, let me see if I can reproduce the issue over the weekend.

realknotworking commented 3 years ago

Okay, thanks for staying after it.