Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
lianov opened this issue Apr 5, 2022 · 2 comments · Fixed by #1510
Closed

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

lianov opened this issue Apr 5, 2022 · 2 comments · Fixed by #1510
Labels
bug Something isn't working high-priority

Comments

@lianov
Copy link
Member

lianov commented Apr 5, 2022

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

@lianov lianov added the bug Something isn't working label Apr 5, 2022
@ewels
Copy link
Member

ewels commented Apr 6, 2022

Thanks for reporting this @lianov 👍🏻

Tested and replicated locally. Confirmed that reverting the Prettier formatting changes fixes it.

Instead of messing around trying to ignore specific bits of the file, I've just reverted the entire thing to how it was and am now ignoring it in the .prettierignore file. See #1510.

Tested locally and this seems to fix the issue.

@lianov
Copy link
Member Author

lianov commented Apr 6, 2022

Perfect, thanks @ewels!

@ewels ewels closed this as completed Apr 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working high-priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants