nextflow-io / nextflow

A DSL for data-driven computational pipelines
http://nextflow.io
Apache License 2.0
2.75k stars 629 forks source link

Nextflow does not use the specified containers #2199

Closed Zethson closed 3 years ago

Zethson commented 3 years ago

Bug report

Expected behavior and actual behavior

Whenever I try to run any pipeline (e.g. nf-core ones) with Docker or Singularity it does not use the container to run the pipeline. Hence, all commands of the processes are not found and the pipeline just fails. I can run the containers outside of any Nextflow pipelines without any problems and the commands are found (as expected). Example:

⋊> /tmp nextflow run nf-core/rnaseq -profile test,singularity                                                                                                               (spapros) 14:41:57
N E X T F L O W  ~  version 21.04.1
Launching `nf-core/rnaseq` [evil_hawking] - revision: b3ff92bc54 [master]

------------------------------------------------------
                                        ,--./,-.
        ___     __   __   __   ___     /,-._.--~'
  |\ | |__  __ /  ` /  \ |__) |__         }  {
  | \| |       \__, \__/ |  \ |___     \`-._,-`-,
                                        `._,._,'
  nf-core/rnaseq v3.2
------------------------------------------------------

...

Cannot run program "hostname": error=2, No such file or directory

 -- Check script '/home/zeth/.nextflow/assets/nf-core/rnaseq/main.nf' at line: 35 or see '.nextflow.log' file for more details

Steps to reproduce the problem

nextflow run nf-core/rnaseq -profile test,singularity

Program output

Jul-05 14:45:02.520 [main] DEBUG nextflow.cli.Launcher - $> nextflow run nf-core/rnaseq -profile test,singularity
Jul-05 14:45:02.637 [main] INFO  nextflow.cli.CmdRun - N E X T F L O W  ~  version 21.04.1
Jul-05 14:45:03.854 [main] DEBUG nextflow.scm.AssetManager - Git config: /home/zeth/.nextflow/assets/nf-core/rnaseq/.git/config; branch: master; remote: origin; url: https://github.com/nf-core/rnaseq.git
Jul-05 14:45:03.865 [main] DEBUG nextflow.scm.AssetManager - Git config: /home/zeth/.nextflow/assets/nf-core/rnaseq/.git/config; branch: master; remote: origin; url: https://github.com/nf-core/rnaseq.git
Jul-05 14:45:03.964 [main] INFO  nextflow.cli.CmdRun - Launching `nf-core/rnaseq` [extravagant_laplace] - revision: b3ff92bc54 [master]
Jul-05 14:45:04.639 [main] DEBUG nextflow.config.ConfigBuilder - Found config base: /home/zeth/.nextflow/assets/nf-core/rnaseq/nextflow.config
Jul-05 14:45:04.640 [main] DEBUG nextflow.config.ConfigBuilder - Parsing config file: /home/zeth/.nextflow/assets/nf-core/rnaseq/nextflow.config
Jul-05 14:45:04.647 [main] DEBUG nextflow.config.ConfigBuilder - Applying config profile: `test,singularity`
Jul-05 14:45:05.150 [main] INFO  org.pf4j.DefaultPluginStatusProvider - Enabled plugins: []
Jul-05 14:45:05.151 [main] INFO  org.pf4j.DefaultPluginStatusProvider - Disabled plugins: []
Jul-05 14:45:05.154 [main] INFO  org.pf4j.DefaultPluginManager - PF4J version 3.4.1 in 'deployment' mode
Jul-05 14:45:05.888 [main] DEBUG nextflow.config.ConfigBuilder - Available config profiles: [cfc_dev, ifb_core, denbi_qbic, genotoul, uppmax, abims, imperial_mb, oist, mpcdf, podman, czbiohub_aws, jax, ccga_med, test, google, kraken, seg_globe, shh, sanger, pasteur, test_full, eddie, bi, bigpurple, docker, gis, eva, utd_ganymede, charliecloud, conda, singularity, icr_davros, munin, prince, hebbe, cfc, utd_sysbio, uzh, debug, genouest, cbe, ebc, ccga_dx, crick, phoenix, biohpc_gen, shifter, awsbatch, uct_hpc, imperial, aws_tower, binac]
Jul-05 14:45:05.900 [main] DEBUG nextflow.plugin.PluginsFacade - Setting up plugin manager > mode=prod; plugins-dir=/home/zeth/.nextflow/plugins
Jul-05 14:45:05.902 [main] DEBUG nextflow.plugin.PluginsFacade - Plugins default=[]
Jul-05 14:45:05.902 [main] DEBUG nextflow.plugin.PluginsFacade - Plugins local root: .nextflow/plr/empty
Jul-05 14:45:05.905 [main] INFO  org.pf4j.DefaultPluginStatusProvider - Enabled plugins: []
Jul-05 14:45:05.906 [main] INFO  org.pf4j.DefaultPluginStatusProvider - Disabled plugins: []
Jul-05 14:45:05.907 [main] INFO  org.pf4j.DefaultPluginManager - PF4J version 3.4.1 in 'deployment' mode
Jul-05 14:45:05.915 [main] INFO  org.pf4j.AbstractPluginManager - No plugins
Jul-05 14:45:05.961 [main] DEBUG nextflow.Session - Session uuid: 3fd8611a-7f82-4afa-9572-d9ab6659873c
Jul-05 14:45:05.961 [main] DEBUG nextflow.Session - Run name: extravagant_laplace
Jul-05 14:45:05.961 [main] DEBUG nextflow.Session - Executor pool size: 8
Jul-05 14:45:05.971 [main] DEBUG nextflow.cli.CmdRun - 
  Version: 21.04.1 build 5556
  Created: 14-05-2021 15:20 UTC (17:20 CEST)
  System: Linux 5.12.14-arch1-1
  Runtime: Groovy 3.0.7 on OpenJDK 64-Bit Server VM 1.8.0_152-release-1056-b12
  Encoding: UTF-8 (ANSI_X3.4-1968)
  Process: 482309@master [192.168.0.49]
  CPUs: 8 - Mem: 15.3 GB (256.3 MB) - Swap: 12 GB (12 GB)
Jul-05 14:45:05.984 [main] DEBUG nextflow.Session - Work-dir: /tmp/work [tmpfs]
Jul-05 14:45:05.998 [main] DEBUG nextflow.executor.ExecutorFactory - Extension executors providers=[]
Jul-05 14:45:06.010 [main] DEBUG nextflow.Session - Observer factory: DefaultObserverFactory
Jul-05 14:45:06.412 [main] DEBUG nextflow.Session - Session start invoked
Jul-05 14:45:06.415 [main] DEBUG nextflow.trace.TraceFileObserver - Flow starting -- trace file: /tmp/results/pipeline_info/execution_trace_2021-07-05_14-45-05.txt
Jul-05 14:45:06.423 [main] DEBUG nextflow.Session - Using default localLib path: /home/zeth/.nextflow/assets/nf-core/rnaseq/lib
Jul-05 14:45:06.427 [main] DEBUG nextflow.Session - Adding to the classpath library: /home/zeth/.nextflow/assets/nf-core/rnaseq/lib
Jul-05 14:45:06.427 [main] DEBUG nextflow.Session - Adding to the classpath library: /home/zeth/.nextflow/assets/nf-core/rnaseq/lib/nfcore_external_java_deps.jar
Jul-05 14:45:07.394 [main] DEBUG nextflow.script.ScriptRunner - > Launching execution
Jul-05 14:45:07.658 [main] INFO  nextflow.Nextflow - 

------------------------------------------------------
                                        ,--./,-.
        ___     __   __   __   ___     /,-._.--~'
  |\ | |__  __ /  ` /  \ |__) |__         }  {
  | \| |       \__, \__/ |  \ |___     \`-._,-`-,
                                        `._,._,'
  nf-core/rnaseq v3.2
------------------------------------------------------
Core Nextflow options
  revision                  : master
  runName                   : extravagant_laplace
  containerEngine           : singularity
  launchDir                 : /tmp
  workDir                   : /tmp/work
  projectDir                : /home/zeth/.nextflow/assets/nf-core/rnaseq
  userName                  : zeth
  profile                   : test,singularity
  configFiles               : /home/zeth/.nextflow/assets/nf-core/rnaseq/nextflow.config

Input/output options
  input                     : https://raw.githubusercontent.com/nf-core/test-datasets/rnaseq/samplesheet/v3.1/samplesheet_test.csv

UMI options
  umitools_bc_pattern       : NNNN

Reference genome options
  fasta                     : https://github.com/nf-core/test-datasets/raw/rnaseq/reference/genome.fa
  gtf                       : https://github.com/nf-core/test-datasets/raw/rnaseq/reference/genes.gtf.gz
  gff                       : https://github.com/nf-core/test-datasets/raw/rnaseq/reference/genes.gff.gz
  transcript_fasta          : https://github.com/nf-core/test-datasets/raw/rnaseq/reference/transcriptome.fasta
  additional_fasta          : https://github.com/nf-core/test-datasets/raw/rnaseq/reference/gfp.fa.gz
  star_index                : https://github.com/nf-core/test-datasets/raw/rnaseq/reference/star.tar.gz
  hisat2_index              : https://github.com/nf-core/test-datasets/raw/rnaseq/reference/hisat2.tar.gz
  rsem_index                : https://github.com/nf-core/test-datasets/raw/rnaseq/reference/rsem.tar.gz
  salmon_index              : https://github.com/nf-core/test-datasets/raw/rnaseq/reference/salmon.tar.gz

Alignment options
  pseudo_aligner            : salmon

Institutional config options
  config_profile_name       : Test profile
  config_profile_description: Minimal test dataset to check pipeline function

Max job request options
  max_cpus                  : 2
  max_memory                : 6 GB
  max_time                  : 6h

!! Only displaying parameters that differ from the pipeline defaults !!
------------------------------------------------------
If you use nf-core/rnaseq for your analysis please cite:

* The pipeline
  https://doi.org/10.5281/zenodo.1400710

* The nf-core framework
  https://doi.org/10.1038/s41587-020-0439-x

* Software dependencies
  https://github.com/nf-core/rnaseq/blob/master/CITATIONS.md
------------------------------------------------------
Jul-05 14:45:07.662 [main] DEBUG nextflow.Session - Session aborted -- Cause: Cannot run program "hostname": error=2, No such file or directory
Jul-05 14:45:07.672 [main] ERROR nextflow.cli.Launcher - Cannot run program "hostname": error=2, No such file or directory
java.io.IOException: Cannot run program "hostname": error=2, No such file or directory
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
    at java.lang.Runtime.exec(Runtime.java:620)
    at java.lang.Runtime.exec(Runtime.java:450)
    at java.lang.Runtime.exec(Runtime.java:347)
    at org.codehaus.groovy.runtime.ProcessGroovyMethods.execute(ProcessGroovyMethods.java:538)
    at org.codehaus.groovy.runtime.dgm$966.invoke(Unknown Source)
    at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:247)
    at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:56)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:130)
    at NfcoreTemplate.hostName(NfcoreTemplate.groovy:27)
    at NfcoreTemplate$hostName$3.call(Unknown Source)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:157)
    at WorkflowMain.initialise(WorkflowMain.groovy:72)
    at WorkflowMain$initialise$0.call(Unknown Source)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:157)
    at Script_4c643811.runScript(Script_4c643811:35)
    at nextflow.script.BaseScript.runDsl2(BaseScript.groovy:170)
    at nextflow.script.BaseScript.run(BaseScript.groovy:200)
    at nextflow.script.ScriptParser.runScript(ScriptParser.groovy:221)
    at nextflow.script.ScriptRunner.run(ScriptRunner.groovy:212)
    at nextflow.script.ScriptRunner.execute(ScriptRunner.groovy:120)
    at nextflow.cli.CmdRun.run(CmdRun.groovy:302)
    at nextflow.cli.Launcher.run(Launcher.groovy:475)
    at nextflow.cli.Launcher.main(Launcher.groovy:657)
Caused by: java.io.IOException: error=2, No such file or directory
    at java.lang.UNIXProcess.forkAndExec(Native Method)
    at java.lang.UNIXProcess.<init>(UNIXProcess.java:247)
    at java.lang.ProcessImpl.start(ProcessImpl.java:134)
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
    ... 29 common frames omitted

Environment

Additional context

Running pipelines with Conda works, but containers (Docker, Singularity) do not. Again, my container setup looks fine to me because I can run the containers interactively without any issues.

pditommaso commented 3 years ago

If you look the error stack trace, the problem arise on NfcoreTemplate script

    at NfcoreTemplate.hostName(NfcoreTemplate.groovy:27)
Zethson commented 3 years ago

Interesting. I'll check it out next week. Thanks Paolo! Saturday, 17 July 2021, 05:52PM +02:00 from Paolo Di Tommaso @.*** :

If you look the error stack trace, the problem arise on NfcoreTemplate script at NfcoreTemplate.hostName(NfcoreTemplate.groovy:27)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub , or unsubscribe .