pharmaR / riskassessment

Risk Assessment Demo App: https://rinpharma.shinyapps.io/riskassessment
https://pharmar.github.io/riskassessment/
Other
98 stars 25 forks source link

Fix report downloads for deployments on Posit Connect #702

Open Jeff-Thompson12 opened 7 months ago

Jeff-Thompson12 commented 7 months ago

These downloads are only working locally and not on the deployed instances. We need users to be able to download in the PDF and DOCX formats when the application is deployed on Posit Connect, etc.

mayank-procogia commented 7 months ago

I have tested this extensively on my local system, shinyapps and RS Connect too.

In addition to the RS Connect, this issue is also present on deployed shinyapps app at https://rinpharma.shinyapps.io/riskassessment/

From the log messages, it seems that the program is not able to copy the template Word and pdf R Markdown files to the temporary directory location for parameterised render, and hence it fails.

Sample Error Message:

Warning in normalizePath(x, winslash = winslash, mustWork = must_work) :
path[1]="/opt/rstudio-connect/mnt/tmp/RtmpRhqxW6/reportDocx.Rmd": No such file or directory
Warning: Error in abs_path: The file '/opt/rstudio-connect/mnt/tmp/RtmpRhqxW6/reportDocx.Rmd' does not exist.
aclark02-arcus commented 5 days ago

Since releasing v3.1.0 on master, I've deployed this branch to an internal Posit Connect server and all the downloads are still not working, even though we did fix the Word & PDF issues with the new release.

For HTML & Word: No errors in logs

For PDF:

! LaTeX Error: File `ucharcat.sty' not found.
Warning: Error in : LaTeX failed to compile file2fbdb72cc02fec.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. See file2fbdb72cc02fec.log for more info.
jthompson-arcus commented 5 days ago

This should not be a issue with the app itself. Most likely there is a LaTeX library that needs to be installed on the Posit Connect server.