amra / DocumentationAsCode

Docker image with pandoc and additional plugins
0 stars 0 forks source link

wkhtmltopdf throws "QSslSocket: cannot resolve CRYPTO_num_locks" when using a template #2

Closed amra closed 6 years ago

amra commented 6 years ago

Command

docker run -w /foo -vpwd/test:/foo amra/documentation-as-code pandoc --self-contained --standalone --number-sections --table-of-contents --pdf-engine=wkhtmltopdf wkhtmltopdf.md -o wkhtmltopdf.pdf --template standalone.html

Output

QSslSocket: cannot resolve CRYPTO_num_locks                  ] 10%
QSslSocket: cannot resolve CRYPTO_set_id_callback
QSslSocket: cannot resolve CRYPTO_set_locking_callback
QSslSocket: cannot resolve sk_free
QSslSocket: cannot resolve sk_num
QSslSocket: cannot resolve sk_pop_free
QSslSocket: cannot resolve sk_value
QSslSocket: cannot resolve SSL_library_init
QSslSocket: cannot resolve SSL_load_error_strings
QSslSocket: cannot resolve SSLv3_client_method
QSslSocket: cannot resolve SSLv23_client_method
QSslSocket: cannot resolve SSLv3_server_method
QSslSocket: cannot resolve SSLv23_server_method
QSslSocket: cannot resolve X509_STORE_CTX_get_chain
QSslSocket: cannot resolve OPENSSL_add_all_algorithms_noconf
QSslSocket: cannot resolve OPENSSL_add_all_algorithms_conf
QSslSocket: cannot resolve SSLeay
QSslSocket: cannot call unresolved function CRYPTO_num_locks
QSslSocket: cannot call unresolved function CRYPTO_set_id_callback
QSslSocket: cannot call unresolved function CRYPTO_set_locking_callback
QSslSocket: cannot call unresolved function SSL_library_init
QSslSocket: cannot call unresolved function SSLv23_client_method
QSslSocket: cannot call unresolved function sk_num
QSslSocket: cannot call unresolved function SSLv23_client_method2%
QSslSocket: cannot call unresolved function SSL_library_init
Warning: Failed to load https://raw.githubusercontent.com/diversen/pandoc-bootstrap-adaptive-template/master/template.css (ignore)
QSslSocket: cannot call unresolved function SSLv23_client_method
QSslSocket: cannot call unresolved function SSL_library_init
QSslSocket: cannot call unresolved function SSLv23_client_method
QSslSocket: cannot call unresolved function SSL_library_init
Warning: Failed to load https://vjs.zencdn.net/5.4.4/video-js.css (ignore)
QSslSocket: cannot call unresolved function SSLv23_client_method
QSslSocket: cannot call unresolved function SSL_library_init
QSslSocket: cannot call unresolved function SSLv23_client_method
QSslSocket: cannot call unresolved function SSL_library_init
Warning: Failed to load https://vjs.zencdn.net/5.4.4/video.js (ignore)
QSslSocket: cannot call unresolved function SSLv23_client_method
QSslSocket: cannot call unresolved function SSL_library_init
QSslSocket: cannot call unresolved function SSLv23_client_method
QSslSocket: cannot call unresolved function SSL_library_init
QSslSocket: cannot call unresolved function SSLv23_client_method
QSslSocket: cannot call unresolved function SSL_library_init
QSslSocket: cannot call unresolved function SSLv23_client_method
QSslSocket: cannot call unresolved function SSL_library_init
QSslSocket: cannot call unresolved function SSLv23_client_method
QSslSocket: cannot call unresolved function SSL_library_init
QSslSocket: cannot call unresolved function SSLv23_client_method
QSslSocket: cannot call unresolved function SSL_library_init
Warning: Failed to load https://github.com/diversen/pandoc-bootstrap-adaptive-template/raw/master/menu/css/skins/blue.css (ignore)
Warning: Failed to load https://github.com/diversen/pandoc-bootstrap-adaptive-template/raw/master/menu/menu/css/skins/graphite.css (ignore)
Warning: Failed to load https://github.com/diversen/pandoc-bootstrap-adaptive-template/raw/master/menu/menu/css/skins/grey.css (ignore)
QSslSocket: cannot call unresolved function SSLv23_client_method
QSslSocket: cannot call unresolved function SSL_library_init
Warning: Failed to load https://github.com/diversen/pandoc-bootstrap-adaptive-template/raw/master/script.js (ignore)
QSslSocket: cannot call unresolved function SSLv23_client_method
QSslSocket: cannot call unresolved function SSL_library_init
QSslSocket: cannot call unresolved function SSLv23_client_method
QSslSocket: cannot call unresolved function SSL_library_init
QSslSocket: cannot call unresolved function SSLv23_client_method
QSslSocket: cannot call unresolved function SSL_library_init
QSslSocket: cannot call unresolved function SSLv23_client_method00%
QSslSocket: cannot call unresolved function SSL_library_init
Counting pages (2/6)                                               
Resolving links (4/6)                                                       
Loading headers and footers (5/6)                                           
Printing pages (6/6)                                               
Done                                                                      
Exit with code 1 due to network error: UnknownNetworkError
QSslSocket: cannot call unresolved function CRYPTO_num_locks
QSslSocket: cannot call unresolved function CRYPTO_set_id_callback
QSslSocket: cannot call unresolved function CRYPTO_set_locking_callback
Error producing PDF.
amra commented 6 years ago

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=797926 that's because debian has DROPPED these symbols completely from the packages, the code needs to be adjusted to not use them please!!

