Hi, I have had this issue before, reset my gateway and started from scratch and am getting a similar error. Have gotten a bit further this time though.
I have my gateway on a RPi 4 connected by ethernet and wifi. I primarily access it through my domain name. This evening, I noticed that my automations were not running. I could not access my gateway through the domain or the local IP addresses. I rebooted by Pi and it still would not work.
My Pi is seen on my network though by my router. I was able to SSH into it from my PC. I checked the running processes and only got:
So it looked like Gateway was not running? So i navigated to ~/mozilla-iot/gateway and ran run-app.sh. After a bunch of printout, I got the following error:
Opening database: /home/pi/.mozilla-iot/config/db.sqlite3
2020-01-16 17:09:19.257 INFO : Opening database: /home/pi/.mozilla-iot/log/logs.sqlite3
2020-01-16 17:09:19.942 INFO : DNS config is: gateway
2020-01-16 17:09:19.944 INFO : Service Discovery: changing profile - local domain is now: gateway
2020-01-16 17:09:21.622 INFO : Service Discovery: state changed to: true
2020-01-16 17:09:21.839 ERROR : Error: listen EADDRINUSE :::4443
at Server.setupListenHandle [as _listen2] (net.js:1360:14)
at listenInCluster (net.js:1401:12)
at Server.listen (net.js:1485:7)
at promises.push.Promise (/home/pi/mozilla-iot/gateway/build/webpack:/src/app.js:133:1)
at new Promise ()
at startHttpsGateway (/home/pi/mozilla-iot/gateway/build/webpack:/src/app.js:132:1)
at serverStartup.promise.TunnelService.userSkipped.then (/home/pi/mozilla-iot/gateway/build/webpack:/src/app.js:381:1)
at
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! webthings-gateway@0.10.0 run-only: node build/gateway.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the webthings-gateway@0.10.0 run-only script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/pi/.npm/_logs/2020-01-16T22_09_21_875Z-debug.log
No idea if run-app.sh is even how I would try and manually start the gateway. I never have had to before, it has always just worked.
Any help would be greatly appreciated. Really don’t want to start over from scratch again as I have MUUCCCCHHHH more automations and devices now.
So I did a little more digging, found the system process for the gateway and stopped it and then restarted it and then looked at the log. Seemed to be ok, and then I saw these errors:
Jan 16 16:56:28 gateway run-app.sh[625]: Opening database: /home/pi/.mozilla-iot/config/db.sqlite3
Jan 16 16:56:31 gateway run-app.sh[625]: 2020-01-16 16:56:31.154 INFO : Opening database: /home/pi/.mozilla-iot/log/lo
Jan 16 16:56:31 gateway sudo[845]: pi : TTY=unknown ; PWD=/home/pi/mozilla-iot/gateway ; USER=root ; COMMAND=/bin/
Jan 16 16:56:31 gateway sudo[845]: pam_unix(sudo:session): session opened for user root by (uid=0)
Jan 16 16:56:32 gateway sudo[845]: pam_unix(sudo:session): session closed for user root
Jan 16 16:56:32 gateway run-app.sh[625]: 2020-01-16 16:56:32.070 INFO : DNS config is: gateway
Jan 16 16:56:32 gateway run-app.sh[625]: 2020-01-16 16:56:32.072 INFO : Service Discovery: changing profile - local do
Jan 16 16:56:32 gateway sudo[856]: pi : TTY=unknown ; PWD=/home/pi/mozilla-iot/gateway ; USER=root ; COMMAND=/bin/
Jan 16 16:56:32 gateway sudo[856]: pam_unix(sudo:session): session opened for user root by (uid=0)
Jan 16 16:56:32 gateway sudo[856]: pam_unix(sudo:session): session closed for user root
Jan 16 16:56:32 gateway sudo[865]: pi : TTY=unknown ; PWD=/home/pi/mozilla-iot/gateway ; USER=root ; COMMAND=/bin/
Jan 16 16:56:32 gateway sudo[865]: pam_unix(sudo:session): session opened for user root by (uid=0)
Jan 16 16:56:33 gateway sudo[865]: pam_unix(sudo:session): session closed for user root
And everything afterwards is an error saying that it failed to get rules.
Those rule and property errors are expected on startup. I’d suggest connecting your RPi via Wi-Fi OR ethernet, not both. That may be the cause of your connectivity issues.