marcbachmann / node-html-pdf

This repo isn't maintained anymore as phantomjs got dreprecated a long time ago. Please migrate to headless chrome/puppeteer.
MIT License
3.56k stars 543 forks source link

Auto configuration failed #563

Open ZBilel opened 4 years ago

ZBilel commented 4 years ago

I'm trying to build a simple pdf using this code :

...
 pdf.create(html).toStream(function(err, stream){
            if (err) reject(err) ;
            else  stream.pipe(fs.createWriteStream(path.join(__dirname, '../../../assets/docs/')+data.link+'.pdf'));
          });
...

but I get this error message

Error: html-pdf: Received the exit code '1'

    cc-server_1  | Auto configuration failed
    cc-server_1  | 139666354437760:error:25066067:DSO support routines:DLFCN_LOAD:could not load the shared library:dso_dlfcn.c:185:filename(libssl_conf.so): libssl_conf.so: cannot open shared object file: No such file or directory
    cc-server_1  | 139666354437760:error:25070067:DSO support routines:DSO_load:could not load the shared library:dso_lib.c:244:
    cc-server_1  | 139666354437760:error:0E07506E:configuration file routines:MODULE_LOAD_DSO:error loading dso:conf_mod.c:285:module=ssl_conf, path=ssl_conf
    cc-server_1  | 139666354437760:error:0E076071:configuration file routines:MODULE_RUN:unknown module name:conf_mod.c:222:module=ssl_conf
    cc-server_1  |
    cc-server_1  |     at ChildProcess.respond (/usr/src/app/node_modules/html-pdf/lib/pdf.js:121:31)
    cc-server_1  |     at ChildProcess.emit (events.js:311:20)
    cc-server_1  |     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)

the running environment is os : Ubuntu 18.04.3 LTS node : v8.10.0 html-pdf : latest

dahituc commented 4 years ago

Faced same issuse on WSL, but worked fine on Windows machine.

bvisonl commented 4 years ago

This was happening to me too on WSL. I managed to make it work with #531 .

I basically created an empty file in /tmp/openssl.cnf and then added an environment variable called OPENSSL_CONF pointing to that file.

export OPENSSL_CONF=/tmp/openssl.cnf and then I stopped & started my node server.

Obviously in a production environment you would have to properly configure openssl if you are using it.

yogithesymbian commented 3 years ago

me too , i got same error

Error: html-pdf: Received the exit code '1'
Auto configuration failed
139907094650688:error:25066067:DSO support routines:DLFCN_LOAD:could not load the shared library:dso_dlfcn.c:185:filename(libssl_conf.so): libssl_conf.so: cannot open shared object file: No such file or directory
139907094650688:error:25070067:DSO support routines:DSO_load:could not load the shared library:dso_lib.c:244:
139907094650688:error:0E07506E:configuration file routines:MODULE_LOAD_DSO:error loading dso:conf_mod.c:285:module=ssl_conf, path=ssl_conf
139907094650688:error:0E076071:configuration file routines:MODULE_RUN:unknown module name:conf_mod.c:222:module=ssl_conf

    at ChildProcess.respond (/var/www/html/nodeJS/node-js-jwt-auth/node_modules/html-pdf/lib/pdf.js:121:31)
    at ChildProcess.emit (events.js:198:13)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
nullablemind commented 3 years ago

I found the same solve. https://github.com/wernight/docker-phantomjs/blob/master/latest/Dockerfile#L32-L35 Thank's @bvisonl

wilav-dev commented 2 years ago

Same issue any update?

maxizhukov commented 2 years ago

Same issue, does somebody knows how to fix it?

armujahid commented 2 years ago

ENV OPENSSL_CONF=/etc/ssl/ solved this issue for me in containerized environment. Source: https://gist.github.com/julionc/7476620?permalink_comment_id=3877488#gistcomment-3877488