nextflow-io / nextflow

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

Error when using `-with-weblog` option in combination with the `output`-block #5443

Open di-hardt opened 3 weeks ago

di-hardt commented 3 weeks ago

Bug report

Expected behavior and actual behavior

Expected: Running a workflow -with-weblog option in combination with the output-block finishes successfully.

Actual behavior: Workflow throws error and no result is published when -with-weblog is used. Without -with-weblog it is running fine.

Steps to reproduce the problem

nextflow.config

outputDir = 'foo_results'
workflow.output.enabled = true

foo.nf

#!/usr/bin/env nextflow

nextflow.enable.dsl=2
nextflow.preview.output = true

process download {
    output:
    path 'healthexp.csv'

    script:
    """
    curl -o healthexp.csv https://raw.githubusercontent.com/mwaskom/seaborn-data/refs/heads/master/raw/healthexp.csv
    """
}

workflow {
    main:
    print "$workflow.outputDir"
    result = download()
    result.view { file -> "Result: ${file}" }

    publish:
    result >> "default"

}

output {
    "default" {
        mode "move"
        path "."
    }
}

Run NXF_VER=24.10.0 nextflow run -with-weblog http://127.0.0.1:9000 foo.nf

Program output

 N E X T F L O W   ~  version 24.10.0

Launching `foo.nf` [exotic_wozniak] DSL2 - revision: 4cdaa36bbf

WARN: java.net.ConnectException: Connection refused
WARN: WORKFLOW OUTPUT DSL IS A PREVIEW FEATURE - SYNTAX AND FUNCTIONALITY CAN CHANGE IN FUTURE RELEASES
/Users/winkelhardtdi/Code/workflows/macdii/macdii_results
executor >  local (1)
[84/2cde1c] process > download [100%] 1 of 1 ✔
Result: /Users/winkelhardtdi/Code/workflows/macdii/work/84/2cde1cbd1b81ea45a7d884869bbea1/healthexp.csv
ERROR ~ Receiver class nextflow.weblog.WebLogObserver does not define or inherit an implementation of the resolved method 'abstract void onWorkflowPublish(java.lang.Object)' of interface nextflow.trace.TraceObserver.

 -- Check '.nextflow.log' file for details

.nextflow.log

Environment

Additional context

I run a very simple http server with Python which receives and prints the logs to make sure it is not a timeout or something.

from http.server import HTTPServer, BaseHTTPRequestHandler

class SimpleHTTPRequestHandler(BaseHTTPRequestHandler):

    def do_POST(self):
        content_length = int(self.headers["Content-Length"])
        body = self.rfile.read(content_length)
        print(body.decode())
        self.send_response(200)
        self.end_headers()
        self.wfile.write(b"")

httpd = HTTPServer(("localhost", 9000), SimpleHTTPRequestHandler)
httpd.serve_forever()
bentsherman commented 3 weeks ago

Thanks for reporting, I will update nf-weblog to work with 24.10