Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Websocket fails about every 30 days #49

Closed
Appelg opened this issue Nov 12, 2022 · 12 comments
Closed

Websocket fails about every 30 days #49

Appelg opened this issue Nov 12, 2022 · 12 comments

Comments

@Appelg
Copy link

Appelg commented Nov 12, 2022

Hello!

The module works perfect. But about every 30 days, it stops receiving data from the websocket.
It can still connect to the websocket, but no data arrives.

image

The only way to get data again is to either restart the UDM-Pro or restart the "unifi-os" docker container on the UDM Pro.

This seem to be some sort of bug of the Unifi-OS.
Does anyone else experience this behaviour?

Edit:
This is the only errormessage I can find (from /var/log/messages on the UDM Pro).
It stops showing up after the reboot when everything works again:

Nov 12 06:38:17 UDMPRO user.notice dpi-flow-stats: ubnt-dpi-util: fingerprint_overrides API failed with HTTP -1
Nov 12 06:38:52 UDMPRO user.notice dpi-flow-stats: ubnt-dpi-util: fingerprint_overrides API failed with HTTP -1
Nov 12 06:39:27 UDMPRO user.notice dpi-flow-stats: ubnt-dpi-util: fingerprint_overrides API failed with HTTP -1
Nov 12 06:40:02 UDMPRO user.notice dpi-flow-stats: ubnt-dpi-util: fingerprint_overrides API failed with HTTP -1
Nov 12 06:40:07 UDMPRO user.notice dpi-flow-stats: ubnt-dpi-util: fingerprint_overrides API failed with HTTP -1
Nov 12 06:40:12 UDMPRO user.notice dpi-flow-stats: ubnt-dpi-util: fingerprint_overrides API failed with HTTP -1
Nov 12 06:40:17 UDMPRO user.notice dpi-flow-stats: ubnt-dpi-util: fingerprint_overrides API failed with HTTP -1
@crxporter
Copy link
Member

crxporter commented Nov 12, 2022

Hello!

Which version are you running? We've done some more recent work to refresh the login credentials regularly (reauthenticate) in the background.

There's some new work being done to have a simplified node for Protect websocket - #48 - which may need a bit of work to log back in after UDM restarts, but otherwise is working well last I checked my setup. My next goal with the devs is to work on knowing when to run a new login...

@marcus-j-davies we talked about a ping/pong setup, any comments on that? It could help us know when to refresh the connection.

I haven't noticed a complete drop-off like you are seeing since a long time.

@marcus-j-davies
Copy link
Member

Correct! @crxporter

I will be adding a ping/pong to the shared socket.
Ping/pong is actually built into the protocol - so its there already (just need to use it).

if we don't get a pong - then a scheduled re-auth will be arranged.

@Appelg
Copy link
Author

Appelg commented Nov 13, 2022

I was using 0.7.2 but switched to 0.8.0 now.

The ping/pong sounds good, I’ll wait for that.

I guess I also have a edge use case, I rarely update unifios/network since ”something always fails”. So I update maybe twice a year under supervision. That leads to uptimes up to 180 days.

If you use auto update, I guess theres so many updates that you don’t ever go 30+ days (which roughly seem to be the tipping point for this error to occur) without a reboot or docker image pull.

@crxporter
Copy link
Member

I don't think you're an edge case - there aren't many of "us" that take wifi uptime lightly. Mine is only 20 days uptime right now because I was doing some tests on the newest beta #48 - but usually I only reboot for big feature or important security updates.

We'll keep this issue open for a while, watch for if we have any new information. And please do come back in a few weeks (around Christmas?) to report on version 0.8.0 uptime!

@marcus-j-davies
Copy link
Member

@crxporter @Appelg

My 2nd to latest commit introduced hopefully robust recovery mechanisms.

3bf7a97

@Appelg
Copy link
Author

Appelg commented Dec 21, 2022

@marcus-j-davies Are those changes released yet?

It failed me again after 29 days:

From UDM-PRO:

# uptime
 14:10:12 up 29 days, 20:15,  load average: 17.46, 17.86, 17.85

# tail -f /var/log/messages | grep API
Dec 21 14:12:17 UDMPRO user.notice dpi-flow-stats: ubnt-dpi-util: fingerprint_overrides API failed with HTTP -1
Dec 21 14:12:52 UDMPRO user.notice dpi-flow-stats: ubnt-dpi-util: fingerprint_overrides API failed with HTTP -1
Dec 21 14:13:27 UDMPRO user.notice dpi-flow-stats: ubnt-dpi-util: fingerprint_overrides API failed with HTTP -1

From Node-red:
{"code":4014,"reason":[],"url":"wss://192.168.42.1/proxy/network/wss/s/default/events"}

@marcus-j-davies
Copy link
Member

Hi @Appelg

There is a BETA version available to install if you wanted to beta test..

cd ~/.node-red 
npm install node-red-contrib-unifi-os@dev

But to benefit, you will need to use the new protect node that ships with v0.9.0

@marcus-j-davies
Copy link
Member

Note:
You will need to open up the access controller config node and save it again - this is just to apply some new defaults, that are not in the previous version.

@marcus-j-davies
Copy link
Member

@Appelg

have you installed the BETA?
We will be pushing out BETA 2 soon.

#53

@marcus-j-davies
Copy link
Member

Should be fixed

@Appelg
Copy link
Author

Appelg commented Jun 7, 2023

Thanks!
I will try the new version asap.

@marcus-j-davies
Copy link
Member

To benefit, you need to use the new protect node

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants