wkhtmltopdf Exit with code 1 due to network error: HostNotFoundError - wkhtmltopdf

I'm running wkhtmltopdf 0.12.1.4 (with patched qt) from a Django application using django-wkhtmltopdf. On my PC it is running fine, but when I load onto a DigitalOcean VPS it is generating the following error.
Command '['/usr/bin/wkhtmltopdf', '-B', '0', '-L', '0', '-R', '0',
'-T', '0', '--allow', 'True', '--enable-local-file-access',
'--encoding', 'utf8', '--javascript-delay', '2000',
'--page-height', '465mm', '--page-width',
'297mm', '--quiet', '/tmp/wkhtmltopdf0xetqkp3.html', '-']' returned
non-zero exit status 1.
When I run this from the command line:
/usr/bin/wkhtmltopdf -B 0 -L 0 -R 0 -T 0 --allow True --enable-local-file-access --encoding utf8 --javascript-delay 2000 --page-height 465mm --page-width 297mm --quiet /tmp/wkhtmltopdf5_sl271s.html -
I get the following output:
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
Error: Failed loading page http:///tmp/wkhtmltopdf5_sl271s.html (sometimes it will work just to ignore this error with --load-error-handling ignore)
Exit with code 1 due to network error: HostNotFoundError
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
It seems to be trying to pick up the file from http://... rather than the tmp folder so I think I have some settings wrong.
Could anyone help?
Thanks

Related

Why this error is showing while writing code

Compilation errors for PROCEDURE MTR.MTR_DAILY_MAIL_REPORT_PRC1
Error: PLS-00201: identifier 'EXCELFILE.EXCEL_OPEN' must be declared
Line: 54
Text: Excelfile.Excel_Open(Excel_Data);

How to solve Fatal error: Uncaught Error: Call to undefined method PHPUnit_Util_Configuration::getTestdoxGroupConfiguration()?

When I run phpunit on the command promp, there exist error like this :
Fatal error: Uncaught Error: Call to undefined method PHPUnit_Util_Configuration::getTestdoxGroupConfiguration() in C:\xampp\htdocs\myshop\vendor\phpunit\phpunit\src\TextUI\TestRunner.php:1076
Stack trace:
#0 C:\xampp\htdocs\myshop\vendor\phpunit\phpunit\src\TextUI\TestRunner.php(167): PHPUnit_TextUI_TestRunner->handleConfiguration(Array)
#1 C:\xampp\php\pear\PHPUnit\TextUI\Command.php(176): PHPUnit_TextUI_TestRunner->doRun(Object(PHPUnit_Framework_TestSuite), Array)
#2 C:\xampp\php\pear\PHPUnit\TextUI\Command.php(129): PHPUnit_TextUI_Command->run(Array, true)
#3 C:\xampp\php\phpunit(46): PHPUnit_TextUI_Command::main()
#4 {main}
thrown in C:\xampp\htdocs\myshop\vendor\phpunit\phpunit\src\TextUI\TestRunner.php on line 1076
PHP Fatal error: Uncaught Error: Call to undefined method PHPUnit_Util_Configuration::getTestdoxGroupConfiguration() in C:\xampp\htdocs\myshop\vendor\phpunit\phpunit\src\TextUI\TestRunner.php:1076
Stack trace:
#0 C:\xampp\htdocs\myshop\vendor\phpunit\phpunit\src\TextUI\TestRunner.php(167): PHPUnit_TextUI_TestRunner->handleConfiguration(Array)
#1 C:\xampp\php\pear\PHPUnit\TextUI\Command.php(176): PHPUnit_TextUI_TestRunner->doRun(Object(PHPUnit_Framework_TestSuite), Array)
#2 C:\xampp\php\pear\PHPUnit\TextUI\Command.php(129): PHPUnit_TextUI_Command->run(Array, true)
#3 C:\xampp\php\phpunit(46): PHPUnit_TextUI_Command::main()
#4 {main}
thrown in C:\xampp\htdocs\myshop\vendor\phpunit\phpunit\src\TextUI\TestRunner.php on line 1076
I want to test event to send email is working or not
How can I solve it?

Error in XInternAtom as ' X Error of failed request: BadValue (integer parameter out of range for operation)'

I am trying to run our game application on ubuntu 16.0.4 and it throws the following error:
libGL error: driver pointer missing
libGL error: failed to load driver: nouveau
libGL error: unable to load driver: swrast_dri.so
libGL error: failed to load driver: swrast
X Error of failed request: BadValue (integer parameter out of range for operation)
Major opcode of failed request: 155 (GLX)
Minor opcode of failed request: 3 (X_GLXCreateContext)
Value in failed request: 0x0
Serial number of failed request: 42
Current serial number in output stream: 44
I ran the backtrace on my application and got the following:
Thread 34 (Thread 0xa11f9b40 (LWP 20075)):
#0 0x010d2e74 in g2s::engine::G2SMtp::~G2SMtp (this=0x2383c94 <g2sEngine+4660>, __in_chrg=<optimized out>)
at g2sengine/g2smtp.cpp:42
#1 0x00f997b8 in g2s::engine::G2SEngine::~G2SEngine (this=0x2382a60 <g2sEngine>, __in_chrg=<optimized out>)
at ../../include/../src/g2senginelib/g2sengine/g2sengine.h:75
#2 0xb64e0973 in __run_exit_handlers (status=1, listp=0xb66643dc <__exit_funcs>, run_list_atexit=true) at exit.c:82
#3 0xb64e09cf in __GI_exit (status=1) at exit.c:104
#4 0xb6b72109 in _XDefaultError () from /usr/lib/i386-linux-gnu/libX11.so.6
#5 0xb6b7223a in _XError () from /usr/lib/i386-linux-gnu/libX11.so.6
#6 0xb6b6f1db in ?? () from /usr/lib/i386-linux-gnu/libX11.so.6
#7 0xb6b6f29f in ?? () from /usr/lib/i386-linux-gnu/libX11.so.6
#8 0xb6b7017e in _XReply () from /usr/lib/i386-linux-gnu/libX11.so.6
#9 0xb6b5a755 in XInternAtom () from /usr/lib/i386-linux-gnu/libX11.so.6
#10 0x005f310d in start_x11_screen (nscreen=0, Xres=1280, Yres=1024, client_visual_attributes=0x0) at glxctx.c:4596
I would like to know how to read the X11 errors, is there a reference manual which can give me details corresponding to numbers 155 (GLX) , 3 (X_GLXCreateContext) and 42 , 44. How to read these errors ?
Also,any idea what could be wrong here ?

Could not spawn process for group /var/www/rubycas

[ 2014-02-10 13:51:00.0173 22995/7f012fa3b700 Pool2/Implementation.cpp:883 ]: Could not spawn process for group /var/www/rubycas#default: An error occurred while starting up the preloader: it did not write a startup response in time.
in 'void Passenger::ApplicationPool2::SmartSpawner::throwPreloaderSpawnException(const string&, Passenger::SpawnException::ErrorKind, Passenger::ApplicationPool2::Spawner::BackgroundIOCapturerPtr&, const DebugDirPtr&)' (SmartSpawner.h:146)
in 'std::string Passenger::ApplicationPool2::SmartSpawner::negotiatePreloaderStartup(Passenger::ApplicationPool2::SmartSpawner::StartupDetails&)' (SmartSpawner.h:566)
in 'void Passenger::ApplicationPool2::SmartSpawner::startPreloader()' (SmartSpawner.h:206)
in 'virtual Passenger::ApplicationPool2::ProcessPtr Passenger::ApplicationPool2::SmartSpawner::spawn(const Passenger::ApplicationPool2::Options&)' (SmartSpawner.h:752)
in 'void Passenger::ApplicationPool2::Group::spawnThreadRealMain(const SpawnerPtr&, const Passenger::ApplicationPool2::Options&, unsigned int)' (Implementation.cpp:804)
[ 2014-02-10 13:51:00.0253 22995/7f0127fff700 agents/HelperAgent/RequestHandler.h:2088 ]: [Client 20] Cannot checkout session.
This is the error i encountered when i'm trying to access rubycas over apache
Rails 2.3.8
Phusion Passenger version 4.0.37
Ruby 1.8
Thanks,
Swaroop
Try taking a look at this troubleshooting page: Debugging startup problems

qwebview in pyside after packaged with pyinstaller goes wrong

