Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto Configuration Failed - libproviders.so: No such file or directory #680

Closed
danielmnetto opened this issue May 24, 2022 · 2 comments
Closed

Comments

@danielmnetto
Copy link

danielmnetto commented May 24, 2022

I was trying to create to parse HTML to PDF Buffer in NodeJS using the following code...

pdf.create(html, { format: 'A4', header: { height: "5cm" }, footer: { height: '0.4cm' }, border: { left: '1cm', right: '1cm' } })
      .toBuffer((error, buffer) => {
          if (error) {
               console.log(error.stack)
               return res.status(500).json(null).end()
          }
}

But it returned this error:

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

    at ChildProcess.respond (/home/.../node_modules/html-pdf/lib/pdf.js:134:17)
    at ChildProcess.emit (node:events:527:28)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)

The OS used to is Ubuntu Server 22.04
NodeJS = v16.15.0
html-pdf = v.3.0.1

It looks like the same issue of #563 from ZBilel but the difference is that the error log says libproviders.so: cannot open shared object file: No such file or directory

@danielmnetto
Copy link
Author

UPDATE: I found a solution by adding an option for pdf.create which is:

childProcessOptions: {
   env: {
      OPENSSL_CONF: '/dev/null',
   },
}

With this options the code will stay like this:

pdf.create(html, {/*...*/ childProcessOptions: { env: { OPENSSL_CONF: '/dev/null' } } } )
      .toBuffer((error, buffer) => {
          if (error) {
               console.log(error.stack)
               return res.status(500).json(null).end()
          }
}

Thanks to opengeekslabap answer on the issue #531.

@shankarsingh2111
Copy link

Thanks, it is extremely helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants