Does anyone have any suggestions to on how to trac...
# help
j
Does anyone have any suggestions to on how to track down the cause of a ConcurrentModificationException error within a process?
Copy code
ERROR ~ Error executing process > 'NFCORE_CREATETAXDB:CREATETAXDB:PREPROCESSING:FIND_CONCATENATE_DNA (1)'

Caused by:
  java.util.ConcurrentModificationException
ohno2 1
e
Any chance the output file name from meta is same with something that already exists?
Even across processes, if they try to publish the same named file
j
What do you mean by 'output file from meta'?
e
if prefix is just the meta.id: 1. and it is either similar to a file which is getting concatenated (I think the module would capture this case and throw an error though) or: 2. and it is same between processed (probably the find/concat ones), find_concat will try to publish the same file in publishdir (if enabled).
That's what I would check, seeing
concurrent
j
I don't think ti's publshing issue
As the erorrmessage is just as the process is initating
rather than when the process is actually running
m
I had that once, but I was doing meta programming with classes. Are you doing that ( adding methods to existing classes)?
j
No I don't think so 😕
Just straight channel manuapulation
Unless we are doing it domething badly...
m
Do all your variables in a closure that's not an input, have
def
before them?
j
Ah...
If we are looking in the module itself...
m
I don't think it's that, but try putting
def
in front of those
👍 1
j
Yeah I don't see anything offensive in there but I will try
m
I think it's outside a process personally
j
Yeah I think so, which is why I need help 😅
I don't know where to start
m
j
I need to do another pass, but initially I did not see that
However we get the same issue occasioanlly on GHA (when it's not resumed)
And doesn't the linter check for that nowadays 🤔
m
Any idea when it started occurring? Can maybe track it down to some commits
j
It was happening occasionally on GHA post first release
But now while I'm adding something new (but much further at the end of the pipeline, and when resuming) it's happening much more often
Which is not very satisfying 😅
m
I know the pain. I was fighting with that same situation for months.
j
for MONTHs!?
ohno2
m
Nobody else with the expertise to find it. Eventually Ben looked over the stack trace and gave a hint that let me find it
j
Ok 😅
m
Is there a Stack trace?
j
Copy code
Nov-07 14:18:47.447 [Actor Thread 22] ERROR nextflow.processor.TaskProcessor - Error executing process > 'NFCORE_CREATETAXDB:CREATETAXDB:PREPROCESSING:FIND_CONCATENATE_DNA (1)'

Caused by:
  java.util.ConcurrentModificationException


java.util.ConcurrentModificationException: null
        at java.base/java.util.ArrayList$Itr.checkForComodification(ArrayList.java:1013)
        at java.base/java.util.ArrayList$Itr.next(ArrayList.java:967)
        at nextflow.processor.TaskProcessor.normalizeInputToFiles(TaskProcessor.groovy:1944)
        at org.codehaus.groovy.vmplugin.v8.IndyInterface.selectMethod(IndyInterface.java:355)
        at org.codehaus.groovy.vmplugin.v8.IndyInterface.fromCache(IndyInterface.java:321)
        at nextflow.processor.TaskProcessor.makeTaskContextStage2(TaskProcessor.groovy:2161)
        at org.codehaus.groovy.vmplugin.v8.IndyInterface.fromCache(IndyInterface.java:321)
        at nextflow.processor.TaskProcessor.invokeTask(TaskProcessor.groovy:639)
        at nextflow.processor.InvokeTaskAdapter.call(InvokeTaskAdapter.groovy:52)
        at groovyx.gpars.dataflow.operator.DataflowOperatorActor.startTask(DataflowOperatorActor.java:120)
        at groovyx.gpars.dataflow.operator.ForkingDataflowOperatorActor.access$001(ForkingDataflowOperatorActor.java:35)
        at groovyx.gpars.dataflow.operator.ForkingDataflowOperatorActor$1.run(ForkingDataflowOperatorActor.java:58)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
        at java.base/java.lang.Thread.run(Thread.java:840)
But I didn't think it was very informative with the
null
m
What's the best way for me to generate the error?
j
You run the test profile a few times until it happens. You can also try to break a process somewhere and then resume
It is happening to me more locally when resuming
Currently when it breaks in the final TAR process near the end of the main script
(currently on the move and giving lecture in 10m, of my instructions don't help I can get and make better instructions then)
Later*
m
I haven't been able to generate the error locally. MultiQC is crashing with a segmetation fault though. Other avenues of investigation are not turning up anything either yet
j
OK let me push my branch
Taht is broken and messy atm
So if you can clone/switch to this branch: https://github.com/nf-core/createtaxdb/tree/kraken2-link-fix
And i am running:
Copy code
bash
nextflow run ../main.nf -profile test,docker --outdir ./results --dbname foo --build_bracken true -resume -dump-channels
It should crap out around the TAR process, but each time I rsume on my laptop, 2/3rds of the time I'm getting the concourrent error (somestimes on FIND_CONCATENATE_DNA and occasioanlly at ~MALT_BUILD`)
m
I'll have a look ( when I get a bit of time )
👍 1
j
I played around at the weekend but still could not find it.
I tried to look back logically to think where there could be e.g. a channel that is being manipulated at the same time in two different places and really the only place I could find was the
ch_sampelsheet
input channel of
preprocessing
being called by both the channels that go into the two
FIND_CONCATENATE
processes
But even once I made them with different name channels still no improvement
m
It wouldn't be the name of the channels. It's to do with the entities in them.
👍 1
j
That's the odd thing, I can't imagine why this would happen between the two FIND_CONCATENATE processes because they are internally calling different columns from the input samplesheet...
Unless iit's osmething to do with the batching 🤔
m
I haven't had much time to explore but this was the error I got running your branch
Copy code
ERROR ~ Invalid method invocation `doCall` with arguments: [[id:foo], [/Users/mahpa906/Documents/Projects/createtaxdb/work/37/5cb2dc48ce5227b9d3d9c51b623010/bracken-database/database.kraken, /Users/mahpa906/Documents/Projects/createtaxdb/work/37/5cb2dc48ce5227b9d3d9c51b623010/bracken-database/database100mers.kmer_distrib, /Users/mahpa906/Documents/Projects/createtaxdb/work/37/5cb2dc48ce5227b9d3d9c51b623010/bracken-database/database100mers.kraken], [/Users/mahpa906/Documents/Projects/createtaxdb/work/37/5cb2dc48ce5227b9d3d9c51b623010/bracken-database/hash.k2d, /Users/mahpa906/Documents/Projects/createtaxdb/work/37/5cb2dc48ce5227b9d3d9c51b623010/bracken-database/opts.k2d, /Users/mahpa906/Documents/Projects/createtaxdb/work/37/5cb2dc48ce5227b9d3d9c51b623010/bracken-database/taxo.k2d], /Users/mahpa906/Documents/Projects/createtaxdb/work/37/5cb2dc48ce5227b9d3d9c51b623010/bracken-database/seqid2taxid.map, [/Users/mahpa906/Documents/Projects/createtaxdb/work/37/5cb2dc48ce5227b9d3d9c51b623010/bracken-database/library/added/prelim_map.txt, /Users/mahpa906/Documents/Projects/createtaxdb/work/37/5cb2dc48ce5227b9d3d9c51b623010/bracken-database/library/added/prelim_map_t8wJ1VxYzB.txt, /Users/mahpa906/Documents/Projects/createtaxdb/work/37/5cb2dc48ce5227b9d3d9c51b623010/bracken-database/library/added/xtDH1_cDO3.fna, /Users/mahpa906/Documents/Projects/createtaxdb/work/37/5cb2dc48ce5227b9d3d9c51b623010/bracken-database/library/added/xtDH1_cDO3.fna.masked], [/Users/mahpa906/Documents/Projects/createtaxdb/work/37/5cb2dc48ce5227b9d3d9c51b623010/bracken-database/taxonomy/names.dmp, /Users/mahpa906/Documents/Projects/createtaxdb/work/37/5cb2dc48ce5227b9d3d9c51b623010/bracken-database/taxonomy/nodes.dmp, /Users/mahpa906/Documents/Projects/createtaxdb/work/37/5cb2dc48ce5227b9d3d9c51b623010/bracken-database/taxonomy/nucl_gb.accession2taxid]] (java.util.ArrayList) on _closure24 type
j
Yeah no that was a different one when tryimg to fix another issue
You can try running the latest release that will run successfully if the error doesn't occur
Probably the best way now is to take the latest release, break a module, then resume repeatedly after it faild