phplaravelpdf-generationlaravel-snappy

Laravel 5.5 - Laravel-Snappy PDF Generation -> RuntimeException due to UnknownNetworkError


I'm using 5.5 of the framework and recently downloaded 0.12.5 (dev-master) of the wkhtmltopdf-amd64 package to try to resolve this error.

I know that this is typically due to SSL (https) urls in the html BUT I've gotten the file I'm trying to print to work and it does in my production environment.

I changed the new code in the test environment (which had been modified to use font awesome 5) back so that it only uses v4 of that. The links in the files (where 1 works and 1 does not) are the same as far as I can tell.

Are there other issues in my test file's html that would be causing the error shown here:

(1/1) RuntimeException
The exit status code '1' says something went wrong:
stderr: "Loading pages (1/6)
[> ] 0%
[======> ] 10%
QSslSocket: cannot resolve CRYPTO_num_locks
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
[========> ] 14%
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
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://mcentric-test.herokuapp.com/css/jumbotron.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
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
QSslSocket: cannot call unresolved function SSLv23_client_method
QSslSocket: cannot call unresolved function SSL_library_init
Warning: Failed to load https://mcentric-test.herokuapp.com/images/mCentric_logo.png (ignore)
Warning: Failed to load https://mcentric-test.herokuapp.com/images/meeting.jpg (ignore)
Warning: Failed to load https://mcentric-test.herokuapp.com/images/outlook.jpg (ignore)
Warning: Failed to load https://mcentric-test.herokuapp.com/images/google.jpg (ignore)
Warning: Failed to load https://mcentric-test.herokuapp.com/images/yahoo.jpg (ignore)
Warning: Failed to load https://mcentric-test.herokuapp.com/images/ical.jpg (ignore)
Warning: Failed to load https://mcentric-test.herokuapp.com/images/mCentric_logo_blue.png (ignore)
[============================================================] 100%
Counting pages (2/6) 
[============================================================] Object 1 of 1
Resolving links (4/6) 
[============================================================] Object 1 of 1
Loading headers and footers (5/6) 
Printing pages (6/6)
[> ] Preparing
[============================================================] Page 1 of 1
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
"
stdout: ""
command: /app/vendor/bin/wkhtmltopdf-amd64 --lowquality --load-error-handling 'ignore' '/tmp/knp_snappy5bd9df39f00ca0.32809410.html' '/tmp/knp_snappy5bd9df39f02363.36498894.pdf'.

in AbstractGenerator.php line 378

html produced from test server

html produced on production server (that does NOT error out) To restate, the look and feel that requires the 6 https links for formatting does successfully create a PDF using the 0.12.4 binary.

And both the 0.12.4 and 0.12.5 binaries (when tried in the test environment) failed to create the PDF and result in the error text above.


Solution

  • I'm posting this answer to save someone the pain of constantly reviewing this in the future.

    The test and production environments are heroku-hosted environments.

    The wkhtmltopdf-amd64 binary worked fine on the cedar-14 stack (production).

    The test environment's stack had been upgraded and that seems to be the reason why it stopped working.