[X] I have searched existing issues to ensure it has not already been reported
[X] I agree to follow the Code of Conduct that this project adheres to
API/app/plugin version
6.0.3
Node.js version
16.18.1
Operating system
Linux
Operating system version (i.e. 20.04, 11.3, 10)
Amazon Linux 2
Description
I moved my server from Heroku to AWS EC2 instance. On heroku everything worked fine, but on the AWS instance I get this error:
Error: Error opening output file fd://0.png
at ChildProcess.<anonymous> (/home/ec2-user/repo/node_modules/node-poppler/src/index.js:774:14)
at ChildProcess.emit (node:events:513:28)
at ChildProcess.emit (node:domain:489:12)
at maybeClose (node:internal/child_process:1100:16)
at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5)
To install poppler dependencies on heroku instance I added a buildpack in heroku settings: https://github.com/amitree/heroku-buildpack-poppler
To install poppler dependencies on AWS EC2 instance I installed them with:
I found this StackOverflow issue. Which says that this is a bug in pdfToCairo. But the same code worked in Heroku.
Do you think this is an issue of different linux os. Or is there something I am missing and maybe I just need to install some kind of dependencies for this to work?
Differences between heroku and aws linux.
On Heroku, this is called the "stack"—an operating system image curated and maintained by Heroku. The stack is based on Ubuntu, the open source Linux distribution.
AWS's Amazon Linux will be based on Red Hat's Fedora community Linux.
Steps to Reproduce
I just created a AWS EC2 instance with default settings, installed node, installed poppler dependencies and tried running the code below.
I need to generate a png file from pdf which has a single page.
Expected behaviour should be that the png file is generated. On my development machine(macOS) and heroku it works. But on AWS EC2 instance it doesn't work.
Ended up creating an instance of AWS EC2 with Ubuntu 20.4 and installing dependencies with apt-get and it works now. So I am not sure if the problem was with Amazon Linux 2 or yum package manager.
Prerequisites
[X] I have written a descriptive issue title
[X] I have searched existing issues to ensure it has not already been reported
[X] I agree to follow the Code of Conduct that this project adheres to
API/app/plugin version
6.0.3
Node.js version
16.18.1
Operating system
Linux
Operating system version (i.e. 20.04, 11.3, 10)
Amazon Linux 2
Description
I moved my server from Heroku to AWS EC2 instance. On heroku everything worked fine, but on the AWS instance I get this error:
To install poppler dependencies on
heroku
instance I added a buildpack in heroku settings:https://github.com/amitree/heroku-buildpack-poppler
To install poppler dependencies on
AWS EC2
instance I installed them with:Related issue
I found this StackOverflow issue. Which says that this is a bug in pdfToCairo. But the same code worked in Heroku. Do you think this is an issue of different linux os. Or is there something I am missing and maybe I just need to install some kind of dependencies for this to work?
Differences between heroku and aws linux.
On Heroku, this is called the "stack"—an operating system image curated and maintained by Heroku. The stack is based on Ubuntu, the open source Linux distribution. AWS's Amazon Linux will be based on Red Hat's Fedora community Linux.
Steps to Reproduce
I just created a AWS EC2 instance with default settings, installed node, installed poppler dependencies and tried running the code below. I need to generate a png file from pdf which has a single page.
First I generate the pdf buffer:
Then I try to generate the png from the pdf buffer:
Expected Behaviour
Expected behaviour should be that the png file is generated. On my development machine(macOS) and heroku it works. But on AWS EC2 instance it doesn't work.