Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pandoc document conversion failed with error 127

I'm not sure how to make a reproducible example of this, but I'm curious to hear if anyone else has encountered this problem. I have an R Markdown file hosted via shiny server on an EC2 instance running Ubuntu. Everything was working fine for days and now suddenly I get the following error when I try to view the document in the browser:

pandoc document conversion failed with error 127

I'm not converting to pdf, haven't pushed any changes, and it was working a few hours ago. I'm not finding much of anything online about this error code so I have no idea how to debug this issue. Anyone had this happen before?

like image 405
Erin Shellman Avatar asked Jan 08 '16 22:01

Erin Shellman


1 Answers

I had the same error when working with an aws EC2 instance with Ubuntu 16.04 LTS installed and running a shiny app.

My fix: I had some code outside the ui and server functions of my app.R file. I moved all outside code into the server function and the error no longer occurs.

What confused me was that the app still worked most of the time even though some of the code was outside these two functions!

Another thing you could try: Some sources state that this error occurs due to lack of memory. To aid limited memory situation on aws instances, you should provide swap space the system can use to free up memory. Ubuntu on an aws EC2 instance by default has zero swap space! You can use these instructions, google also shows plenty: http://www.thegeekstuff.com/2010/08/how-to-add-swap-space/

like image 153
Juuso Nykänen Avatar answered Sep 19 '22 14:09

Juuso Nykänen