# Weird bug: workdir missing output file but results has output file, when mode=copy

**URL:** <https://community.seqera.io/t/weird-bug-workdir-missing-output-file-but-results-has-output-file-when-mode-copy/2523>\
**Category:** Ask for help\
**Tags:** nextflow\
**Created:** [January 31, 2026, 10:32pm UTC](https://community.seqera.io/t/weird-bug-workdir-missing-output-file-but-results-has-output-file-when-mode-copy/2523 "2026-01-31T22:32:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![yinshiyi](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/yinshiyi/32/1091_2.png) [@yinshiyi](https://community.seqera.io/u/yinshiyi)\
**Post date:** [January 31, 2026, 10:32pm UTC](https://community.seqera.io/t/weird-bug-workdir-missing-output-file-but-results-has-output-file-when-mode-copy/2523/1 "2026-01-31T22:32:36Z")

</div>

```auto
nextflow.enable.dsl=2

process TEST_MODULE {
    tag "${name}"
    publishDir 'results', mode: 'copy'

    input:
    val(name)

    output:
        path("logs/${name}_out.txt")

    script:
        name = "lol"
        """
        mkdir -p logs
        echo "'test' ${name}" > logs/${name}_out.txt
        """
}

workflow {
    output_ch=TEST_MODULE("lol")
    output_ch.map { file -> 
      println file.text
    }
    output_ch.view()
}

```

after running

```auto
nextflow main.nf 

 N E X T F L O W ~ version 24.04.4

executor > local (1)
[fd/105717] TEST_MODULE (lol) [100%] 1 of 1 ✔
some_path/work/fd/105717d5189a04aa3aef79a47fda5b/logs/lol_out.txt
'test' lol

```

It prints the content of the \_out.txt

and in the results dir, it has the file.

**however the work dir link does not have the \_out.txt file**

```auto
some_path/work/fd/105717d5189a04aa3aef79a47fda5b/logs/lol_out.txt

```

if i go into work dir and run bash .command.run, then the correct file is generated.

It seems like it is behaving like mode: ‘move’  
however I did have mode: ‘copy’

---

<div class="post-metadata">

**Author:** ![yinshiyi](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/yinshiyi/32/1091_2.png) [@yinshiyi](https://community.seqera.io/u/yinshiyi)\
**Post date:** [January 31, 2026, 10:39pm UTC](https://community.seqera.io/t/weird-bug-workdir-missing-output-file-but-results-has-output-file-when-mode-copy/2523/2 "2026-01-31T22:39:32Z")

</div>

i had boost clean up on true. problem solved

---

<div class="post-metadata">

**Author:** ![yinshiyi](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/yinshiyi/32/1091_2.png) [@yinshiyi](https://community.seqera.io/u/yinshiyi)\
**Post date:** [February 7, 2026, 10:40pm UTC](https://community.seqera.io/t/weird-bug-workdir-missing-output-file-but-results-has-output-file-when-mode-copy/2523/3 "2026-02-07T22:40:29Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
