pharmaR / riskassessment

Collaborative Deployment: https://app.pharmar.org/riskassessment/ Risk Assessment Demo App: https://rinpharma.shinyapps.io/riskassessment
https://pharmar.github.io/riskassessment/
Other
101 stars 29 forks source link

Fix report downloads for deployments on Posit Connect #702

Open Jeff-Thompson12 opened 1 year ago

Jeff-Thompson12 commented 1 year 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 1 year 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 months 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 months 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.

aclark02-arcus commented 4 months ago

@mayank-procogia - do you see any issues with ProCogia's Posit Connect Deployment?

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

Not sure why HTML & Word weren't working before. They seem to be working just fine now... and the deployment hasn't changed. So the only problem I'm still noticing is with PDF & the error message is consistent with the above. I'll make sure this is just a system dependency issue and hopefully close this out ASAP.