seqeralabs / nf-tower

Nextflow Tower system
https://tower.nf
Mozilla Public License 2.0
144 stars 51 forks source link

vib-singlecell-nf /vsn-pipelines not runing when -with-tower is specified. #248

Closed dmorais closed 3 years ago

dmorais commented 4 years ago

When I try to run vib-singlecell-nf /vsn-pipelines example ( the single-sample) configured to use singularity I get this error

_Invalid method doCall invocation with arguments: on closure15 type

The pipeline without the -with-tower works just fine, but when I add this argument it throws an error. I also tried to add a block of code inside the config, as suggested in the tower documentation, but I get the same error.

Below is the Stack trace

Sep-24 16:44:35.816 [main] DEBUG nextflow.cli.Launcher - $> nextflow -C single_sample.config run vib-singlecell-nf/vsn-pipelines -entry single_sample -with-tower 'http://localhost:8000/api'
Sep-24 16:44:35.912 [main] INFO  nextflow.cli.CmdRun - N E X T F L O W  ~  version 20.04.1
Sep-24 16:44:36.694 [main] DEBUG nextflow.scm.AssetManager - Git config: /home/dmorais/.nextflow/assets/vib-singlecell-nf/vsn-pipelines/.git/config; branch: master; remote
: origin; url: https://github.com/vib-singlecell-nf/vsn-pipelines.git
Sep-24 16:44:36.795 [main] DEBUG nextflow.scm.AssetManager - Git config: /home/dmorais/.nextflow/assets/vib-singlecell-nf/vsn-pipelines/.git/config; branch: master; remote
: origin; url: https://github.com/vib-singlecell-nf/vsn-pipelines.git
Sep-24 16:44:37.307 [main] DEBUG nextflow.scm.AssetManager - Update submodules [src/cellranger, src/cellranger-atac, src/dropletutils, src/dropseqtools, src/edirect, src/f
astp, src/flybaser, src/harmony, src/pcacv, src/picard, src/popscle, src/scanpy, src/scenic, src/scrublet, src/sratoolkit, src/star]
Sep-24 16:44:37.314 [main] DEBUG nextflow.scm.AssetManager - Git config: /home/dmorais/.nextflow/assets/vib-singlecell-nf/vsn-pipelines/.git/config; branch: master; remote
: origin; url: https://github.com/vib-singlecell-nf/vsn-pipelines.git
Sep-24 16:44:37.315 [main] INFO  nextflow.cli.CmdRun - Launching `vib-singlecell-nf/vsn-pipelines` [intergalactic_archimedes] - revision: 2b0380ce8b [master]
Sep-24 16:44:37.948 [main] DEBUG nextflow.config.ConfigBuilder - Parsing config file: /home/dmorais/projects/nextflow/vib-singlecell/single_sample.config
Sep-24 16:44:37.956 [main] DEBUG nextflow.config.ConfigBuilder - Applying config profile: standard
Sep-24 16:44:38.194 [main] DEBUG nextflow.Session - Session uuid: 10c0d3e2-6e01-41ec-8733-86b32cb765ed
Sep-24 16:44:38.194 [main] DEBUG nextflow.Session - Run name: intergalactic_archimedes
Sep-24 16:44:38.195 [main] DEBUG nextflow.Session - Executor pool size: 16
Sep-24 16:44:38.203 [main] DEBUG nextflow.config.ConfigBuilder - Parsing config file: /home/dmorais/projects/nextflow/vib-singlecell/single_sample.config
Sep-24 16:44:38.204 [main] DEBUG nextflow.config.ConfigBuilder - Applying config profile: `standard`
Sep-24 16:44:38.346 [main] DEBUG nextflow.cli.CmdRun -
  Version: 20.04.1 build 5335
  Created: 03-05-2020 19:37 UTC
  System: Linux 3.10.0-1062.9.1.el7.x86_64
  Runtime: Groovy 2.5.8 on Java HotSpot(TM) 64-Bit Server VM 1.8.0_192-b12
  Encoding: UTF-8 (UTF-8)
  Process: 644@localhost null
  CPUs: 16 - Mem: 176.9 GB (46.7 GB) - Swap: 0 (0)
