Created attachment 186301 [details] elasticsearch 5.3 -> 5.6 diff Update for elasticsearch 5.6.0
I tried a build for 5.6.2 manually and it seems the version of JNA (4.4.0) coming with this version of Elasticsearch is not build for Freebsd. Version 4.5.0 however does have FreeBSD support again, just replacing the file /usr/local/lib/elasticsearch/lib/jna-4.4.0-1.jar with 4.5.0 from here https://github.com/java-native-access/jna worked for me.
I used the following procedure to update to 5.6.0: - use the patch from the original poster - install jna 4.5.0 port (devel/jna) - install patched elasticsearch5 port (textproc/elasticsearch5) - remove jna 4.4.0 => rm /usr/local/lib/elasticsearch/lib/jna-4.4.0-1.jar - copy jna 4.5.0 from installed port => cp /usr/local/share/java/classes/jna.jar /usr/local/lib/elasticsearch/lib/jna-4.5.0-1.jar - change permission on log4j2.properties => chmod a+r /usr/local/etc/elasticsearch/log4j2.properties - service elasticsearch start And all goes well (on a single node dev host and until now).
Created attachment 187971 [details] elasticsearch5 5.3.0 to 5.6.4 patch Hello, I made a patch against original 5.3.0 version of the port to update to 5.6.4 which integrates the jna.jar file from devel/jna port. It is currently running ok on our preproduction cluster. Regards,
Update patch to 5.6.3 exists - bug #223439. So I close here - overcome by events.
Mark, can you look at the JNA topic mentioned in comment 3 ?
A commit references this bug: Author: feld Date: Mon Feb 26 23:06:02 UTC 2018 New revision: 463096 URL: https://svnweb.freebsd.org/changeset/ports/463096 Log: textproc/elasticsearch5: Fix JNA support JNA (Java Native Access) provides access to OS-native facilities in pure Java code. The JNA shipped with Elastic is meant for Linux so it does not function correctly. We will ship one built for FreeBSD instead. PR: 222261 Approved by: portmgr (with hat) Changes: head/textproc/elasticsearch5/Makefile
A commit references this bug: Author: feld Date: Mon Feb 26 23:11:53 UTC 2018 New revision: 463098 URL: https://svnweb.freebsd.org/changeset/ports/463098 Log: textproc/elasticsearch6: Fix JNA support JNA (Java Native Access) provides access to OS-native facilities in pure Java code. The JNA shipped with Elastic is meant for Linux so it does not function correctly. We will ship one built for FreeBSD instead. PR: 222261 Changes: head/textproc/elasticsearch6/Makefile
A commit references this bug: Author: feld Date: Mon Feb 26 23:21:57 UTC 2018 New revision: 463102 URL: https://svnweb.freebsd.org/changeset/ports/463102 Log: textproc/elasticsearch{5,6}: Fix build The JNA dependency was meant to be at runtime Pointyhat: me PR: 222261 Changes: head/textproc/elasticsearch5/Makefile head/textproc/elasticsearch6/Makefile
(In reply to commit-hook from comment #8) Hi, the new patch still don't work. A symbolic link is created pointing to nowhere. Logs from ES: 2018-02-26T01:12:53,034][WARN ][o.e.b.Natives ] JNA not found. native methods will be disabled. Missing jna.jar: ls -l /usr/local/lib/elasticsearch/lib/jna.jar lrwxr-xr-x 1 root wheel 68 Feb 27 12:51 /usr/local/lib/elasticsearch/lib/jna.jar@ -> ../../../../../../../../../../../../local/share/java/classes/jna.jar md5 /usr/local/lib/elasticsearch/lib/jna.jar md5: /usr/local/lib/elasticsearch/lib/jna.jar: No such file or directory
see Bug #226234.
(In reply to Patrice from comment #9) $ pkg info | grep elasticsearch5 elasticsearch5-5.6.8_2 Full-text search engine for Java $ ls -la jna.jar lrwxr-xr-x 1 root wheel 72 Feb 26 23:23 jna.jar -> ../../../../../../../../../../../../usr/local/share/java/classes/jna.jar $ md5 jna.jar MD5 (jna.jar) = 5736a11b203679cda4b3cb5237a82b70 $ md5 ../../../../../../../../../../../../usr/local/share/java/classes/jna.jar MD5 (../../../../../../../../../../../../usr/local/share/java/classes/jna.jar) = 5736a11b203679cda4b3cb5237a82b70 Make sure you're using PORTREVISION=2 version of the port/package.
(In reply to Mark Felder from comment #11) Sorry, but it fails at compile time. I updated the tree with portsnap fetch && update. Then, I pkg deleted jna and elasticsearch5 and used portmaster to install elasticsearch5. Here is the compile error: install -lrs /usr/ports/usr/ports/textproc/elasticsearch5/work/stage/usr/local/lib/elasticsearch/bin/elasticsearch-plugin /usr/ports/usr/ports/textproc/elasticsearch5/work/stage/usr/local/bin/elasticsearch-plugin install -lrs /usr/local/share/java/classes/jna.jar /usr/ports/usr/ports/textproc/elasticsearch5/work/stage/usr/local/lib/elasticsearch/lib/jna.jar install: /usr/local/share/java/classes/jna.jar: realpath: No such file or directory *** Error code 71 Stop. make[1]: stopped in /usr/ports/textproc/elasticsearch5 *** Error code 1 I made the patch in the first place with JNA as a build dependency only on purpose.
(In reply to Patrice from comment #12) Your portsnap is behind. What PORTREVISION are you on? I intentionally removed it as a BUILD dependency because we should not bundle this with Elastic if it's in the ports tree; instead we should install it from the package and symlink to it. This ensures we get fixes and improvements regardless of what version of Elastic is installed.
(In reply to Mark Felder from comment #13) I am on PORTREVISION 2. Tried again a few minutes ago. Update via portsnap, here are the results: root@ports:/usr/ports/textproc/elasticsearch5 # grep PORTREV Makefile PORTREVISION= 2 root@ports:/usr/ports/textproc/elasticsearch5 # pkg info |grep jna root@ports:/usr/ports/textproc/elasticsearch5 # portmaster -gdb textproc/elasticsearch5 ... ===>>> The following actions will be taken if you choose to proceed: Install textproc/elasticsearch5 Install devel/jna Upgrade openjdk8-8.162.12 to openjdk8-8.162.12_1 ===>>> Proceed? y/n [y] ... install -lrs /usr/ports/usr/ports/textproc/elasticsearch5/work/stage/usr/local/lib/elasticsearch/bin/elasticsearch-plugin /usr/ports/usr/ports/textproc/elasticsearch5/work/stage/usr/local/bin/elasticsearch-plugin install -lrs /usr/local/share/java/classes/jna.jar /usr/ports/usr/ports/textproc/elasticsearch5/work/stage/usr/local/lib/elasticsearch/lib/jna.jar install: /usr/local/share/java/classes/jna.jar: realpath: No such file or directory *** Error code 71 Stop. Have you tried my procedure: uninstall jna and elasticsearch5 and try to build elasticsearch5 again? My guess: build is breaking because jna is built after elasticsearch5.
Portmaster is behaving differently than Poudriere here... I'll force this with a BUILD_DEPENDS so the symlink never errors.
A commit references this bug: Author: feld Date: Thu Mar 1 23:46:17 UTC 2018 New revision: 463359 URL: https://svnweb.freebsd.org/changeset/ports/463359 Log: textproc/elasticsearch5: Fix build devel/jca needs to be a BUILD_DEPEND or install fails to find the path for creating the symlink. Poudriere seemed to not notice as it had already installed devel/jca. PR: 222261 Changes: head/textproc/elasticsearch5/Makefile
(In reply to commit-hook from comment #16) Hi, well, even though the build works, there is still a bug with the symlink to jna.jar. I have deinstalled both jna and elasticsearch5 and installed the new ports (with PORTREVISION=2). jna.jar is still not found: [2018-03-02T09:21:47,682][WARN ][o.e.b.Natives ] JNA not found. native methods will be disabled. root@pnode1:~ # find /usr/local/ -name jna.jar /usr/local/share/java/classes/jna.jar /usr/local/lib/elasticsearch/lib/jna.jar root@pnode1:~ # ls -l /usr/local/lib/elasticsearch/lib/jna.jar lrwxr-xr-x 1 root wheel 68 Mar 1 18:17 /usr/local/lib/elasticsearch/lib/jna.jar -> ../../../../../../../../../../../../local/share/java/classes/jna.jar root@pnode1:~ # ls -l /usr/local/lib/elasticsearch/lib/../../../../../../../../../../../../local/share/java/classes/jna.jar ls: /usr/local/lib/elasticsearch/lib/../../../../../../../../../../../../local/share/java/classes/jna.jar: No such file or directory
A commit references this bug: Author: feld Date: Fri Mar 2 13:06:24 UTC 2018 New revision: 463392 URL: https://svnweb.freebsd.org/changeset/ports/463392 Log: textproc/elasticsearch{5,6}: Fix symlink Relative symlinks should only be used when both files are in the STAGEDIR. In this situation poudriere was producing usable packages because of the unique location of WRKSRC (/wrksrc/...) which caused the relative symlink to be deep enough "../../../../../" to hit the root of the filesystem and then point to the location of the file. However, users who were building the port directory with "make" or "portmaster" were getting symlinks that did not point to the right location. PR: 226234 226265 222261 Changes: head/textproc/elasticsearch5/Makefile head/textproc/elasticsearch6/Makefile
(In reply to commit-hook from comment #18) Thanks very much, works perfectly now. Regards,