We finally figured it out. It was because we are running our galaxy on port
80, so we needed to give python the permission to bind to port 80. We used
setcap to do this, however, if one is giving permission to bind to a
privileged port, setcap make it so that LD_LIBRARY_PATH is removed from the
passed environment variables. That nearly drove us all crazy, but it works
now! :)
- Nik.

On Thu, Jan 29, 2015 at 3:24 PM, Nikhil Joshi <najo...@ucdavis.edu> wrote:

> It is a regular system installation. Just for a sanity check, I checked
> the md5 hash with the same version of my local python and it is the same.
> Also, as a sanity check, I ran the tests on my local machine and python got
> the LD_LIBRARY_PATH variable just fine, both as a regular user and as root.
> I thought that maybe it was an apparmor thing, but usually that logs when
> it denies an application, and I didn't find anything in the logs.
> - Nik.
>
> On Thu, Jan 29, 2015 at 5:02 AM, Wolfgang Maier <
> wolfgang.ma...@biologie.uni-freiburg.de> wrote:
>
>> Since there are so many surprising new details in your last mail, maybe
>> it would help if you could tell where you got your Python from. Is it a
>> regular system installation or a toolshed installed version inside Galaxy
>> (which may use its own env.sh to manipulate paths) ?
>>
>> Best,
>> Wolfgang
>> On 29.01.2015 11:02, Nikhil Joshi wrote:
>>
>>> Ok, a little more progress. This is really strange. It seems that it is
>>> only python that is not getting LD_LIBRARY_PATH, and it only doesn't get
>>> it if it is being invoked by a user (i.e. not root). If root invokes
>>> python then it gets the variable no problem. If the galaxy user invokes
>>> it, it does not get it. However, if the galaxy user invokes perl and
>>> prints LD_LIBRARY_PATH, it is there?!?!? I should mention that this
>>> Galaxy is being run on an Amazon AMI. Is there some weird security thing
>>> where *specifically* python does not get LD_LIBRARY_PATH?
>>>
>>> - Nik.
>>>
>>> On Wed, Jan 28, 2015 at 4:33 PM, Nikhil Joshi
>>> <najo...@ucdavis.edu
>>> <mailto:najo...@ucdavis.edu>> wrote:
>>>
>>>     Well we are using the "environment_setup_file" option in our
>>>     galaxy.ini file. Supposedly we can point to a shell script that will
>>>     be sourced before running each job. In this script we load all of
>>>     the environment variables using modules. The paths are all correct
>>>     after this runs. However, the python script that is run (from the
>>>     XML for the cufflinks tool) does not inherit these environment
>>>     variables correctly. Below is the content of our env.sh script:
>>>
>>>     #!/bin/bash
>>>     . /etc/profile.d/modules_sh.sh
>>>     module load meta/galaxy
>>>
>>>     This definitely loads the environment properly. And here is the
>>>     cufflinks line from the XML:
>>>
>>>         <command interpreter="python">
>>>              cufflinks_wrapper.py
>>>                  --input=$input
>>>     ..... etc.
>>>
>>>     This cufflinks wrapper fails because it cannot actually run
>>>     cufflinks because it cannot find a library that it needs, because
>>>     the LD_LIBRARY_PATH is empty within its environment. I actually
>>>     edited the XML to echo the load path to a file before the python
>>>     script runs and the path was fine, but still the python script
>>>     doesn't inherit it properly.
>>>
>>>     - Nik.
>>>
>>>     On Wed, Jan 28, 2015 at 6:16 AM, Nate Coraor
>>>     <n...@bx.psu.edu
>>>     <mailto:n...@bx.psu.edu>> wrote:
>>>
>>>         Hi Nik,
>>>
>>>         Is there any chance that $LD_LIBRARY_PATH is being set in the
>>>         parent shell but not exported?
>>>
>>>         --nate
>>>
>>>         On Wed, Jan 28, 2015 at 7:04 AM, Nikhil Joshi
>>>         <najo...@ucdavis.edu
>>>         <mailto:najo...@ucdavis.edu>> wrote:
>>>
>>>             To answer your questions from above, in case it can help
>>>             with this new problem, we are sourcing the modules from an
>>>             "env.sh" script whose full path is the value of the
>>>             "environment_setup_file" option. This fixed our first
>>>             problem, but not this second one. We created the modules
>>>             ourselves for each of the programs.
>>>
>>>             - Nik.
>>>
>>>             On Tue, Jan 27, 2015 at 6:45 PM, Nikhil Joshi
>>>             <najo...@ucdavis.edu
>>>             <mailto:najo...@ucdavis.edu>> wrote:
>>>
>>>                 Okay, we fixed that problem, but another tool is now
>>>                 having the same problem. Now I am trying to run
>>>                 cufflinks and I am getting that same error, but this
>>>                 time there is yet another layer of abstraction because
>>>                 the XML is calling a python script. It seems like the
>>>                 LD_LIBRARY_PATH is correct right up until the python
>>>                 wrapper script gets called and then for some reason the
>>>                 environment is not being passed to the script. This
>>>                 seems like a problem with Popen somewhere in galaxy
>>>                 where it is not passing the environment to the
>>>                 subprocess?....
>>>
>>>                 - Nik.
>>>
>>>                 On Tue, Jan 27, 2015 at 4:33 PM, Nikhil Joshi
>>>                 <najo...@ucdavis.edu
>>>                 <mailto:najo...@ucdavis.edu>> wrote:
>>>
>>>                     Hi John,
>>>
>>>                     Thanks for your reply. Our sys admin figured out the
>>>                     problem.... we had to use the
>>>                     "environment_setup_file" option to load the modules
>>>                     and we had to fix some shell issues where galaxy was
>>>                     using the dash shell instead of bash. Anyways, it's
>>>                     fixed for now!
>>>
>>>                     - Nik.
>>>
>>>                     On Mon, Jan 26, 2015 at 6:43 AM, John Chilton
>>>                     <jmchil...@gmail.com
>>>                     <mailto:jmchil...@gmail.com>>
>>>                     wrote:
>>>
>>>                         Had some idea but they were all dead ends. How
>>>                         are you sourcing the
>>>                         modules - in Galaxy's environment, using an
>>>                         environment file, using
>>>                         Galaxy dependencies (env.sh files) or using
>>>                         Galaxy's modules support?
>>>                         Do you have an example of such a module that
>>>                         sets LD_LIBRARY_PATH?
>>>
>>>                         One thing to check is the Galaxy's .bashrc file
>>>                         - make sure it isn't
>>>                         resetting LD_LIBRARY_PATH somehow.
>>>
>>>                         -John
>>>
>>>                         On Fri, Jan 23, 2015 at 9:34 PM, Nikhil Joshi
>>>                         <najo...@ucdavis.edu
>>>                         <mailto:najo...@ucdavis.edu>> wrote:
>>>                          > Hi all,
>>>                          >
>>>                          > So we have forked the stable branch of galaxy
>>>                         and are making our own
>>>                          > modifications. We are running galaxy on
>>>                         Ubuntu 14.04.1 LTS and we're using
>>>                          > modules to load the underlying software, i.e.
>>>                         set environment variables.
>>>                          > This works just fine for PATH, JAVA_JAR_PATH,
>>>                         PYTHONPATH, etc., however,
>>>                          > LD_LIBRARY_PATH is not being passed to the
>>>                         tools. When a tool (such as
>>>                          > cuffdiff) tries to access LD_LIBRARY_PATH, it
>>>                         is empty. We've checked to
>>>                          > make sure that loading the cufflinks module
>>>                         correctly updates the
>>>                          > LD_LIBRARY_PATH, however, when it is used in
>>>                         galaxy, all the other
>>>                          > environment variables are set properly, but
>>>                         not LD_LIBRARY_PATH. Does anyone
>>>                          > have any ideas on why this would happen and
>>>                         how to fix it?
>>>                          >
>>>                          > - Nik.
>>>                          >
>>>                          > --
>>>                          > Nikhil Joshi
>>>                          > Bioinformatics Analyst/Programmer
>>>                          > UC Davis Bioinformatics Core
>>>                          > http://bioinformatics.ucdavis.edu/
>>>                          > najoshi -at- ucdavis -dot- edu
>>>                          > 530.752.2698 <tel:530.752.2698> (w)
>>>                          >
>>>                          >
>>>                         ______________________________
>>> _____________________________
>>>                          > Please keep all replies on the list by using
>>>                         "reply all"
>>>                          > in your mail client.  To manage your
>>>                         subscriptions to this
>>>                          > and other Galaxy lists, please use the
>>>                         interface at:
>>>                          > https://lists.galaxyproject.org/
>>>                          >
>>>                          > To search Galaxy mailing lists use the
>>>                         unified search at:
>>>                          > http://galaxyproject.org/search/mailinglists/
>>>
>>>
>>>
>>>
>>>                     --
>>>                     Nikhil Joshi
>>>                     Bioinformatics Analyst/Programmer
>>>                     UC Davis Bioinformatics Core
>>>                     http://bioinformatics.ucdavis.edu/
>>>                     najoshi -at- ucdavis -dot- edu
>>>                     530.752.2698 <tel:530.752.2698> (w)
>>>
>>>
>>>
>>>
>>>                 --
>>>                 Nikhil Joshi
>>>                 Bioinformatics Analyst/Programmer
>>>                 UC Davis Bioinformatics Core
>>>                 http://bioinformatics.ucdavis.edu/
>>>                 najoshi -at- ucdavis -dot- edu
>>>                 530.752.2698 <tel:530.752.2698> (w)
>>>
>>>
>>>
>>>
>>>             --
>>>             Nikhil Joshi
>>>             Bioinformatics Analyst/Programmer
>>>             UC Davis Bioinformatics Core
>>>             http://bioinformatics.ucdavis.edu/
>>>             najoshi -at- ucdavis -dot- edu
>>>             530.752.2698 <tel:530.752.2698> (w)
>>>
>>>             ___________________________________________________________
>>>             Please keep all replies on the list by using "reply all"
>>>             in your mail client.  To manage your subscriptions to this
>>>             and other Galaxy lists, please use the interface at:
>>>             https://lists.galaxyproject.org/
>>>
>>>             To search Galaxy mailing lists use the unified search at:
>>>             http://galaxyproject.org/search/mailinglists/
>>>
>>>
>>>
>>>
>>>
>>>     --
>>>     Nikhil Joshi
>>>     Bioinformatics Analyst/Programmer
>>>     UC Davis Bioinformatics Core
>>>     http://bioinformatics.ucdavis.edu/
>>>     najoshi -at- ucdavis -dot- edu
>>>     530.752.2698 <tel:530.752.2698> (w)
>>>
>>>
>>>
>>>
>>> --
>>> Nikhil Joshi
>>> Bioinformatics Analyst/Programmer
>>> UC Davis Bioinformatics Core
>>> http://bioinformatics.ucdavis.edu/
>>> najoshi -at- ucdavis -dot- edu
>>> 530.752.2698 (w)
>>>
>>>
>>> ___________________________________________________________
>>> Please keep all replies on the list by using "reply all"
>>> in your mail client.  To manage your subscriptions to this
>>> and other Galaxy lists, please use the interface at:
>>>    https://lists.galaxyproject.org/
>>>
>>> To search Galaxy mailing lists use the unified search at:
>>>    http://galaxyproject.org/search/mailinglists/
>>>
>>>
>> ___________________________________________________________
>> Please keep all replies on the list by using "reply all"
>> in your mail client.  To manage your subscriptions to this
>> and other Galaxy lists, please use the interface at:
>>  https://lists.galaxyproject.org/
>>
>> To search Galaxy mailing lists use the unified search at:
>>  http://galaxyproject.org/search/mailinglists/
>>
>
>
>
> --
> Nikhil Joshi
> Bioinformatics Analyst/Programmer
> UC Davis Bioinformatics Core
> http://bioinformatics.ucdavis.edu/
> najoshi -at- ucdavis -dot- edu
> 530.752.2698 (w)
>



-- 
Nikhil Joshi
Bioinformatics Analyst/Programmer
UC Davis Bioinformatics Core
http://bioinformatics.ucdavis.edu/
najoshi -at- ucdavis -dot- edu
530.752.2698 (w)
___________________________________________________________
Please keep all replies on the list by using "reply all"
in your mail client.  To manage your subscriptions to this
and other Galaxy lists, please use the interface at:
  https://lists.galaxyproject.org/

To search Galaxy mailing lists use the unified search at:
  http://galaxyproject.org/search/mailinglists/

Reply via email to