Sep-24 16:44:38.376 [main] DEBUG nextflow.Session - Work-dir: /home/dmorais/projects/nextflow/vib-singlecell/work [nfs]
Sep-24 16:44:38.376 [main] DEBUG nextflow.Session - Script base path does not exist or is not a directory: /home/dmorais/.nextflow/assets/vib-singlecell-nf/vsn-pipelines/bin
Sep-24 16:44:38.423 [main] DEBUG nextflow.Session - Observer factory: TowerFactory
Sep-24 16:44:38.441 [main] DEBUG nextflow.Session - Observer factory: DefaultObserverFactory
Sep-24 16:44:38.621 [main] DEBUG nextflow.Session - Session start invoked
Sep-24 16:44:38.628 [main] DEBUG io.seqera.tower.plugin.TowerClient - Creating Tower observer -- endpoint=http://localhost:8000/api; requestInterval=1s; aliveInterval=1m;
maxRetries=5; backOffBase=3; backOffDelay=250
Sep-24 16:44:39.492 [main] DEBUG nextflow.trace.TraceFileObserver - Flow starting -- trace file: /home/dmorais/projects/nextflow/vib-singlecell/out/nextflow_reports/execut
ion_trace.txt
Sep-24 16:44:39.949 [main] WARN  nextflow.NextflowMeta$Preview - DSL 2 IS AN EXPERIMENTAL FEATURE UNDER DEVELOPMENT -- SYNTAX MAY CHANGE IN FUTURE RELEASE
Sep-24 16:44:39.953 [main] DEBUG nextflow.script.ScriptRunner - > Launching execution
Sep-24 16:44:41.026 [main] DEBUG nextflow.Session - Workflow process names [dsl2]: SC__FILE_CONVERTER_HELP, COMPRESS_HDF5, SC__PUBLISH_PROXY, SC__FILE_CONCATENATOR, SC__PU
BLISH, SC__STAR_CONCATENATOR, SC__H5AD_CLEAN, SC__FILE_CONVERTER, SC__H5AD_UPDATE_X_PCA
Sep-24 16:44:47.266 [main] DEBUG nextflow.executor.ExecutorFactory - << taskConfig executor: local
Sep-24 16:44:47.267 [main] DEBUG nextflow.executor.ExecutorFactory - >> processorType: 'local'
Sep-24 16:44:47.271 [main] DEBUG nextflow.executor.Executor - [warm up] executor > local
Sep-24 16:44:47.276 [main] DEBUG n.processor.LocalPollingMonitor - Creating local task monitor for executor 'local' > cpus=16; memory=176.9 GB; capacity=16; pollInterval=1
00ms; dumpInterval=5m
Sep-24 16:44:47.346 [main] DEBUG nextflow.executor.ExecutorFactory - << taskConfig executor: local
Sep-24 16:44:47.346 [main] DEBUG nextflow.executor.ExecutorFactory - >> processorType: 'local'
Sep-24 16:44:47.350 [main] DEBUG nextflow.executor.ExecutorFactory - << taskConfig executor: local
Sep-24 16:44:47.350 [main] DEBUG nextflow.executor.ExecutorFactory - >> processorType: 'local'
Sep-24 16:44:47.355 [main] DEBUG nextflow.executor.ExecutorFactory - << taskConfig executor: local
Sep-24 16:44:47.355 [main] DEBUG nextflow.executor.ExecutorFactory - >> processorType: 'local'
Sep-24 16:44:47.387 [main] DEBUG nextflow.executor.ExecutorFactory - << taskConfig executor: local
Sep-24 16:44:47.387 [main] DEBUG nextflow.executor.ExecutorFactory - >> processorType: 'local'
...
Sep-24 16:44:47.634 [main] DEBUG nextflow.Session - Session aborted -- Cause: No signature of method: _nf_config_eba22b16$_run_closure2$_closure15.doCall() is applicable for argument types: () values: []
Possible solutions: doCall(java.lang.Object, java.lang.Object, java.lang.Object), isCase(java.lang.Object), isCase(java.lang.Object), findAll(), findAll(), findAll(groovy.
lang.Closure)
Sep-24 16:44:47.660 [main] DEBUG nextflow.Session - The following nodes are still active:
  [operator] view
  [operator] map
  [operator] map
  [operator] concat
  [operator] view
  [operator] ifEmpty
...
 [operator] map

