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

Class cannot be created (missing no-arg constructor): nextflow.file.http.XPath #5208

Closed
nvnieuwk opened this issue Aug 6, 2024 · 16 comments · Fixed by #5339 or #5411
Closed

Class cannot be created (missing no-arg constructor): nextflow.file.http.XPath #5208

nvnieuwk opened this issue Aug 6, 2024 · 16 comments · Fixed by #5339 or #5411
Assignees
Labels

Comments

@nvnieuwk
Copy link

nvnieuwk commented Aug 6, 2024

Bug report

Expected behavior and actual behavior

We encountered this error when debugging a PR in nf-core/demultiplex. This issue only occurs with the last version of Nextflow edge (24.07.0-edge)

Error traceback
com.esotericsoftware.kryo.KryoException: Class cannot be created (missing no-arg constructor): nextflow.file.http.XPath
	at com.esotericsoftware.kryo.Kryo$DefaultInstantiatorStrategy.newInstantiatorOf(Kryo.java:1228)
	at nextflow.util.InstantiationStrategy.newInstantiatorOf(SerializationHelper.groovy:247)
	at com.esotericsoftware.kryo.Kryo.newInstantiator(Kryo.java:1049)
	at com.esotericsoftware.kryo.Kryo.newInstance(Kryo.java:1058)
	at com.esotericsoftware.kryo.serializers.FieldSerializer.create(FieldSerializer.java:547)
	at com.esotericsoftware.kryo.serializers.FieldSerializer.read(FieldSerializer.java:523)
	at com.esotericsoftware.kryo.Kryo.readClassAndObject(Kryo.java:761)
	at org.codehaus.groovy.vmplugin.v8.IndyInterface.fromCache(IndyInterface.java:321)
	at nextflow.util.KryoHelper.deserialize(SerializationHelper.groovy:181)
	at nextflow.util.KryoHelper.deserialize(SerializationHelper.groovy)
	at nextflow.file.SortFileCollector.saveFile(SortFileCollector.groovy:315)
	at nextflow.file.FileCollector.saveTo0(FileCollector.groovy:228)
	at nextflow.file.FileCollector.saveTo(FileCollector.groovy:251)
	at org.codehaus.groovy.vmplugin.v8.IndyInterface.fromCache(IndyInterface.java:321)
	at nextflow.extension.CollectFileOp.emitItems(CollectFileOp.groovy:187)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:343)
	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:328)
	at groovy.lang.MetaClassImpl.doInvokeMethod(MetaClassImpl.java:1333)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1088)
	at groovy.lang.MetaClassImpl.invokeMethodClosure(MetaClassImpl.java:1017)
	at groovy.lang.MetaClassImpl.doInvokeMethod(MetaClassImpl.java:1207)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1088)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1007)
	at groovy.lang.Closure.call(Closure.java:433)
	at groovy.lang.Closure.call(Closure.java:422)
	at org.codehaus.groovy.vmplugin.v8.IndyInterface.fromCache(IndyInterface.java:321)
	at nextflow.extension.DataflowHelper$3.afterStop(DataflowHelper.groovy:257)
	at groovyx.gpars.dataflow.operator.DataflowProcessor.fireAfterStop(DataflowProcessor.java:324)
	at groovyx.gpars.dataflow.operator.DataflowProcessorActor.afterStop(DataflowProcessorActor.java:59)
	at jdk.internal.reflect.GeneratedMethodAccessor75.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:343)
	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:328)
	at groovy.lang.MetaClassImpl.doInvokeMethod(MetaClassImpl.java:1333)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1088)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1007)
	at org.codehaus.groovy.runtime.InvokerHelper.invokePojoMethod(InvokerHelper.java:633)
	at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:624)
	at groovyx.gpars.actor.Actor.callDynamic(Actor.java:369)
	at groovyx.gpars.actor.Actor.handleTermination(Actor.java:320)
	at groovyx.gpars.actor.AbstractLoopingActor.terminate(AbstractLoopingActor.java:204)
	at groovyx.gpars.dataflow.operator.DataflowProcessor.terminate(DataflowProcessor.java:147)
	at groovyx.gpars.dataflow.operator.DataflowProcessorActor.checkPoison(DataflowProcessorActor.java:115)
	at groovyx.gpars.dataflow.operator.DataflowOperatorActor.onMessage(DataflowOperatorActor.java:83)
	at groovyx.gpars.actor.impl.SDAClosure$1.call(SDAClosure.java:43)
	at groovyx.gpars.actor.AbstractLoopingActor.runEnhancedWithoutRepliesOnMessages(AbstractLoopingActor.java:293)
	at groovyx.gpars.actor.AbstractLoopingActor.access$400(AbstractLoopingActor.java:30)
	at groovyx.gpars.actor.AbstractLoopingActor$1.handleMessage(AbstractLoopingActor.java:93)
	at groovyx.gpars.util.AsyncMessagingCore.run(AsyncMessagingCore.java:132)
	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)

Steps to reproduce the problem

(Provide a test case that reproduce the problem either with a self-contained script or GitHub repository)

Program output

(Copy and paste here output produced by the failing execution. Please highlight it as a code block. Whenever possible upload the .nextflow.log file.)

Environment

  • Nextflow version: 24.07.0-edge
  • Java version: 17.0.11
  • Operating system: Linux

Additional context

(Add any other context about the problem here)

@bentsherman
Copy link
Member

Indeed there is no empty XPath constructor, though it's curious why this issue only appeared now

@pditommaso
Copy link
Member

It would be nice to a test case to replicate the error

@nvnieuwk
Copy link
Author

nvnieuwk commented Sep 9, 2024

@atrigila do you remember what the issue was here?

@atrigila
Copy link

atrigila commented Sep 9, 2024

nf-tests failed due to unknown reason after simply updating modules and a directory path, we can see the results from those nf-tests in CI here: https://github.com/nf-core/demultiplex/actions/runs/10271920060/job/28422982280 for this commit

Assertion failed: 
  
  8 of 8 assertions failed
  
  Nextflow stdout:
  
  ERROR ~ Class cannot be created (missing no-arg constructor): nextflow.file.http.XPath
  
   -- Check '/home/runner/work/demultiplex/demultiplex/.nf-test/tests/d4593e0[74](https://github.com/nf-core/demultiplex/actions/runs/10271920060/job/28422982280#step:5:75)a7ce42935e81a6ef47fa4ce/meta/nextflow.log' file for details
  ERROR ~ Pipeline failed. Please refer to troubleshooting docs: https://nf-co.re/docs/usage/troubleshooting
  
   -- Check '/home/runner/work/demultiplex/demultiplex/.nf-test/tests/d4593e074a7ce42935e81a6ef47fa4ce/meta/nextflow.log' file for details
  Join mismatch for the following entries: key=[id:sim-data, lane:null] values=

In the following commits we changed the latest-everything to latest-stable and that solved that issue.

@pditommaso
Copy link
Member

Likely it's enough to add the default constructor

@jorgee jorgee linked a pull request Sep 26, 2024 that will close this issue
@pditommaso
Copy link
Member

Can anyone include the corresponding .nextflow.log file for the failed execution?

@nvnieuwk
Copy link
Author

nvnieuwk commented Oct 2, 2024

Thank you for fixing this!

@atrigila
Copy link

We came across this error again in nf-core/demultiplex#276

Tests are failing in latest-everything but not in 24.04.2.

Example: https://github.com/nf-core/demultiplex/actions/runs/11365226302/job/31612964417?pr=276

  ERROR ~ Class cannot be created (missing no-arg constructor): nextflow.file.http.XFileSystem
  Serialization trace:
  fs (nextflow.file.http.XPath)

cc @maxulysse

@atrigila
Copy link

Attaching logs for those runs
logs_29690945475.zip

@maxulysse
Copy link
Contributor

latest-everything is 24.09.2-edge

@jorgee
Copy link
Contributor

jorgee commented Oct 16, 2024

Attaching logs for those runs logs_29690945475.zip

Is there a wa to get the .nextflow.log file of this execution? I can't see in the logs zip file

@jorgee
Copy link
Contributor

jorgee commented Oct 17, 2024

I have been able to reproduce the error. It is slightly different. The class that is deserializing is different. In previous issue, the class that was failing to deserialize was XPath. Now, it is failing to XFileSystem. It is failing in a collectFile operator. I think it is when collecting this file https://raw.githubusercontent.com/nf-core/test-datasets/demultiplex/testdata/sim-data/out.sample_meta.csv

@maxulysse
Copy link
Contributor

Interesting

@pditommaso
Copy link
Member

is not the default constructor solving it?

@jorgee
Copy link
Contributor

jorgee commented Oct 17, 2024

is not the default constructor solving it?

It is failing in a different point. In the reported issue was XPath and now it is XFileSystem. I have tested adding the default constructor also to XFileSystem it fix the issue. In this case, I was able to reproduce the issue with a unit test. should I reopen the issue or create a new one.?

@pditommaso
Copy link
Member

Let's use the previous one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
6 participants