Here's my code
import sys
from PySide.QtCore import *
from PySide.QtGui import *
from PySide.QtWebKit import *
from encodings import *
from codecs import *
class BrowserWindow( QWidget ):
def __init__( self, parent=None ):
QWidget.__init__( self, parent )
self.Setup()
self.SetupEvent()
def Setup( self ):
self.setWindowTitle( u"Truease Speedy Browser" )
self.addr_input = QLineEdit()
self.addr_go = QPushButton( "GO" )
self.addr_bar = QHBoxLayout()
self.addr_bar.addWidget( self.addr_input )
self.addr_bar.addWidget( self.addr_go )
for attr in [
QWebSettings.AutoLoadImages,
QWebSettings.JavascriptEnabled,
QWebSettings.JavaEnabled,
QWebSettings.PluginsEnabled,
QWebSettings.JavascriptCanOpenWindows,
QWebSettings.JavascriptCanAccessClipboard,
QWebSettings.DeveloperExtrasEnabled,
QWebSettings.SpatialNavigationEnabled,
QWebSettings.OfflineStorageDatabaseEnabled,
QWebSettings.OfflineWebApplicationCacheEnabled,
QWebSettings.LocalStorageEnabled,
QWebSettings.LocalStorageDatabaseEnabled,
QWebSettings.LocalContentCanAccessRemoteUrls,
QWebSettings.LocalContentCanAccessFileUrls,
]:
QWebSettings.globalSettings().setAttribute( attr, True )
self.web_view = QWebView()
self.web_view.load( "http://www.baidu.com" )
layout = QVBoxLayout()
layout.addLayout( self.addr_bar )
layout.addWidget( self.web_view )
self.setLayout( layout )
def SetupEvent( self ):
self.connect(
self.addr_input,
SIGNAL("editingFinished()"),
self,
SLOT("Load()"),
)
self.connect(
self.addr_go,
SIGNAL("pressed()"),
self,
SLOT("Load()")
)
self.connect(
self.web_view,
SIGNAL("urlChanged(const QUrl&)"),
self,
SLOT("SetURL()"),
)
def Load( self, *args, **kwargs ):
url = self.GetCleanedURL()
if url != self.CurrentURL():
self.web_view.load( url )
def SetURL( self, *args, **kwargs ):
self.addr_input.setText( self.CurrentURL() )
def GetCleanedURL( self ):
url = self.addr_input.text().strip()
if not url.startswith("http"):
url = "http://" + url
return url
def CurrentURL( self ):
url = self.web_view.url().toString()
return url
def Main():
app = QApplication( sys.argv )
widget = BrowserWindow()
widget.show()
return app.exec_()
if __name__ == '__main__':
sys.exit( Main() )
I works well when i using python browser.py. but it goes wrong after packaged with pyinstaller -w browser.py.
it doesn't load images
can only display correct text in utf-8
And this is the pyinstaller output:
E:\true\wuk\app2>pyinstaller -w b.py
16 INFO: wrote E:\true\wuk\app2\b.spec
16 INFO: Testing for ability to set icons, version resources...
32 INFO: ... resource update available
32 INFO: UPX is not available.
46 INFO: Processing hook hook-os
141 INFO: Processing hook hook-time
157 INFO: Processing hook hook-cPickle
218 INFO: Processing hook hook-_sre
312 INFO: Processing hook hook-cStringIO
407 INFO: Processing hook hook-encodings
421 INFO: Processing hook hook-codecs
750 INFO: Processing hook hook-httplib
750 INFO: Processing hook hook-email
843 INFO: Processing hook hook-email.message
1046 WARNING: library python%s%s required via ctypes not found
1171 INFO: Extending PYTHONPATH with E:\true\wuk\app2
1171 INFO: checking Analysis
1171 INFO: building because b.py changed
1171 INFO: running Analysis out00-Analysis.toc
1171 INFO: Adding Microsoft.VC90.CRT to dependent assemblies of final executable
1171 INFO: Searching for assembly x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.21022.8_x-ww ...
1171 INFO: Found manifest C:\WINDOWS\WinSxS\Manifests\x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.21022.8_x-ww_d08d0375.manifest
1187 INFO: Searching for file msvcr90.dll
1187 INFO: Found file C:\WINDOWS\WinSxS\x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.21022.8_x-ww_d08d0375\msvcr90.dll
1187 INFO: Searching for file msvcp90.dll
1187 INFO: Found file C:\WINDOWS\WinSxS\x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.21022.8_x-ww_d08d0375\msvcp90.dll
1187 INFO: Searching for file msvcm90.dll
1187 INFO: Found file C:\WINDOWS\WinSxS\x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.21022.8_x-ww_d08d0375\msvcm90.dll
1266 INFO: Analyzing D:\Applications\Python\lib\site-packages\pyinstaller-2.1-py2.7.egg\PyInstaller\loader\_pyi_bootstrap.py
1266 INFO: Processing hook hook-os
1282 INFO: Processing hook hook-site
1296 INFO: Processing hook hook-encodings
1391 INFO: Processing hook hook-time
1407 INFO: Processing hook hook-cPickle
1468 INFO: Processing hook hook-_sre
1578 INFO: Processing hook hook-cStringIO
1671 INFO: Processing hook hook-codecs
2016 INFO: Processing hook hook-httplib
2016 INFO: Processing hook hook-email
2109 INFO: Processing hook hook-email.message
2312 WARNING: library python%s%s required via ctypes not found
2468 INFO: Processing hook hook-pydoc
2516 INFO: Analyzing D:\Applications\Python\lib\site-packages\pyinstaller-2.1-py2.7.egg\PyInstaller\loader\pyi_importers.py
2609 INFO: Analyzing D:\Applications\Python\lib\site-packages\pyinstaller-2.1-py2.7.egg\PyInstaller\loader\pyi_archive.py
2687 INFO: Analyzing D:\Applications\Python\lib\site-packages\pyinstaller-2.1-py2.7.egg\PyInstaller\loader\pyi_carchive.py
2782 INFO: Analyzing D:\Applications\Python\lib\site-packages\pyinstaller-2.1-py2.7.egg\PyInstaller\loader\pyi_os_path.py
2782 INFO: Analyzing b.py
2796 INFO: Processing hook hook-PySide
2875 INFO: Hidden import 'codecs' has been found otherwise
2875 INFO: Hidden import 'encodings' has been found otherwise
2875 INFO: Looking for run-time hooks
7766 INFO: Using Python library C:\WINDOWS\system32\python27.dll
7796 INFO: E:\true\wuk\app2\build\b\out00-Analysis.toc no change!
7796 INFO: checking PYZ
7812 INFO: checking PKG
7812 INFO: building because E:\true\wuk\app2\build\b\b.exe.manifest changed
7812 INFO: building PKG (CArchive) out00-PKG.pkg
7828 INFO: checking EXE
7843 INFO: rebuilding out00-EXE.toc because pkg is more recent
7843 INFO: building EXE from out00-EXE.toc
7843 INFO: Appending archive to EXE E:\true\wuk\app2\build\b\b.exe
7843 INFO: checking COLLECT
7843 INFO: building COLLECT out00-COLLECT.toc
Use pyinstaller browser.py, and in the console window i got
QFont::setPixelSize: Pixel size <= 0 (0)
QSslSocket: cannot call unresolved function SSLv23_client_method
QSslSocket: cannot call unresolved function SSL_CTX_new
QSslSocket: cannot call unresolved function SSL_library_init
QSslSocket: cannot call unresolved function ERR_get_error
QSslSocket: cannot call unresolved function SSLv23_client_method
QSslSocket: cannot call unresolved function SSL_CTX_new
QSslSocket: cannot call unresolved function SSL_library_init
QSslSocket: cannot call unresolved function ERR_get_error
QSslSocket: cannot call unresolved function SSLv23_client_method
QSslSocket: cannot call unresolved function SSL_CTX_new
QSslSocket: cannot call unresolved function SSL_library_init
QSslSocket: cannot call unresolved function ERR_get_error
QSslSocket: cannot call unresolved function SSLv23_client_method
QSslSocket: cannot call unresolved function SSL_CTX_new
QSslSocket: cannot call unresolved function SSL_library_init
QSslSocket: cannot call unresolved function ERR_get_error
QFont::setPixelSize: Pixel size <= 0 (0)
I encountered this same problem. It is caused by PyInstaller using incorrect versions of ssleay32.dll and libeay32.dll.
To fix, download and install "Win32 OpenSSL v1.0.1e".
Then create a spec file for your PyInstaller project:
pyi-makespec browser.py
Open your spec file, named browser.spec, and below the a = Analysis(['browser.py']) line, add:
for d in range(len(a.binaries)):
if a.binaries[d][0].lower() == 'ssleay32.dll':
print a.binaries[d]
a.binaries[d] = ('ssleay32.dll', 'C:\\\OpenSSL-Win32\\ssleay32.dll', 'BINARY')
if a.binaries[d][0].lower() == 'libeay32.dll':
print a.binaries[d]
a.binaries[d] = ('libeay32.dll', 'C:\\OpenSSL-Win32\\libeay32.dll', 'BINARY')
This will tell PyInstaller to use the OpenSSL-Win32 dlls instead of the ones your Python installation is using.
When running the Python script, my Python installation preferred the DLLs in my system path to those installed by pyOpenSSL/egenix, but when bundling with PyInstaller, it seems to prefer the pyOpenSSL/egenix ones. This should fix that.

Resources