Wkhtmltopdf issue detail: https://github.com/wkhtmltopdf/wkhtmltopdf/issues/3001

amra commented 6 years ago

Just install libssl1.0-dev.

Patryk1098 commented 5 years ago

Installing libssl1.0-dev resolves the symbol issue, but if you're attempting to load content over HTTPS, you'll likely still get an error if you're running wkhtmltopdf 0.12.4. See this larger post for details: https://github.com/wkhtmltopdf/wkhtmltopdf/issues/3001

sumityadavbadli commented 5 years ago

I am using laravel homestead, and i ran into the same issue. sudo apt-get install libssl1.0-dev fixed issue for me.

wbsouza commented 5 years ago

For Fedora users, to fix this issue you have to install this lib: sudo dnf install compat-openssl10-devel.x86_64 -y

takman1 commented 5 years ago

Hello, For Ubuntu 16.04 (xenial), I tried this fix and it worked for me

  1. curl https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.xenial_amd64.deb --location -o /tmp/wkhtmltox_0.12.5-1.xenial_amd64.deb
  2. sudo apt-get --assume-yes install /tmp/wkhtmltox_0.12.5-1.xenial_amd64.deb
  3. rm /tmp/wkhtmltox_0.12.5-1.xenial_amd64.deb
  4. wkhtmltopdf 'https://www.google.com' /tmp/google.pdf
huyhoang1995 commented 5 years ago

Hello, For Ubuntu 16.04 (xenial), I tried this fix and it worked for me

  1. curl https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.xenial_amd64.deb --location -o /tmp/wkhtmltox_0.12.5-1.xenial_amd64.deb
  2. sudo apt-get --assume-yes install /tmp/wkhtmltox_0.12.5-1.xenial_amd64.deb
  3. rm /tmp/wkhtmltox_0.12.5-1.xenial_amd64.deb
  4. wkhtmltopdf 'https://www.google.com' /tmp/google.pdf

thanks. you have saved me

barkamlesh commented 5 years ago

If anyone still having the issue on Ubuntu 16.04.6 LTS (check by typing lsb_release -a) try below that worked for me.

  1. sudo nano /etc/apt/sources.list
  2. add following line at the end of file
  3. sudo apt update && apt-cache policy libssl1.0-dev
  4. sudo apt-get install libssl1.0-dev

I have tried solution provided by @huyhoang1995 but that did not work for me. I am running latest wkhtmltopdf verison but when trying to install libssl1.0-dev I was getting below error.

E: Package 'libssl1.0-dev' has no installation candidate

aaroncastro1990 commented 4 years ago

For Fedora users, to fix this issue you have to install this lib: sudo dnf install compat-openssl10-devel.x86_64 -y

That worked! Thanks

jasminpatel commented 3 years ago

No need to install anything, this is not an issue with your wkhtmltopdf setup or installation.

It is just due to the content you are trying to render into your pdf, wkhtmltopdf does not accept the third-party content like CSS or JS directly from URL. As a solution you can do like below <link href="RELATIVE_CSS_FILE_PATH/style.css" rel="stylesheet"/> Put the relative path or

       <script type="text/javascript">
           //print javascript file content directly here, do not include js file by URL
        </script>
Qomaindo commented 3 years ago

No need to install anything, this is not an issue with your wkhtmltopdf setup or installation.

It is just due to the content you are trying to render into your pdf, wkhtmltopdf does not accept the third-party content like CSS or JS directly from URL. As a solution you can do like below <link href="RELATIVE_CSS_FILE_PATH/style.css" rel="stylesheet"/> Put the relative path or

      <script type="text/javascript">
          //print javascript file content directly here, do not include js file by URL
       </script>

This worked for me

cepho commented 2 years ago

No need to install anything, this is not an issue with your wkhtmltopdf setup or installation.

It is just due to the content you are trying to render into your pdf, wkhtmltopdf does not accept the third-party content like CSS or JS directly from URL. As a solution you can do like below <link href="RELATIVE_CSS_FILE_PATH/style.css" rel="stylesheet"/> Put the relative path or

      <script type="text/javascript">
          //print javascript file content directly here, do not include js file by URL
       </script>

which file is this needs to be changed.

luisfl commented 2 years ago

No need to install anything, this is not an issue with your wkhtmltopdf setup or installation.

It is just due to the content you are trying to render into your pdf, wkhtmltopdf does not accept the third-party content like CSS or JS directly from URL. As a solution you can do like below <link href="RELATIVE_CSS_FILE_PATH/style.css" rel="stylesheet"/> Put the relative path or

      <script type="text/javascript">
          //print javascript file content directly here, do not include js file by URL
       </script>

I do not have any CSS or JS reference, and also have the same problem. This began around April 2022.

Sopamo commented 1 year ago

I found this via google and did not find a way to install the package in an up to date version of ubuntu. I "fixed" this by downloading the file to the local disk first and embedding it from there.