ryansch / docker-unifi-rpi

Unifi Controller for Raspberry Pi 3+ and x86
https://hub.docker.com/r/ryansch/unifi-rpi/
347 stars 42 forks source link

Port 8080 not available (RPI 4B) #81

Closed doremifajb closed 8 months ago

doremifajb commented 3 years ago

Hello ! I have installed ryansch/unifi-rpi:6.0.45 on docker on my Raspi 4B in mid July, and it's been working great (except for a few minor issues like Rpi falling a sleep, but I found a way around) till today: I restarted the Raspi (shouldn't have done that, it wasn't necessary), and suddenly unifi doesn't work anymore. On network.unifi.ui.com it says "offline", I can't open the web UI at all, either using the IP address on my laptop, or localhost:8443 on Raspi. On the log it says Port 8080 not available.

I studied an old posting: https://github.com/ryansch/docker-unifi-rpi/issues/66

and followed through with re-installation, and no success;; Now, what @DiMilan got with port 8080 was domoticz , I ran the same command and got LISTEN 1635/java for the same of line. I tried to kill it. In the end, I got this: root@raspi-unifi:~# lsof -i:8080 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME java 17048 unifi 152u IPv6 272452 0t0 TCP *:http-alt (LISTEN)

so it seems to be used by unifi, but on the unifi log it still says "Port 8080 not available". I don't know what to do now... could you please help ?

DiMilan commented 3 years ago

Have you tried removing the containers and rebuilding the whole thing? https://github.com/ryansch/docker-unifi-rpi/issues/66#issuecomment-685087473

doremifajb commented 3 years ago

Thank you for your reply ! Do you mean, not only

You should be just fine with that setup. All of your data is sitting in docker volumes. Try docker-compose rm -sf unifi; docker-compose up -d

but really to get rid of everything I installed on docker and rebuild ? If nothing else works, I would do it, but my last backup is 8/5, since then I set up a new AP, I am afraid that if I reinstall Unifi Controller from scratch and put the backup file from 8/5, I would have to readopt it, the users have to enter the password again, and they are going to complain (because they can't do it on their own, I have to go and help them), so I am hoping that there might be a way around it....

But I don't understand why it happened in the first place. I built a power button (taken out of a windows 98 PC on the way to bulk waste center) using this guide: https://howchoo.com/g/mwnlytk3zmm/how-to-add-a-power-button-to-your-raspberry-pi but I used it for the first time after installing Unifi Controller. Then this happened. ( I was usually turning raspi off via ssh) Is there any known issue with this way of turning RasPi off ?

DiMilan commented 3 years ago

no, I meant:

docker-compose rm -sf unifi; docker-compose up -d

As @ryansch said the configuration is stored in local volumes and will still be there after reinstall.

What console output you get if you try to kill the PID on port 8080?

have you also tried:

kill -9 PID

doremifajb commented 3 years ago

OK, then I did try it yesterday. Now I also tried tokill PID on port 8080. But then another one starts right away.

Now I tried your kill -9 PID , I think it did the job !!! Thank you !!! But actually I'm not sure if it was really the trick, because I was trying to unstall and install again, with different options (like -v)

First I could access to Unifi controller using local address, but cloud didn't work. Then as I tried to open again, this time it did open ! But strangely, it seems to have forgotten my config from the last week.... so I had to reconfigure the new AP. But the config from about two weeks ago was already there, I didn't upload the back up. Mysterious !

Now I looked at the log again, it says something like this many times:

:345 sendto() failed with error: 101 on STUN id: 21; fd: 254 [fde4:e3d5:8959:0:ef9b:75c4:fe8a:355a]:35395 -> [::ffff:18.156.18.151]:30222 (eth0) DTLS id: 0 () (PEER) :585 STUN id: 21; fd: 254 [fde4:e3d5:8959:0:ef9b:75c4:fe8a:355a]:35395 -> [::ffff:18.156.18.151]:30222 (eth0) DTLS id: 0 () (PEER) failed to send messages over interface eth0 ([fde4:e3d5:8959:0:ef9b:75c4:fe8a:355a]) :1023 Permanent error code on channel bind request: 400 - Empty port number in channel bind request

It seems that something still not quite right. But I have no idea what this is saying....

doremifajb commented 3 years ago

p.s. assuming that kill -9 PID really was the cure, does that mean that if it happens again, I don't have to reinstall the controller, just do kill -9 PID and that should be all ?

ryansch commented 3 years ago

@doremifajb That would be my expectation.

doremifajb commented 3 years ago

Thank you very much to both of you ! That's easy enough, even if it might happen every once in a while, it's not too bad.