FreeBSD/LibreOffice/Firefox/Zotero java error

Hello. I know I'm weird for using BSD on my desktop, but I'm an old sysadmin and BSD bigot, so that colors my system. I still use twm for my window manager, because I don't have any use for the heavy stuff that slows the system down.

I am getting a java exception error when trying to use Zotero after a large system update. Therefore, it is very possible that the problem is purely on my end (i.e., I get to keep both halves).

However, just in case you have any pointers... Here are the relevant versions:

FreeBSD: 11.0-RELEASE-p2
Firefox: 51.0.1 (64 bit)
LibreOffice: 5.2.4.2.0+
Java: OpenJDK8-8.121.13
Zotero: 4.0.29.16
LO integration: 3.5.12 (according to firefox) 3.5.9 (according to libreoffice)

I start libreoffice, create a new text file, click on the zotero configuration button, and get the following in a popup:

An error occurred communicating with Zotero:
java.net.SocketException: Connection reset by peer
at java.net.PlainSocketImpl.socketSetOption(Native Method)
at java.net.AbstractPlainSocketImpl.setOption(AbstractPlainSocketImpl.java:269)
at java.net.Socket.setTcpNoDelay(Socket.java:952)
at org.zotero.integration.ooo.comp.CommServer.run(CommServer.java:23)
at java.lang.Thread.run(Thread.java:745)

Any clues?

(Standalone zotero is not an option at the moment, as you're only distributing binary. I'd be happy to try to get it working on FreeBSD myself if you released the source.)
  • All Zotero code is free&open https://github.com/zotero/ including both actual code and the Standalone build scripts, but I wouldn't expect Standalone to behave differently here. (Also, the Linux file that's distributed for Standalone isn't a binary. It's a tarball that you can unpack and tinker with in its entirety).


    There used to be a problem with Word integration using 64-bit Firefox -- that's fixed, but its possible something similar is going on and in that case Standalone might help.

    Beyond that, from the error it's looking like something is preventing Zotero/LO communication so maybe looking at any proxies, firewalls, or other security stuff you have running could be an option.
  • Thank you for the github info. I will download it and see if the 5.0 version works. In doing some other debugging this evening, I discovered that some of my many privacy plugins invisibly cause websites to fail now... which may account for the issue here as well. I'll probably play with shutting those down and see if that affects zotero as well.

    I will also look into what is required to get it added to the freebsd ports tree.

    Just for the record, the list of privacy/security plugins I use are: privacy badger, umatrix, ublock, flashblock, beeftaco, right to click, https everywhere, lightbeam, disconnect, and google untracker. If I find that one or more of those is in fact the culprit, I'll update this message.
  • There was something about ublock, I think, though that related to 127.0.0.1 communication between browser connector and Standalone, so may not apply here. Still, may may be worth looking at to what degree any of them block local ports
  • Note that Zotero for Firefox will be discontinued shortly, so a switch to Standalone will be mandatory (there is nothing we can do about this - Firefox is discontinuing XUL based extensions) with the upcoming version 5.0. We don't have resources to provide FreeBSD builds, but we're happy to accept a PR that would ease the process.

    As for the plugin, the extension uses a HTTP server to interface between LibreOffice and Zotero. The LibreOffice extension tries to start a server on 127.0.0.1:23116 (and Standalone uses 127.0.0.1:23119, which will be relevant to you once/if you switch, to talk to Zotero Connectors - extensions for Chrome, Safari and now available for Firefox too). So you probably want to look into your firewall settings and/or Java permissions.
  • Sorry for the long delay in an update. It did turn out that time that the problem was ublock; whitelisting localhost fixed it. (Note: this is a big security issue!).

    I also tried unsuccessfully to get the standalone built at that time. The maze of twisty little dependencies all alike finally defeated me (and I am an old school UNIX administrator, my first UNIX system was in 1980...). I am having problems once again, and will probably try to see if I can get standalone to compile, once again.

    Thank you for the help and pointers!
  • Hello. I am a FreeBSD user too and migration to Zotero 5.0 is a serious problem for me.

    I have built the Standalone using code dated October 20 following the instruction https://www.zotero.org/support/dev/client_coding/building_the_standalone_client. It seems to be working though I have not fully tested it.

    For the moment, I use the updater file zotero-standalone-build/linux/updater-x86_64 which is a binary file. Is there the source or a documentation for the updater?

    Thanks in advance.
  • That's the Mozilla updater executable from Firefox 39, before Mozilla made them only accept Mozilla-signed updates.
  • Thank you very much for your quick reply.
  • Okay. I have been looking at this again, as an automatic update forced me to the version 5 connector, despite the fact I had been using the old version. I have started plowing through the build. As best I can see, what you are doing isbuilding a complete version of firefox with the javascript for zotero built in to it; is that correct?

    An actual native build on FreeBSD doesn't and won't work ecause several of your scripts are bwritten assuming that the platform is only one of the 3 provided. Simply running those scripts on a FreeBSD system will obviously not work; I can't imagine how tsukuda did what they did without making a LOT of edits to a LOT of scripts, while understanding how the whole build architecture goes together....

    I am simply gobsmacked by the complexity of the build, and am at a bit of a loss how to turn this into something reasonable for a generic UNIX build. I am sure some of the problem is the incredible ugliness of the firefox build itself. But, still....
  • My zotero has been updated automatically too and I have to start using version 5.
    It seems to be working though I do not think the updater would work.

    Here is what I have done:

    # ln -s /usr/local/bin/bash /bin/bash
    (I did not want to modify all the #!)

    Follow the steps 1-3 of the instruction.

    Modify several scripts in the directory zotero-standalone-build (build.sh, config.sh, fetch_xulrunner.sh, check_requirements, dir_build).
    Here is the patch made with git --diff in the directory zotero-standalone-build.
    https://pastebin.com/dnWPsLWm

    Follow the steps 4-6 of the instruction.
  • Thanks. You have more patience than I do. :-) I stopped after the first script modification. Amusingly, and perhaps unsurprisingly, I was doing it precisely the way you do. :-)
  • Hello tsukuda,

    Would you be willing to repost those build diffs for building on FreeBSD? They should work on DragonFlyBSD also which I am trying to build on.
  • Hello.

    I have not checked the forum for a long time and I might have missed the notification email.

    The old patch does not work as it was.
    I will fix it and post the new one in a couple of weeks.
  • I have forked the zotero-standalone-build repo:

    https://github.com/s1tsu/zotero-standalone-build

    The file "freebsd.patch" is the diff.
Sign In or Register to comment.