Argument list too long

Dear all,
I'm running since some months Zotero 4.0.11 standalone 64b under linux, but since few days I'm experiencing the following problem when executing zotero.

I open a terminal and execute the "zotero" command.
`which zotero` = /usr/local/bin/zotero which is a symlink
/usr/local/bin/zotero -> /opt/Zotero_linux-x86_64/run-zotero.sh

The PC works a while without opening a zotero window; meanwhile I can see "zotero" process with the top command, but after ~30 seconds (much more it usually takes to start) it exits with:

/usr/local/bin/zotero: line 142: /usr/local/bin/zotero: Argument list too long
/usr/local/bin/zotero: line 142: /usr/local/bin/zotero: Success

Just discovered with some relief, and curiously enough, it works if I execute, instead of the symlink, the file it points to i.e. /opt/Zotero_linux-x86_64/run-zotero.sh
So now I can run zotero, but let me post this information which maybe useful also to others, and I'd like to understand the reason for the problem above.

Maybe useful, my zotero.sqlite file is 76MB large.
Thank you
  • which linux distro?
  • Lubuntu 12.04 LTS. `uname -a`:
    Linux XXXXXX 3.2.0-54-generic #82-Ubuntu SMP Tue Sep 10 20:08:42 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
  • looking at this again - if executing the file works, but executing the symlink doesn't, that would suggest a linux rather than a Zotero problem, no? The two should be exactly the same
  • I'm not sure. The file is the same, but it seems that the script is reading location/ filename or whatever. I've done three tests with symlinks:


    guido@:~$ ln -s /opt/Zotero_linux-x86_64/run-zotero.sh .
    guido@:~$ ./run-zotero.sh
    run-zotero.sh: Cannot execute .
    [EXIT immediately]


    guido@:~$ ln -s /opt/Zotero_linux-x86_64/run-zotero.sh zotero
    guido@:~$ ./zotero
    /home/guido/zotero: line 142: /home/guido/zotero: Argument list too long
    /home/guido/zotero: line 142: /home/guido/zotero: Success
    [EXIT after 30s]


    guido@:~$ /opt/Zotero_linux-x86_64/run-zotero.sh
    [WORKS]


    In the three cases, I'm accessing the same file...
  • run-zotero.sh is just a copy of the script Mozilla uses for Firefox, so it's not something we wrote, but it's not what you should be using to run Zotero from the command line anyway. You can just run the 'zotero' executable.

    (Are you sure you want to be running Zotero from the command line, though? Unless you're doing development or trying to generate debug output, there's not really any reason to do so.)
  • I am seeing the same issue.
    A common model for running gui applications in Linux is to open a GUI-based command-line launcher [ctrl][f2] from which you can type the name you want and it opens the GUI application. This is a Linuxy alternative to clicking a link in the menu with your mouse. not exactly running the application from the command line, any more than opening the main menu and clicking the application there is.
    ln -s target link is a way to add a shortcut. For instance, if you entered "/Zotero_directory/zotero ~/Desktop/zotero" on your command line, it would create a desktop shortcut.
    The problem is a Zotero problem, because a link should behave exactly like the original file, and this one plainly isn't.
  • edited April 16, 2014
    professor@telcontar-2:/usr/local/bin$ which zotero
    /usr/local/bin/zotero #This is a soft link#
    professor@telcontar-2:/usr/local/bin$ valgrind zotero
    ==9910== Memcheck, a memory error detector
    ==9910== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
    ==9910== Using Valgrind-3.10.0.SVN and LibVEX;
    ==9910== Command: zotero
    Could not read application.ini

    professor@telcontar-2:/usr/local/bin$ ls -l zotero
    lrwxrwxrwx 1 root root 18 Apr 15 23:41 zotero -> /opt/Zotero/zotero

    So using the link, the zotero executable couldn't find the application.ini file, and that is why it is failing.

    The following bash script, placed in /usr/local/bin does work (at least in the [ctrl] [f2] command line or by calling it by /usr/local/bin/zotero or by changing to the /usr/local/bin directory and using ./zotero):
    ###########
    #!/bin/sh
    cd /opt/Zotero
    ./zotero
    ###########
  • yeah, what I wrote above wasn't right, this is a known xulrunner issue, aurimas describes and links to it here:
    https://forums.zotero.org/discussion/22721/zotero-standalone-cannot-start-from-symlink-in-linux-could-not-read-applicationini/

    Running Zotero via GUI launcher (in my case Ubuntu Dash) works w/o problems for me though.
  • I had a similar problem just now on arch linux. I reinstalled zotero and got the following message:

    ```
    warning: directory permissions differ on /usr/lib/zotero/
    filesystem: 757 package: 755
    warning: directory permissions differ on /usr/lib/zotero/xulrunner/
    filesystem: 757 package: 755
    warning: directory permissions differ on /usr/lib/zotero/xulrunner/gmp-fake/
    filesystem: 757 package: 755
    warning: directory permissions differ on /usr/lib/zotero/xulrunner/gmp-fake/1.0/
    filesystem: 757 package: 755
    ```

    So I `chmod`ed 755 all those files and I was all set. Anyone know what the root cause of the issue is though? Along the way, I went to line 142 in the script and tried `echo ${1+"$@"}`. It appearing to be printing a lot of newline.
Sign In or Register to comment.