node-html-pdf icon indicating copy to clipboard operation
node-html-pdf copied to clipboard

Auto configuration failed

Open ZBilel opened this issue 4 years ago • 7 comments

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

ZBilel avatar Apr 01 '20 09:04 ZBilel

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

dahituc avatar Jul 02 '20 02:07 dahituc

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.

bvisonl avatar Oct 20 '20 13:10 bvisonl

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)

yogithesymbian avatar Nov 23 '20 01:11 yogithesymbian

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

nullablemind avatar Apr 27 '21 18:04 nullablemind

Same issue any update?

wilav-dev avatar Nov 26 '21 00:11 wilav-dev

Same issue, does somebody knows how to fix it?

maxizhukov avatar Dec 31 '21 00:12 maxizhukov

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

armujahid avatar Sep 29 '22 06:09 armujahid