Created attachment 184046 [details]
Upgrade to 5.5.19
Created attachment 184047 [details]
testport for 5.5.19
This patch breaks the ability to adopt any access points because you've removed the native version of snappy for the one bundled with Unifi which doesn't a version of the library inside the jar file compiled for FreeBSD
Adoption still works. What are your concerns with the current patch?
The symlink /usr/local/share/java/unifi/lib/snappy-java-22.214.171.124.jar points to the pkg installed archivers/snappy-java's /usr/local/share/java/classes/snappy-java.jar.
Should archivers/snappy-java be updated to 126.96.36.199 or should the symlink's name remain unchanged, leaving it snappy-java-1.0.5.jar. I was expecting the existing unifi controller software wanted snappy-java-188.8.131.52.jar. What I didn't look at does it require a specific version or a version > 184.108.40.206 or >= 220.127.116.11. The port only calls for a version to be installed.
We should update the archivers/snappy-java port to a 1.1.x release to (hopefully) ensure ABI compatibility and symlink that version in.
I missed your comment about adoption - sorry, on mobile.
Previously snappy was required for some features to work which I thought included adoption. The jar shipped with Unifi doesn't include FreeBSD support which is why we replace with a version from ports. I'll see if I can find the old bug report or email that detailed the failure cases from before we started replacing the jar with one from the archivers/snappy-java port.
You're correct with snappy and adoption. My first attempt with this patch I forgot to change the symlink.
When the AP attempted to connect to http://controller:8080/inform the controller would crash with:
[2017-07-04 02:05:55,653] <inform-1> ERROR [InformServlet] - Servlet.service() for servlet [InformServlet] in context with path  threw exception [Servlet execution threw an exception] with root cause
org.xerial.snappy.SnappyError: [FAILED_TO_LOAD_NATIVE_LIBRARY] no native library is found for os.name=FreeBSD and os.arch=x86_64
After fixing the post-patch: symlink to use the native installed jar everything worked.
I put out a feeler to see if Unifi can give any extra details on snappy-java usage.
*** Bug 220577 has been marked as a duplicate of this bug. ***
If I can help, let me know. We should try to update the JAR to the latest snappy, or encourage Unifi to support FreeBSD.
(In reply to David Harrigan from comment #8)
I encourage everyone who uses UniFi on FreeBSD to tell Ubiquiti they want support.
The good news is that the absolute latest versions of Snappy come with support for FreeBSD amd64 out of the box, so hopefully UniFi will start shipping that soon, but it also requires they don't build Snappy themselves which I am not sure whether or not they do.
I have not yet been able to identify an issue with using the older Snappy with the newer UniFi so I suspect there is no ABI/API breakage. I will commit 5.5.19 shortly, but still need to keep looking at a sane way to keep Snappy in the ports tree up to date.
A commit references this bug:
Date: Wed Jul 12 21:09:42 UTC 2017
New revision: 445610
net-mgmt/unifi5: Update to 5.5.19
Forgotten to close?
(In reply to w.schwarzenfeld from comment #11)
Couldn't close because of a dependency, but it never did become a blocker.