unifi-utilities / unifios-utilities

A collection of enhancements for UnifiOS based devices
GNU General Public License v3.0
3.9k stars 419 forks source link

Some Problems with Homebridge #93

Open lorenzocanalelc opened 3 years ago

lorenzocanalelc commented 3 years ago

Describe the bug First of all in order to make the container work you need to have the CNI plugin already installed, this is not mentioned in the Requirements so maybe it should be added. Second I'm not quite sure if my configuration is right (I'm not using a separate vlan, I have setted up the home bridge in the br0 bridge), but every time I change some configuration in the controller (E.g. setting a static ip to a device) I'm not able anymore to access homebridge, and I need to stop and start again the container, I can't figure why this happens

UDM Information

rkydd commented 3 years ago

Excellent set of utilities - thank you boostchicken.

I have successfully installed pihole and homebridge using the instructions here. I am also seeing the same issue as lorenzocanalelc. If I make any settings changes in the controller, then I lose access to homebridge. Pihole continues just fine. I am running a UDM Pro, latest firmware. My UDM is connected using 10Gbe only.

I have pasted the syslog from the time homebridge connection is lost which seems to indicate a kernel fault which I am guessing is a symptom/cause, but I haven't been able to diagnose why....

<14>1 2021-01-14T09:10:38+00:00 30c04bee8c30,udm-1.8.5.2964 mcad - - - mcad: mcad[2478]: ace_reporter.reporter_handle_response(): cfgversion: 110e72bf0d4d2a93 -> b1db05fbca3e1a10 <14>1 2021-01-14T09:10:38+00:00 30c04bee8c30,udm-1.8.5.2964 mcad - - - mcad: mcad[2478]: ace_reporter.reporter_save_config(): Saving stun_url as stun://localhost/ <14>1 2021-01-14T09:10:38+00:00 30c04bee8c30,udm-1.8.5.2964 mcad - - - mcad: mcad[2478]: ace_reporter.reporter_save_config(): Saving mgmt_url as https://localhost:8443/manage/site/default <14>1 2021-01-14T09:10:38+00:00 30c04bee8c30,udm-1.8.5.2964 mcad - - - mcad: mcad[2478]: ace_reporter.reporter_handle_response(): [setparam] applying new system.cfg <13>1 2021-01-14T09:10:38+00:00 30c04bee8c30,udm-1.8.5.2964 syswrapper - - - syswrapper: [apply-config] using fast apply <14>1 2021-01-14T09:10:39+00:00 30c04bee8c30,udm-1.8.5.2964 ubios-udapi-server - - - ubios-udapi-server: ubios-udapi-server: vvv Apply new configuration <14>1 2021-01-14T09:10:39+00:00 30c04bee8c30,udm-1.8.5.2964 ubios-udapi-server - - - ubios-udapi-server: ubios-udapi-server: * [interfaces]: configuring <14>1 2021-01-14T09:10:39+00:00 30c04bee8c30,udm-1.8.5.2964 kernel - - - kernel: [86677.383938] br5: port 3(vethccbb8544) entered disabled state <14>1 2021-01-14T09:10:39+00:00 30c04bee8c30,udm-1.8.5.2964 ubios-udapi-server - - - ubios-udapi-server: ubios-udapi-server: * [firewall/sets]: configuring <14>1 2021-01-14T09:10:39+00:00 30c04bee8c30,udm-1.8.5.2964 ubios-udapi-server - - - ubios-udapi-server: ubios-udapi-server: * [firewall/nat]: configuring <14>1 2021-01-14T09:10:40+00:00 30c04bee8c30,udm-1.8.5.2964 ubios-udapi-server - - - ubios-udapi-server: ubios-udapi-server: * [firewall/filter]: configuring <14>1 2021-01-14T09:10:40+00:00 30c04bee8c30,udm-1.8.5.2964 ubios-udapi-server - - - ubios-udapi-server: ubios-udapi-server: * [firewall/mangle]: disabling <14>1 2021-01-14T09:10:40+00:00 30c04bee8c30,udm-1.8.5.2964 ubios-udapi-server - - - ubios-udapi-server: ubios-udapi-server: * [qos/ip]: disabling <14>1 2021-01-14T09:10:40+00:00 30c04bee8c30,udm-1.8.5.2964 ubios-udapi-server - - - ubios-udapi-server: ubios-udapi-server: * [system]: configuring <14>1 2021-01-14T09:10:40+00:00 30c04bee8c30,udm-1.8.5.2964 ubios-udapi-server - - - ubios-udapi-server: ubios-udapi-server: *[services/radius-profiles]: configuring <14>1 2021-01-14T09:10:40+00:00 30c04bee8c30,udm-1.8.5.2964 ubios-udapi-server - - - ubios-udapi-server: ubios-udapi-server: * [services]: configuring <14>1 2021-01-14T09:10:40+00:00 30c04bee8c30,udm-1.8.5.2964 ubios-udapi-server - - - ubios-udapi-server: ubios-udapi-server: Keep service bleHTTPTransport <14>1 2021-01-14T09:10:40+00:00 30c04bee8c30,udm-1.8.5.2964 ubios-udapi-server - - - ubios-udapi-server: ubios-udapi-server: Keep service ddns <14>1 2021-01-14T09:10:40+00:00 30c04bee8c30,udm-1.8.5.2964 ubios-udapi-server - - - ubios-udapi-server: ubios-udapi-server: Keep service dhcpServers-net_LAN_br0_192-168-1-0-24 <14>1 2021-01-14T09:10:40+00:00 30c04bee8c30,udm-1.8.5.2964 ubios-udapi-server - - - ubios-udapi-server: ubios-udapi-server: Keep service discoveryResponder <14>1 2021-01-14T09:10:40+00:00 30c04bee8c30,udm-1.8.5.2964 ubios-udapi-server - - - ubios-udapi-server: ubios-udapi-server: Keep service dnsForwarder <14>1 2021-01-14T09:10:40+00:00 30c04bee8c30,udm-1.8.5.2964 ubios-udapi-server - - - ubios-udapi-server: ubios-udapi-server: Keep service dpi <14>1 2021-01-14T09:10:40+00:00 30c04bee8c30,udm-1.8.5.2964 ubios-udapi-server - - - ubios-udapi-server: ubios-udapi-server: Keep service geoipFiltering <14>1 2021-01-14T09:10:40+00:00 30c04bee8c30,udm-1.8.5.2964 ubios-udapi-server - - - ubios-udapi-server: ubios-udapi-server: Keep service idsIps <14>1 2021-01-14T09:10:40+00:00 30c04bee8c30,udm-1.8.5.2964 ubios-udapi-server - - - ubios-udapi-server: ubios-udapi-server: Keep service l2tpServer <14>1 2021-01-14T09:10:40+00:00 30c04bee8c30,udm-1.8.5.2964 ubios-udapi-server - - - ubios-udapi-server: ubios-udapi-server: Keep service mdns <14>1 2021-01-14T09:10:40+00:00 30c04bee8c30,udm-1.8.5.2964 ubios-udapi-server - - - ubios-udapi-server: ubios-udapi-server: Keep service ntpClient <14>1 2021-01-14T09:10:40+00:00 30c04bee8c30,udm-1.8.5.2964 ubios-udapi-server - - - ubios-udapi-server: ubios-udapi-server: Keep service radiusServer <14>1 2021-01-14T09:10:40+00:00 30c04bee8c30,udm-1.8.5.2964 ubios-udapi-server - - - ubios-udapi-server: ubios-udapi-server: Keep service suspend <14>1 2021-01-14T09:10:40+00:00 30c04bee8c30,udm-1.8.5.2964 ubios-udapi-server - - - ubios-udapi-server: ubios-udapi-server: Keep service systemLog <14>1 2021-01-14T09:10:40+00:00 30c04bee8c30,udm-1.8.5.2964 ubios-udapi-server - - - ubios-udapi-server: ubios-udapi-server: Keep service upnp <14>1 2021-01-14T09:10:40+00:00 30c04bee8c30,udm-1.8.5.2964 ubios-udapi-server - - - ubios-udapi-server: ubios-udapi-server: Keep service utm <14>1 2021-01-14T09:10:40+00:00 30c04bee8c30,udm-1.8.5.2964 ubios-udapi-server - - - ubios-udapi-server: ubios-udapi-server: Keep service wanFailover <14>1 2021-01-14T09:10:40+00:00 30c04bee8c30,udm-1.8.5.2964 ubios-udapi-server - - - ubios-udapi-server: ubios-udapi-server: * [vlans]: disabling <14>1 2021-01-14T09:10:40+00:00 30c04bee8c30,udm-1.8.5.2964 ubios-udapi-server - - - ubios-udapi-server: ubios-udapi-server: * [vpn/openvpn/peers]: disabling <14>1 2021-01-14T09:10:40+00:00 30c04bee8c30,udm-1.8.5.2964 ubios-udapi-server - - - ubios-udapi-server: ubios-udapi-server: *[vpn/ipsec/site-to-site]: disabling <86>1 2021-01-14T09:10:40+00:00 30c04bee8c30,udm-1.8.5.2964 ipsec_starter 15978 - - ipsec_starter[15978]: config OK <30>1 2021-01-14T09:10:40+00:00 30c04bee8c30,udm-1.8.5.2964 charon - - - charon: 00[DMN] signal of type SIGINT received. Shutting down <14>1 2021-01-14T09:10:40+00:00 30c04bee8c30,udm-1.8.5.2964 ubios-udapi-server - - - ubios-udapi-server: ubios-udapi-server: ^^^ Apply new configuration done <86>1 2021-01-14T09:10:40+00:00 30c04bee8c30,udm-1.8.5.2964 ipsec_starter 10729 - - ipsec_starter[10729]: charon stopped after 200 ms <86>1 2021-01-14T09:10:40+00:00 30c04bee8c30,udm-1.8.5.2964 ipsec_starter 10729 - - ipsec_starter[10729]: ipsec starter stopped <14>1 2021-01-14T09:10:40+00:00 30c04bee8c30,udm-1.8.5.2964 ubios-udapi-server - - - ubios-udapi-server: ubios-udapi-server: Got exit event for process ipsec <86>1 2021-01-14T09:10:40+00:00 30c04bee8c30,udm-1.8.5.2964 ipsec_starter 15994 - - ipsec_starter[15994]: Starting strongSwan 5.7.1 IPsec [starter]... <30>1 2021-01-14T09:10:40+00:00 30c04bee8c30,udm-1.8.5.2964 charon - - - charon: 00[DMN] Starting IKE charon daemon (strongSwan 5.7.1, Linux 4.1.37-v1.8.5.2964-30c04be, aarch64) <30>1 2021-01-14T09:10:40+00:00 30c04bee8c30,udm-1.8.5.2964 charon - - - charon: 00[LIB] loaded plugins: charon pkcs11 aes des rc2 sha2 sha1 md5 mgf1 random nonce x509 revocation constraints pubkey pkcs1 pkcs7 pkcs8 pkcs12 pgp dnskey sshkey pem fips-prf gmp curve25519 xcbc cmac hmac attr kernel-netlink resolve socket-default stroke vici updown xauth-generic led counters <30>1 2021-01-14T09:10:40+00:00 30c04bee8c30,udm-1.8.5.2964 charon - - - charon: 00[JOB] spawning 16 worker threads <86>1 2021-01-14T09:10:40+00:00 30c04bee8c30,udm-1.8.5.2964 ipsec_starter 15994 - - ipsec_starter[15994]: charon (16010) started after 20 ms <14>1 2021-01-14T09:11:35+00:00 30c04bee8c30,udm-1.8.5.2964 linkcheck - - - linkcheck: linkcheck[2476]: linkcheck.launch_speedtest(): launching speedtest <14>1 2021-01-14T09:11:35+00:00 30c04bee8c30,udm-1.8.5.2964 linkcheck - - - linkcheck: linkcheck[2476]: linkcheck.run_speedtest(): using default source_interface for speedtest <14>1 2021-01-14T09:11:53+00:00 30c04bee8c30,udm-1.8.5.2964 kernel - - - kernel: [86750.508328] br0: port 2(eth10) entered forwarding state <14>1 2021-01-14T09:11:53+00:00 30c04bee8c30,udm-1.8.5.2964 kernel - - - kernel: [86750.508421] br5: port 1(eth10.5) entered forwarding state <11>1 2021-01-14T09:11:54+00:00 30c04bee8c30,udm-1.8.5.2964 linkcheck - - - linkcheck: linkcheck[2476]: https.curl_thread(): cURL request failed with error: 56 <11>1 2021-01-14T09:11:54+00:00 30c04bee8c30,udm-1.8.5.2964 linkcheck - - - linkcheck: linkcheck[2476]: https.curl_thread(): cURL request failed with error: 56 <11>1 2021-01-14T09:11:54+00:00 30c04bee8c30,udm-1.8.5.2964 linkcheck - - - linkcheck: linkcheck[2476]: https.curl_thread(): cURL request failed with error: 56 <11>1 2021-01-14T09:12:01+00:00 30c04bee8c30,udm-1.8.5.2964 linkcheck - - - linkcheck: linkcheck[2476]: speedtest._get_report_type(): speedtest failed <14>1 2021-01-14T09:12:01+00:00 30c04bee8c30,udm-1.8.5.2964 linkcheck - - - linkcheck: linkcheck[2476]: linkcheck.run_speedtest(): Completed: Downlink 83.996 Mbps, Uplink 0.000 Mbps <14>1 2021-01-14T09:12:08+00:00 30c04bee8c30,udm-1.8.5.2964 kernel - - - kernel: [86765.528241] br0: port 2(eth10) entered forwarding state <14>1 2021-01-14T09:12:25+00:00 30c04bee8c30,udm-1.8.5.2964 kernel - - - kernel: [86782.818819] node[25072]: syscall 283 <12>1 2021-01-14T09:12:25+00:00 30c04bee8c30,udm-1.8.5.2964 kernel - - - kernel: [86782.818826] Code: d2802368 d2800200 d2800001 d4000001 (d65f03c0) <12>1 2021-01-14T09:12:25+00:00 30c04bee8c30,udm-1.8.5.2964 kernel - - - kernel: [86782.818832] CPU: 0 PID: 25072 Comm: node Tainted: P O 4.1.37-v1.8.5.2964-30c04be #1 <12>1 2021-01-14T09:12:25+00:00 30c04bee8c30,udm-1.8.5.2964 kernel - - - kernel: [86782.818835] Hardware name: Annapurna Labs Alpine V2 UBNT (DT) <12>1 2021-01-14T09:12:25+00:00 30c04bee8c30,udm-1.8.5.2964 kernel - - - kernel: [86782.818839] task: ffffffc0b6071580 ti: ffffffc0a4fe4000 task.ti: ffffffc0a4fe4000 <12>1 2021-01-14T09:12:25+00:00 30c04bee8c30,udm-1.8.5.2964 kernel - - - kernel: [86782.818853] LR is at 0x7fafebeb58 <12>1 2021-01-14T09:12:25+00:00 30c04bee8c30,udm-1.8.5.2964 kernel - - - kernel: [86782.818856] pc : [<0000007fafe88764>] lr : [<0000007fafebeb58>] pstate: 80000000 <12>1 2021-01-14T09:12:25+00:00 30c04bee8c30,udm-1.8.5.2964 kernel - - - kernel: [86782.818859] sp : 0000007feae93fc0 <12>1 2021-01-14T09:12:25+00:00 30c04bee8c30,udm-1.8.5.2964 kernel - - - kernel: [86782.818862] x29: 0000007feae93fc0 x28: 000000558e812b18 <12>1 2021-01-14T09:12:25+00:00 30c04bee8c30,udm-1.8.5.2964 kernel - - - kernel: [86782.818870] x25: 000000558e812bc0 x24: 0000007feae94150 <12>1 2021-01-14T09:12:25+00:00 30c04bee8c30,udm-1.8.5.2964 kernel - - - kernel: [86782.818878] x21: 0000000000800000 x20: 0000007feae94150 <12>1 2021-01-14T09:12:25+00:00 30c04bee8c30,udm-1.8.5.2964 kernel - - - kernel: [86782.818886] x17: 0000007fafebeaa0 x16: 000000558e7a3768 <12>1 2021-01-14T09:12:25+00:00 30c04bee8c30,udm-1.8.5.2964 kernel - - - kernel: [86782.818890] x15: 0000000000000000 x14: 0000000000000000 <12>1 2021-01-14T09:12:25+00:00 30c04bee8c30,udm-1.8.5.2964 kernel - - - kernel: [86782.818893] x13: 0000000000000000 x12: 0008000000000000 <12>1 2021-01-14T09:12:25+00:00 30c04bee8c30,udm-1.8.5.2964 kernel - - - kernel: [86782.818896] x11: 0000000000000000 x10: 0000000000000001 <14>1 2021-01-14T09:12:25+00:00 30c04bee8c30,udm-1.8.5.2964 kernel - - - kernel: [86782.905989] node[25072]: syscall 291 <12>1 2021-01-14T09:12:25+00:00 30c04bee8c30,udm-1.8.5.2964 kernel - - - kernel: [86782.905997] Code: f9400fe5 8b26c0a5 f94000a5 d4000001 (97ffa454) <12>1 2021-01-14T09:12:25+00:00 30c04bee8c30,udm-1.8.5.2964 kernel - - - kernel: [86782.906003] CPU: 0 PID: 25072 Comm: node Tainted: P O 4.1.37-v1.8.5.2964-30c04be #1
fedearne commented 3 years ago

Hi,

I also encountered the need to install CNI, so took the bit from one of the dns examples, which appears to work great.

I do have another issue, and I am sorry if I am hijacking you issue with this.

When i run the homebridge container i get this error "CNI network "homebridge" not found"

I put the file '90-homebridge.conflist' in the path '/mnt/data/podman/cni/'

it looks like this:

Version": "0.4.0", "name": "homebridge", "plugins": [ { "type": "bridge", "bridge": "br0", "ipam": { "type": "host-local", "ranges": [ [ { "subnet": "192.168.1.0/24", "rangeStart": "192.168.1.20", "rangeEnd": "192.168.1.20", "gateway": "192.168.1.1" } ] ], "routes": [ {"dst": "0.0.0.0/0"} ] } }, { "type": "tuning", "capabilities": { "mac": true } } ] }

My network is br0 with IP 192.168.1.0/24

What did you guys do to make it work?

lorenzocanalelc commented 3 years ago

Are you sure you correctly copied the CNI part from the dns example? my CNI file in the on_boot.d looks like this

# cat 10-cni.sh 
CNI_PATH=/mnt/data/podman/cni
if [ ! -f "$CNI_PATH"/macvlan ]; then
    mkdir -p $CNI_PATH
    curl -L https://github.com/containernetworking/plugins/releases/download/v0.9.0/cni-plugins-linux-arm64-v0.9.0.tgz | tar -xz -C $CNI_PATH
fi

mkdir -p /opt/cni
rm -f /opt/cni/bin
ln -s $CNI_PATH /opt/cni/bin

for file in "$CNI_PATH"/*.conflist
do
    if [ -f "$file" ]; then
        ln -s "$file" "/etc/cni/net.d/$(basename "$file")"
    fi
done
fedearne commented 3 years ago

Yes, thats exactly what i have as well. The CNI stuff is placed int the '/mnt/data/podman/cni' and the symlink exists.

fedearne commented 3 years ago

Found some help in other CNI releated issues. It appears that the logging and debug output is occasionaly a little sparse. I had made a classic vi paste error and ended up with the start of the config file missing.

boostchicken commented 3 years ago

Can this issue be closed?

lorenzocanalelc commented 3 years ago

Actually none of the problems I mentioned are solved, maybe the creator of the hombridge guide should answer my questions. @andykant I will report again here my problems:

Describe the bug First of all in order to make the container work you need to have the CNI plugin already installed, this is not mentioned in the Requirements so maybe it should be added. Second I'm not quite sure if my configuration is right (I'm not using a separate vlan, I have setted up the home bridge in the br0 bridge), but every time I change some configuration in the controller (E.g. setting a static ip to a device) I'm not able anymore to access homebridge, and I need to stop and start again the container, I can't figure why this happens

New UDM Information

Variant UDM Base Firmware Version: 1.8.6 Controller Version 6.0.45

boostchicken commented 3 years ago

Yes, we need to update the documentation to include the CNI drivers absolutely. Next time you make that change, please got into the container itself and see if there is network connectivity from it via ping or something. If not investigate the networking stack. Otherwise it's a home bridge issue.

On Fri, Jan 29, 2021, 11:18 PM Lorenzo notifications@github.com wrote:

Actually none of the problems I mentioned are solved, maybe the creator of the hombridge guide should answer my questions. I will report my problems:

Describe the bug First of all in order to make the container work you need to have the CNI plugin already installed, this is not mentioned in the Requirements so maybe it should be added. Second I'm not quite sure if my configuration is right (I'm not using a separate vlan, I have setted up the home bridge in the br0 bridge), but every time I change some configuration in the controller (E.g. setting a static ip to a device) I'm not able anymore to access homebridge, and I need to stop and start again the container, I can't figure why this happens

New UDM Information

Variant UDM Base Firmware Version: 1.8.6 Controller Version 6.0.45

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/boostchicken/udm-utilities/issues/93#issuecomment-770170923, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADIKH5TPRIRGMNQWKNLVMLS4OXENANCNFSM4VY4XT4Q .

boostchicken commented 3 years ago

Added CNI stuff to homebridge

lorenzocanalelc commented 3 years ago

I just tried and when making change (for this trial I just set a static ip to one of my clients) the container itself does not have connectivity, it cannot even ping the UDM. All is solved rebooting the container. PS. Is there a way to make the macaddress of the container stable? Because every reboot the Macaddress is randomly generated

Ryamonster10 commented 3 years ago

I have updated the read me and made a pull request. I also exsperiance the problem where the container needs restart on controller config change.

sundar2012 commented 3 years ago
pascalfco commented 2 years ago

I am also experiencing this issue on a UDM as can be read in the issue #330.