Answers.Body: <p>Rotation of report files (trace, execution, timeline etc) was removed recently (since version <a href="https://github.com/nextflow-io/nextflow/releases/tag/v22.10.0" rel="noreferrer">22.10.0</a> in <a href="https://github.com/nextflow-io/nextflow/commit/a762ed59c1af255183da8a2d26907206964eade0" rel="noreferrer"><code>a762ed5</code></a>). To overwrite the existing trace file you will need to add the following to your Nextflow <a href="https://www.nextflow.io/docs/latest/config.html" rel="noreferrer">config</a>:</p>
  <pre><code>trace.overwrite = true
  </code></pre>
  <p>See: <a href="https://github.com/nextflow-io/nextflow/issues/3317" rel="noreferrer">https://github.com/nextflow-io/nextflow/issues/3317</a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-11-29T02:12:10.603Z
Answers.LastActivityDate: 2022-11-29T02:34:31.107Z
Answers.LastEditDate: 2022-11-29T02:34:31.107Z
Answers.UserDisplayName: Steve
Body: <p>When trying to run epi2me-labs/wf-artic, I get the following error:</p>
  <pre><code>❯ nextflow run epi2me-labs/wf-artic \
   -r v0.3.18 --fastq  ~/Downloads/barcode95.fastq.gz \
   --scheme_version Midnight-ONT/V3 
  
  N E X T F L O W  ~  version 22.10.1
  Launching `https://github.com/epi2me-labs/wf-artic` [ecstatic_marconi] DSL2 - revision: a60a1e1e73 [v0.3.18]
  Trace file already exists: /Users/corneliusromer/Downloads/BJGMC_ONT_Run71/output/execution/trace.txt
  </code></pre>
  <p>It seems that nextflow doesn't like to rerun after it failed. Is there a convenient way to force nextflow to rerun, in a similar way to <code>snakemake --force-rerun</code>? Or do I need to manually delete the trace file every time? That works, but it's tedious.</p>
  
Tags: <assembly><sars-cov-2><nextflow><workflow-management>
Title: How to solve Nextflow error: "Trace file already exists"?
ThreadText: # How to solve Nextflow error: "Trace file already exists"?
  
  (Asked by: username_0 on 2022-11-29)
  
  When trying to run epi2me-labs/wf-artic, I get the following error:
  
  ```
  ❯ nextflow run epi2me-labs/wf-artic \
   -r v0.3.18 --fastq  ~/Downloads/barcode95.fastq.gz \
   --scheme_version Midnight-ONT/V3 
  
  N E X T F L O W  ~  version 22.10.1
  Launching `https://github.com/epi2me-labs/wf-artic` [ecstatic_marconi] DSL2 - revision: a60a1e1e73 [v0.3.18]
  Trace file already exists: /Users/corneliusromer/Downloads/BJGMC_ONT_Run71/output/execution/trace.txt
  
  ```
  
  It seems that nextflow doesn't like to rerun after it failed. Is there a convenient way to force nextflow to rerun, in a similar way to `snakemake --force-rerun`? Or do I need to manually delete the trace file every time? That works, but it's tedious.
  
  **Tags:** assembly, sars-cov-2, nextflow, workflow-management
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2022-11-29. Score: 5 | Accepted answer
  
  Rotation of report files (trace, execution, timeline etc) was removed recently (since version [22.10.0](https://github.com/nextflow-io/nextflow/releases/tag/v22.10.0) in [`a762ed5`](https://github.com/nextflow-io/nextflow/commit/a762ed59c1af255183da8a2d26907206964eade0)). To overwrite the existing trace file you will need to add the following to your Nextflow [config](https://www.nextflow.io/docs/latest/config.html):
  
  ```
  trace.overwrite = true
  
  ```
  
  See: <https://github.com/nextflow-io/nextflow/issues/3317>
  
  
  ---
  
  