stmllr.net

Why OpenOffice.org and Zotero are not communicating

by on stmllr.net

For my thesis I use OpenOffice.org in combination with Zotero (Firefox) to manage my references. (I already posted an article about Zotero over a year ago.) Both are powerful tools, but sometimes they are troublemakers...

Zotero provides its services via HTTP, using TCP port 50001 on localhost. OpenOffice.org on the other side uses an Extension to build a bridge to Zotero by connecting to that service. To be able to access my bibliography from OpenOffice.org, Firefox/Zotero has to be running all the time.

To get a quick impression about what services are listening on what socket (IP/port), I use netstat:

spock@cayenne:~$ netstat -ltpn

Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 127.0.0.1:3690          0.0.0.0:*               LISTEN      -              
tcp        0      0 127.0.0.1:50001         0.0.0.0:*               LISTEN      11201/firefox  
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      - 

Whenever I am at home, OpenOffice.org and Zotero are running as expected. As soon as I leave home (e.g. to spend a day in the library) OpenOffice.org refuses to connect to Zotero, complaining that Zotero might not be running:

OpenOffice.org / Zotero error message

But Zotero was up and running?! I remembered I had this error before, when updating Zotero to a new version without updating the OpenOffice.org extension. But this time there was no update.

After some investigation, I found out that one can turn on the logging of Zotero using about:config in Firefox (extensions.zotero.debug.log = true). The logs revealed that Zotero wasn't able to to offer it's HTTP service, because Firefox is in offline mode:

(...)
Browser is offline -- not initializing integration HTTP server
(...)

netstat could also not find Firefox listening on port 50001:

spock@cayenne:~$ netstat -ltpn

Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 127.0.0.1:3690          0.0.0.0:*               LISTEN      -              
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      -

The laptop I use for writing is always online at home. In the library it is usually offline except for the localhost dummy interface (127.0.0.1). Firefox on Ubuntu Intrepid seems to switch to offline mode, if no outbound network connection can be found. In offline mode, Zotero does not provide its service at all, although it does in no way depend on an outbound network.

The solution was to switch to online mode in Firefox, which lets Zotero start its service immediately.

What can we learn from the story?

  • Do not blindly believe in error logs: They sometimes don't tell the whole truth. Instead of precisely describing the problem, the OpenOffice.org popup made useless suggestions ("Make sure Firefox is open").
  • Do not blindly wipe away error logs: Chances are, that you find the reason for your problem inside. Zotero loggin was hard to find, but then revealed the root of my problem.

Tags