Sep-24 16:44:47.678 [main] ERROR nextflow.cli.Launcher - @unknown
groovy.lang.MissingMethodException: No signature of method: _nf_config_eba22b16$_run_closure2$_closure15.doCall() is applicable for argument types: () values: []
Possible solutions: doCall(java.lang.Object, java.lang.Object, java.lang.Object), isCase(java.lang.Object), isCase(java.lang.Object), findAll(), findAll(), findAll(groovy.
lang.Closure)
    at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:255)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1041)
    at groovy.lang.Closure.call(Closure.java:405)
    at groovy.lang.Closure.call(Closure.java:399)
    at groovy.json.JsonDelegate.cloneDelegateAndGetContent(JsonDelegate.java:89)
    at groovy.json.DefaultJsonGenerator.writeObject(DefaultJsonGenerator.java:214)
    at io.seqera.tower.plugin.TowerJsonGenerator.writeObject(TowerJsonGenerator.groovy:78)
    at groovy.json.DefaultJsonGenerator.writeMapEntry(DefaultJsonGenerator.java:387)
    at groovy.json.DefaultJsonGenerator.writeMap(DefaultJsonGenerator.java:375)
    at groovy.json.DefaultJsonGenerator.writeObject(DefaultJsonGenerator.java:200)
    at io.seqera.tower.plugin.TowerJsonGenerator.writeObject(TowerJsonGenerator.groovy:78)
    at groovy.json.DefaultJsonGenerator.writeMapEntry(DefaultJsonGenerator.java:387)
    at groovy.json.DefaultJsonGenerator.writeMap(DefaultJsonGenerator.java:375)
    at groovy.json.DefaultJsonGenerator.writeObject(DefaultJsonGenerator.java:200)
    at io.seqera.tower.plugin.TowerJsonGenerator.writeObject(TowerJsonGenerator.groovy:78)
    at groovy.json.DefaultJsonGenerator.writeMapEntry(DefaultJsonGenerator.java:387)
    at groovy.json.DefaultJsonGenerator.writeMap(DefaultJsonGenerator.java:375)
    at groovy.json.DefaultJsonGenerator.writeObject(DefaultJsonGenerator.java:200)
    at io.seqera.tower.plugin.TowerJsonGenerator.writeObject(TowerJsonGenerator.groovy:78)
    at groovy.json.DefaultJsonGenerator.writeObject(DefaultJsonGenerator.java:164)
    at groovy.json.DefaultJsonGenerator.toJson(DefaultJsonGenerator.java:98)
    at io.seqera.tower.plugin.TowerClient.sendHttpMessage(TowerClient.groovy:382)
    at io.seqera.tower.plugin.TowerClient.onFlowBegin(TowerClient.groovy:267)
    at nextflow.Session$_notifyFlowBegin_closure20.doCall(Session.groovy:998)
    at nextflow.Session$_notifyFlowBegin_closure20.call(Session.groovy)
    at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2330)
    at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2315)
    at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2356)
    at nextflow.Session.notifyFlowBegin(Session.groovy:998)
    at nextflow.Session.fireDataflowNetwork(Session.groovy:434)
    at nextflow.script.ScriptRunner.run(ScriptRunner.groovy:222)
    at nextflow.script.ScriptRunner.execute(ScriptRunner.groovy:126)
    at nextflow.cli.CmdRun.run(CmdRun.groovy:273)
    at nextflow.cli.Launcher.run(Launcher.groovy:460)
    at nextflow.cli.Launcher.main(Launcher.groovy:642)
Sep-24 16:44:47.679 [Actor Thread 6] DEBUG nextflow.Nextflow - Ignore exit because execution is already aborted -- message=Pipeline cannot run: no data provided.
pditommaso commented 4 years ago

This looks something odd, in the metadata generated by the pipeline (a misplaced closure in a tag directive?).

dweemx commented 4 years ago

Hi @dmorais , How does your config look like ?

dmorais commented 4 years ago

@dweemx That's what the config looks like. Basically the config of the example ran with the code below. The only change was on the singularity mounting point line ( I had to replace ',' by ":"

nextflow config vib-singlecell-nf/vsn-pipelines \ -profile tenx,singularity,single_sample > single_sample.config

manifest {
   name = 'vib-singlecell-nf/vsn-pipelines'
   description = 'A repository of pipelines for single-cell data in Nextflow DSL2'
   homePage = 'https://github.com/vib-singlecell-nf/vsn-pipelines'
   version = '0.19.0'
   mainScript = 'main.nf'
   defaultBranch = 'master'
   nextflowVersion = '!20.04.1'
}

params {
   global {
      project_name = '10x_PBMC'
      outdir = 'out'
      qsubaccount = ''
      qsubemail = ''
   }
   misc {
      test {
         enabled = false
      }
   }
   sc {
      scanpy {
         container = 'vibsinglecellnf/scanpy:0.5.0'
         report {
            annotations_to_plot = []
         }
         feature_selection {
            report_ipynb = '/src/scanpy/bin/reports/sc_select_variable_genes_report.ipynb'
            method = 'mean_disp_plot'
            minMean = 0.0125
            maxMean = 3
            minDisp = 0.5
            off = 'h5ad'
         }
         feature_scaling {
            method = 'zscore_scale'
            maxSD = 10
            off = 'h5ad'
         }
         neighborhood_graph {
            nPcs = 50
            off = 'h5ad'
         }
         dim_reduction {
            report_ipynb = '/src/scanpy/bin/reports/sc_dim_reduction_report.ipynb'
            pca {
               method = 'pca'
               nComps = 50
               off = 'h5ad'
            }
            umap {
               method = 'umap'
               off = 'h5ad'
            }
            tsne {
               method = 'tsne'
               nJobs = 10
               off = 'h5ad'
            }
         }
         clustering {
            report_ipynb = '/src/scanpy/bin/reports/sc_clustering_report.ipynb'
            method = 'louvain'
            resolution = 0.8
            off = 'h5ad'
         }
         marker_genes {
            method = 'wilcoxon'
            ngenes = 0
            groupby = 'louvain'
            off = 'h5ad'
         }
         filter {
            report_ipynb = '/src/scanpy/bin/reports/sc_filter_qc_report.ipynb'
            cellFilterMinNGenes = 200
            cellFilterMaxNGenes = 4000
            cellFilterMaxPercentMito = 0.15
            geneFilterMinNCells = 3
            off = 'h5ad'
            outdir = 'out'
         }
data_transformation {
            method = 'log1p'
            off = 'h5ad'
         }
         normalization {
            method = 'cpx'
            countsPerCellAfter = 10000
            off = 'h5ad'
         }
      }
      scope {
         genome = ''
         tree {
            level_1 = ''
            level_2 = ''
            level_3 = ''
         }
      }
      file_converter {
         tagCellWithSampleId = true
         useFilteredMatrix = true
         makeVarIndexUnique = false
      }
   }
   data {
      tenx {
         cellranger_mex = 'single_sample/data/10x/1k_pbmc/1k_pbmc_v2_chemistry/outs/'
      }
   }
   utils {
      container = 'vibsinglecellnf/utils:0.3.0'
      workflow_configuration {
         report_ipynb = '/src/utils/bin/reports/workflow_configuration_template.ipynb'
      }
publish {
         compressionLevel = 6
      }
   }
   parseConfig = { sample, paramsGlobal, paramsLocal ->
         def lv = { a,b -> return org.codehaus.groovy.runtime.MethodRankHelper.delDistance(a, b) }
         def pL = paramsLocal.collectEntries { k,v ->
            if (v instanceof Map) {
               if (v.containsKey(sample))
                  return [k, v[sample]]
               if (v.containsKey('default'))
                  return [k, v['default']]
               def closeMatches = v.collectEntries { vk, vv -> [lv(vk, sample), vk] }.keySet().findAll { it < 30}
               if(closeMatches.size() > 0)
                  throw new Exception("The sample " + sample + " is not found in " + v +" ; Make sure your samples are correctly specified when using the multi-sample feature.")
               else
                  return [k,v]
            } else {
               return [k,v]
         }
      }
      return [global: paramsGlobal, local: pL]
   }
}
process {
   executor = 'local'
   withLabel:qsub {
      executor = 'pbs'
   }
   withLabel:local {
      executor = 'local'
   }
}

timeline {
   enabled = true
   file = 'out/nextflow_reports/execution_timeline.html'
}

report {
   enabled = true
   file = 'out/nextflow_reports/execution_report.html'
}

trace {
   enabled = true
   file = 'out/nextflow_reports/execution_trace.txt'
}

dag {
   enabled = true
   file = 'out/nextflow_reports/pipeline_dag.svg'
}

min {
   enabled = false
}

singularity {
   enabled = true
   autoMounts = true
   runOptions = '-B /home/dmorais/projects/nextflow/vib-singlecell/stg_00002/:/staging/leuven/stg_00002/'
}
dweemx commented 4 years ago

@dmorais , We were able to reproduce your error. We have probably nailed down the issue: we are using a closure in the config. @pditommaso can you confirm that this could cause the problem ? It's been a while we are using this and it's working fine with Nextflow but Nf Tower doesn't seem to like somwhow. Is this something possible to fix ?

dmorais commented 4 years ago

@dweemx Thanks. Hopefully, the fix won't be too hard. I appreciate your help.

Thanks @pditommaso for looking into it as well.

pditommaso commented 3 years ago

Hard to say what's wrong in your config, but as of nextflow 20.09.1-edge it reports a warning instead of crashing. It may help to identify the problem.

Closing this issue.