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

Pandoc failures can lead to report failures #799

Open
effigies opened this issue Apr 14, 2023 · 0 comments
Open

Pandoc failures can lead to report failures #799

effigies opened this issue Apr 14, 2023 · 0 comments
Labels

Comments

@effigies
Copy link
Member

What happened?

If pandoc fails to fully convert the Markdown boilerplate, our report compilation can fail here:

text = (
re.compile("<body>(.*?)</body>", re.DOTALL | re.IGNORECASE)
.findall((logs_path / "CITATION.html").read_text())[0]
.strip()
)

We should code a bit more defensively and allow for regexes to fail.

What command did you use?

Not given

What version of the software are you running?

22.1.1

How are you running this software?

Docker

Is your data BIDS valid?

Yes

Are you reusing any previously computed results?

No

Please copy and paste any relevant log output.

230413-04:06:39,364 nipype.workflow IMPORTANT:
        fMRIPrep finished successfully!
230413-04:06:39,364 nipype.workflow IMPORTANT:
        Works derived from this fMRIPrep execution should include the boilerplate text found in <OUTPUT_PATH>/fmriprep/logs/CITATION.md.", "stderr": "You are using fMRIPrep-22.1.1, and a newer version of fMRIPrep is available: 23.0.1.
Please check out our documentation about how and when to upgrade:
https://fmriprep.readthedocs.io/en/latest/faq.html#upgrading
--topup-max-vols input is no longer used and the flag will be removed in a future release.
Could not generate CITATION.html file:
pandoc -s --bibliography /out/fmriprep/logs/CITATION.bib --citeproc --metadata pagetitle="fMRIPrep citation boilerplate" /out/fmriprep/logs/CITATION.md -o /out/fmriprep/logs/CITATION.html
Traceback (most recent call last):
  File "/opt/conda/bin/fmriprep", line 8, in <module>
    sys.exit(main())
  File "/opt/conda/lib/python3.9/site-packages/fmriprep/cli/run.py", line 213, in main
    failed_reports = generate_reports(
  File "/opt/conda/lib/python3.9/site-packages/fmriprep/reports/core.py", line 96, in generate_reports
    report_errors = [
  File "/opt/conda/lib/python3.9/site-packages/fmriprep/reports/core.py", line 97, in <listcomp>
    run_reports(
  File "/opt/conda/lib/python3.9/site-packages/fmriprep/reports/core.py", line 79, in run_reports
    return Report(
  File "/opt/conda/lib/python3.9/site-packages/niworkflows/reports/core.py", line 389, in generate_report
    re.compile("<body>(.*?)</body>", re.DOTALL | re.IGNORECASE)
IndexError: list index out of range

Additional information / screenshots

No response

@effigies effigies added the bug label Apr 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant