nextflow icon indicating copy to clipboard operation
nextflow copied to clipboard

No such file in stdout instead of stderr

Open Qwarctick opened this issue 3 years ago • 2 comments

Bug report

Expected behavior and actual behavior

Some messages in terminal are printed in stdout instead of stderr. For example, when there is a missing file, the error is printed in stdout.

Steps to reproduce the problem

In ./main.nf file :

#!/usr/bin/env nextflow
nextflow.enable.dsl=2

include { splitData } from './modules/split_data'
$ nextflow run main.nf > out.stdout 2> out.stderr

$ cat out.stdout 
N E X T F L O W  ~  version 22.04.0
Launching `main.nf` [adoring_hamilton] DSL2 - revision: 457b997805
No such file: Can't find a matching module file for include: ./modules/split_data

 -- Check script 'main.nf' at line: 6 or see '.nextflow.log' file for more details

$ cat out.stderr

The lines

No such file: Can't find a matching module file for include: ./modules/split_data

 -- Check script 'main.nf' at line: 6 or see '.nextflow.log' file for more details

Should be in the stderr for more consistence.

Environment

  • Nextflow version: 22.04.0 build 5697
  • Java version: openjdk version "17.0.3" 2022-04-19
  • Operating system: Linux (Fedora 36)
  • Bash version: GNU bash, version 5.1.16(1)-release (x86_64-redhat-linux-gnu)

Qwarctick avatar May 30 '22 12:05 Qwarctick

I did some digging and I think this it where the error originates:

https://github.com/nextflow-io/nextflow/blob/7fd1a6e176943821d32ac979cdc6a0da74629bb3/modules/nextflow/src/main/groovy/nextflow/util/LoggerHelper.groovy#L458

And looking at the surrounding code, it seems possible it might be printed to stdout depending on the event level.

If you'd like to dig further... PRs are welcome 😄

bentsherman avatar Jun 30 '22 20:06 bentsherman

Not sure, but it could be this

pditommaso avatar Jul 01 '22 08:07 pditommaso

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Dec 21 '22 01:12 stale[bot]

Closing because Paolo doesn't want to change it. See the linked PR for details.

bentsherman avatar Mar 18 '23 17:03 bentsherman