Skip to content

Failing to parse template script for workflow.onComplete event handler #1509

@lianov

Description

@lianov

Description of the bug

Template generation with nf-core create (v 2.3.2) seems to cause an issue with the assets/email_template.html file.

A simple workflow (FastQC + MultiQC) from the current template fails at the completion email/summary at the workflow.onComplete event handler (fails to invoke the event handler):

From .nextflow.log

groovy.lang.GroovyRuntimeException: Failed to parse template script (your template may contain an error or be trying to use expressions not currently supported): startup failed:
GStringTemplateScript2.groovy: 80: Unexpected character: '"' @ line 80, column 48.
   ut << summary.collect{ k,v -> "
                                 ^

1 error

Changing the Pipeline Configuration configuration section to the older style fixes the issue, e.g.:

      <h3>Pipeline Configuration:</h3>
      <table style="width:100%; max-width:100%; border-spacing: 0; border-collapse: collapse; border:0; margin-bottom: 30px;">
          <tbody style="border-bottom: 1px solid #ddd;">
              <% out << summary.collect{ k,v -> "<tr><th style='text-align:left; padding: 8px 0; line-height: 1.42857143; vertical-align: top; border-top: 1px solid #ddd;'>$k</th><td style='text-align:left; padding: 8px; line-height: 1.42857143; vertical-align: top; border-top: 1px solid #ddd;'><pre style='white-space: pre-wrap; overflow: visible;'>$v</pre></td></tr>" }.join("\n") %>
          </tbody>
      </table>

with the caveat of course that linting the workflow will cause an issue at this section since it's no longer synched with the template

Command used and terminal output

nf-core create
nextflow run main.nf -params-file ./params.yml -profile test,cheaha --outdir results


# params.yml contained my email to the param `email`.
# institutional profile used here, but issue is not linked to that

System information

Nextflow version: version 21.10.6
Hardware: HPC
Executor: executor - slurm
Container engine: Singularity
OS: CentOS Linux,
Version of nf-core/tools: 2.3.2
Python 3.9.12

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions