Bug 220461 - [PATCH] net-mgmt/unifi5 Upgrade to 5.5.19
Summary: [PATCH] net-mgmt/unifi5 Upgrade to 5.5.19
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Mark Felder
URL: https://reviews.freebsd.org/D11473 h...
Keywords: patch
: 220577 (view as bug list)
Depends on: 220315
Blocks:
  Show dependency treegraph
 
Reported: 2017-07-04 03:42 UTC by Derek Schrock
Modified: 2018-02-02 18:35 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (feld)


Attachments
Upgrade to 5.5.19 (7.45 KB, patch)
2017-07-04 03:42 UTC, Derek Schrock
no flags Details | Diff
testport for 5.5.19 (25.39 KB, text/plain)
2017-07-04 03:44 UTC, Derek Schrock
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Derek Schrock 2017-07-04 03:42:29 UTC
Created attachment 184046 [details]
Upgrade to 5.5.19
Comment 1 Derek Schrock 2017-07-04 03:44:52 UTC
Created attachment 184047 [details]
testport for 5.5.19
Comment 2 Mark Felder freebsd_committer 2017-07-04 12:02:57 UTC
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
Comment 3 Derek Schrock 2017-07-04 17:55:47 UTC
Adoption still works.  What are your concerns with the current patch?

The symlink /usr/local/share/java/unifi/lib/snappy-java-1.1.2.6.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 1.1.2.6 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-1.1.2.6.jar.  What I didn't look at does it require a specific version or a version > 1.0.4.1 or >= 1.1.2.6.  The port only calls for a version to be installed.
Comment 4 Mark Felder freebsd_committer 2017-07-04 18:28:09 UTC
We should update the archivers/snappy-java port to a 1.1.x release to (hopefully) ensure ABI compatibility and symlink that version in.
Comment 5 Mark Felder freebsd_committer 2017-07-04 18:54:04 UTC
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.
Comment 6 Derek Schrock 2017-07-04 19:43:43 UTC
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
        at org.xerial.snappy.SnappyLoader.findNativeLibrary(SnappyLoader.java:331)
        at org.xerial.snappy.SnappyLoader.loadNativeLibrary(SnappyLoader.java:171)
        at org.xerial.snappy.SnappyLoader.load(SnappyLoader.java:152)
...

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.
Comment 7 Mark Felder freebsd_committer 2017-07-09 20:41:13 UTC
*** Bug 220577 has been marked as a duplicate of this bug. ***
Comment 8 David Harrigan 2017-07-09 20:51:18 UTC
Hi,

If I can help, let me know. We should try to update the JAR to the latest snappy, or encourage Unifi to support FreeBSD.

-=david=-
Comment 9 Mark Felder freebsd_committer 2017-07-10 01:13:44 UTC
(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.
Comment 10 commit-hook freebsd_committer 2017-07-12 21:10:46 UTC
A commit references this bug:

Author: feld
Date: Wed Jul 12 21:09:42 UTC 2017
New revision: 445610
URL: https://svnweb.freebsd.org/changeset/ports/445610

Log:
  net-mgmt/unifi5: Update to 5.5.19

  Changelog:	https://community.ubnt.com/t5/UniFi-Updates-Blog/UniFi-5-5-19-Stable-has-been-released/ba-p/1980967

  PR:		220461

Changes:
  head/net-mgmt/unifi5/Makefile
  head/net-mgmt/unifi5/distinfo
  head/net-mgmt/unifi5/pkg-plist
Comment 11 Walter Schwarzenfeld freebsd_triage 2018-02-02 17:02:33 UTC
Forgotten to close?
Comment 12 Mark Felder freebsd_committer 2018-02-02 18:35:58 UTC
(In reply to w.schwarzenfeld from comment #11)

Couldn't close because of a dependency, but it never did become a blocker.