Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nextflow conda launcher can pick the wrong java version #58

Open
cement-head opened this issue Oct 31, 2022 · 5 comments
Open

nextflow conda launcher can pick the wrong java version #58

cement-head opened this issue Oct 31, 2022 · 5 comments

Comments

@cement-head
Copy link

After install, I get this:

(/home/cbfgws6/Programs/nextflow/env/polishCLR_env) cbfgws6@trinity:~/Programs/nextflow$ nextflow run isugifNF/polishCLR -r main --check_software
/home/cbfgws6/Programs/nextflow/env/polishCLR_env/lib/jvm/bin/java: symbol lookup error: /home/cbfgws6/Programs/nextflow/env/polishCLR_env/lib/jvm/bin/java: undefined symbol: JLI_StringDup
NOTE: Nextflow is trying to use the Java VM defined by the following environment variables:
 JAVA_CMD: /home/cbfgws6/Programs/nextflow/env/polishCLR_env/lib/jvm/bin/java
 NXF_OPTS:

Yet, openjdk 11 is installed in the conda environment.

How do I fix this?

@j23414
Copy link
Contributor

j23414 commented Oct 31, 2022

Thanks for the message! Could you run the following to see if it returns the same error?

nextflow -version

I have a suspicion that it's related to this issue: nextflow (conda) launcher didn't pick java executable correctly.

Can also try running JAVA_CMD

/home/cbfgws6/Programs/nextflow/env/polishCLR_env/lib/jvm/bin/java --version

It's possible the above symlink needs to be replaced with the openjdk 11 version but we'd have to find where the openjdk-11 bin folder is in the system/conda.

@cement-head
Copy link
Author

cement-head commented Nov 1, 2022

Okay, here you go:

$ nextflow -version

      N E X T F L O W
      version 22.10.1 build 5828
      created 27-10-2022 16:58 UTC (12:58 EDT)
      cite doi:10.1038/nbt.3820
      http://nextflow.io

But, there's something wierd here...polishCLR doesn't seem to be in an actual conda environment. I followed the installation instructions and now I get this error:


$ conda activate env/polishCLR_env

EnvironmentLocationNotFound: Not a conda environment: /home/cbfgws6/env/polishCLR_env
$ conda info --envs
# conda environments:
#
                         /home/cbfgws6/Programs/nextflow/env/polishCLR_env
base                     /home/cbfgws6/miniconda3
haslr                    /home/cbfgws6/miniconda3/envs/haslr
masurca                  /home/cbfgws6/miniconda3/envs/masurca
pb                       /home/cbfgws6/miniconda3/envs/pb
quast                    /home/cbfgws6/miniconda3/envs/quast
seqkit                   /home/cbfgws6/miniconda3/envs/seqkit
tgs-gapcloser            /home/cbfgws6/miniconda3/envs/tgs-gapcloser

What's going on?

@j23414
Copy link
Contributor

j23414 commented Nov 1, 2022

Ah I see what's happening, the polishCLR_env on your system would need to be activated using:

conda activate /home/cbfgws6/Programs/nextflow/env/polishCLR_env

But could you run a which java before and after the above command? Because it seems like your native nextflow -version was working but JAVA_CMD might be reset after activation.

Some Background

On HPC, we're usually placing the polishCLR_env in a shared project folder such that collaborators can reuse the same conda environment (-p ${PWD}/env/polishCLR_env) and submit their own slurm jobs. Otherwise, if we install polishCLR_env using the default install location:

/home/cbfgws6/miniconda3/envs//polishCLR_env

Only the person who installed the environment cbfgws6 can access and activate the conda environment.

Side Note: Creating a regular conda environment would be:

conda env create -f environment.yml

And then conda activate polishCLR_env will work. I'll need to think through how to write better documentation about creating/activating the polishCLR_env environment.

@cement-head
Copy link
Author

cement-head commented Nov 2, 2022

$ conda activate polishCLR_env
(polishCLR_env) cbfgws6@trinity:~/Programs/nextflow$ nextflow -version
/home/cbfgws6/miniconda3/envs/polishCLR_env/lib/jvm/bin/java: symbol lookup error: /home/cbfgws6/miniconda3/envs/polishCLR_env/lib/jvm/bin/java: undefined symbol: JLI_StringDup
NOTE: Nextflow is trying to use the Java VM defined by the following environment variables:
 JAVA_CMD: /home/cbfgws6/miniconda3/envs/polishCLR_env/lib/jvm/bin/java
 NXF_OPTS:

cbfgws6@trinity:~$ which java
/usr/bin/java
cbfgws6@trinity:~$ conda activate polishCLR_env
(polishCLR_env) cbfgws6@trinity:~$ which java
/home/cbfgws6/miniconda3/envs/polishCLR_env/bin/java
(polishCLR_env) cbfgws6@trinity:~$

@j23414
Copy link
Contributor

j23414 commented Dec 19, 2022

Since this seems to be an ongoing issue with Nextflow & conda and I am not a maintainer of Nextflow.

I highly recommend trying the docker or singularity methods instead.

@j23414 j23414 changed the title nextflow/polishCLR fails to install properly nextflow conda launcher can pick the wrong java version Dec 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants