help required on hosting tg2 app on uwsgi

18 views
Skip to first unread message

D R Dinesh Kumar

unread,
Mar 22, 2017, 10:41:51 PM3/22/17
to TurboGears
Hi All,

I am trying to host tg2 app on uwsgi.

my uwsgi.ini file contains:
---------------------------------------
[uwsgi]
module = wsgi:application
master = true
processes = 1
socket = app.sock
chmod-socket = 664
vacuum = true
die-on-term = true
lazy = true

and wsgi.py contains:
--------------------------------
APP_CONFIG = 'path-to-production.ini'
from paste.deploy import loadapp
application = loadapp('config:%s' % APP_CONFIG)

I am not sure if wsgi.py has the right way of calling the application for uwsgi. 

Please help.

With Regards,
Dinesh.




D R Dinesh Kumar

unread,
Mar 23, 2017, 12:06:21 AM3/23/17
to TurboGears
can some one please help ??

I tried uwsgi --paste <production.ini> but that also gives me "uwsgi segmentation fault error" and doesn't host the application.
All the previous threads on this topic have expired links and so actual help from them.

Help on this is really appreciated

With Regards,
Dinesh.

D R Dinesh Kumar

unread,
Mar 23, 2017, 2:24:49 AM3/23/17
to TurboGears
Full backtrace of error:

!!! uWSGI process 28030 got Segmentation Fault !!!
*** backtrace of 28030 ***
/u/vgtools2/VPython2.7/bin/uwsgi(uwsgi_backtrace+0x29) [0x46d2a9]
/u/vgtools2/VPython2.7/bin/uwsgi(uwsgi_segfault+0x21) [0x46d431]
/lib64/libc.so.6(+0x326a0) [0x7ffff59e86a0]
/usr/lib64/libcrypto.so.10(EVP_PKEY_CTX_dup+0x20) [0x7ffff6996d60]
/usr/lib64/libcrypto.so.10(EVP_MD_CTX_copy_ex+0xbd) [0x7ffff6988c3d]
/remote/vtghome9/vgtools2/VPython2.7/lib/python2.7/lib-dynload/_hashlib.so(+0x1a4a) [0x7fffeaf8fa4a]
/remote/vtghome9/vgtools2/VPython2.7/lib/python2.7/lib-dynload/_hashlib.so(+0x1dd0) [0x7fffeaf8fdd0]
/depot/Python-2.7/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x66da) [0x7ffff606c3ba]
/depot/Python-2.7/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x5fd7) [0x7ffff606bcb7]
/depot/Python-2.7/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x8c9) [0x7ffff606d9a9]
/depot/Python-2.7/lib/libpython2.7.so.1.0(PyEval_EvalCode+0x32) [0x7ffff606da22]
/depot/Python-2.7/lib/libpython2.7.so.1.0(PyImport_ExecCodeModuleEx+0xc2) [0x7ffff6080cf2]
/depot/Python-2.7/lib/libpython2.7.so.1.0(+0x1023be) [0x7ffff60833be]
/depot/Python-2.7/lib/libpython2.7.so.1.0(+0x102b60) [0x7ffff6083b60]
/depot/Python-2.7/lib/libpython2.7.so.1.0(+0x1030b1) [0x7ffff60840b1]
/depot/Python-2.7/lib/libpython2.7.so.1.0(PyImport_ImportModuleLevel+0x118) [0x7ffff60842c8]
/depot/Python-2.7/lib/libpython2.7.so.1.0(+0xe392d) [0x7ffff606492d]
/depot/Python-2.7/lib/libpython2.7.so.1.0(PyObject_Call+0x68) [0x7ffff5fc6708]
/depot/Python-2.7/lib/libpython2.7.so.1.0(PyEval_CallObjectWithKeywords+0x56) [0x7ffff6064f76]
/depot/Python-2.7/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x381c) [0x7ffff60694fc]
/depot/Python-2.7/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x8c9) [0x7ffff606d9a9]
/depot/Python-2.7/lib/libpython2.7.so.1.0(PyEval_EvalCode+0x32) [0x7ffff606da22]
/depot/Python-2.7/lib/libpython2.7.so.1.0(PyImport_ExecCodeModuleEx+0xc2) [0x7ffff6080cf2]
/depot/Python-2.7/lib/libpython2.7.so.1.0(+0x1023be) [0x7ffff60833be]
/depot/Python-2.7/lib/libpython2.7.so.1.0(+0x102b60) [0x7ffff6083b60]
/depot/Python-2.7/lib/libpython2.7.so.1.0(+0x103032) [0x7ffff6084032]
/depot/Python-2.7/lib/libpython2.7.so.1.0(PyImport_ImportModuleLevel+0x15d) [0x7ffff608430d]
/depot/Python-2.7/lib/libpython2.7.so.1.0(+0xe392d) [0x7ffff606492d]
/depot/Python-2.7/lib/libpython2.7.so.1.0(PyObject_Call+0x68) [0x7ffff5fc6708]
/depot/Python-2.7/lib/libpython2.7.so.1.0(PyEval_CallObjectWithKeywords+0x56) [0x7ffff6064f76]
/depot/Python-2.7/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x381c) [0x7ffff60694fc]
/depot/Python-2.7/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x8c9) [0x7ffff606d9a9]
/depot/Python-2.7/lib/libpython2.7.so.1.0(PyEval_EvalCode+0x32) [0x7ffff606da22]
/depot/Python-2.7/lib/libpython2.7.so.1.0(PyImport_ExecCodeModuleEx+0xc2) [0x7ffff6080cf2]
/depot/Python-2.7/lib/libpython2.7.so.1.0(+0x1023be) [0x7ffff60833be]
/depot/Python-2.7/lib/libpython2.7.so.1.0(+0x10410d) [0x7ffff608510d]
/depot/Python-2.7/lib/libpython2.7.so.1.0(+0x102b60) [0x7ffff6083b60]
/depot/Python-2.7/lib/libpython2.7.so.1.0(+0x1030b1) [0x7ffff60840b1]
/depot/Python-2.7/lib/libpython2.7.so.1.0(PyImport_ImportModuleLevel+0x118) [0x7ffff60842c8]
/depot/Python-2.7/lib/libpython2.7.so.1.0(+0xe392d) [0x7ffff606492d]
/depot/Python-2.7/lib/libpython2.7.so.1.0(PyObject_Call+0x68) [0x7ffff5fc6708]
/depot/Python-2.7/lib/libpython2.7.so.1.0(PyEval_CallObjectWithKeywords+0x56) [0x7ffff6064f76]
/depot/Python-2.7/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x381c) [0x7ffff60694fc]
/depot/Python-2.7/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x8c9) [0x7ffff606d9a9]
/depot/Python-2.7/lib/libpython2.7.so.1.0(PyEval_EvalCode+0x32) [0x7ffff606da22]
/depot/Python-2.7/lib/libpython2.7.so.1.0(PyImport_ExecCodeModuleEx+0xc2) [0x7ffff6080cf2]
/depot/Python-2.7/lib/libpython2.7.so.1.0(+0x1023be) [0x7ffff60833be]
/depot/Python-2.7/lib/libpython2.7.so.1.0(+0x102b60) [0x7ffff6083b60]
/depot/Python-2.7/lib/libpython2.7.so.1.0(+0x103032) [0x7ffff6084032]
/depot/Python-2.7/lib/libpython2.7.so.1.0(PyImport_ImportModuleLevel+0x15d) [0x7ffff608430d]
/depot/Python-2.7/lib/libpython2.7.so.1.0(+0xe392d) [0x7ffff606492d]
/depot/Python-2.7/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x5dd3) [0x7ffff606bab3]
/depot/Python-2.7/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x8c9) [0x7ffff606d9a9]
*** end of backtrace ***
Segmentation fault

With Regards,
Dinesh.

Alessandro Molina

unread,
Mar 23, 2017, 3:28:34 AM3/23/17
to TurboGears
The easiest way to serve a TG app through uwsgi is surely through Paste Support -> http://uwsgi-docs.readthedocs.io/en/latest/Python.html#paste-support

If you receive a segfault it's probably better to get in touch with the UWSGI mailing list. 
Even wrongly configured things shouldn't lead to segfaults, so you might be facing some bug or packaging issues.




--
You received this message because you are subscribed to the Google Groups "TurboGears" group.
To unsubscribe from this group and stop receiving emails from it, send an email to turbogears+unsubscribe@googlegroups.com.
To post to this group, send email to turbo...@googlegroups.com.
Visit this group at https://groups.google.com/group/turbogears.
For more options, visit https://groups.google.com/d/optout.

D R Dinesh Kumar

unread,
Mar 23, 2017, 3:53:06 AM3/23/17
to TurboGears
Hi Alessandro,

Yes, I have contacted uWSGI mailing list and waiting for their reply.
I have seen a lot of people complaining about the same issue and the solutions are always different. 
I have the latest version of uwsgi and not really sure what went wrong here.

Thank you for your input here.
will wait for uwsgi mailing list to reply. 
To unsubscribe from this group and stop receiving emails from it, send an email to turbogears+...@googlegroups.com.

D R Dinesh Kumar

unread,
Mar 25, 2017, 3:42:47 AM3/25/17
to TurboGears
The OpenSSL versions are different between python and uwsgi. Uwsgi took system OpenSSL version which is different from python.
Had to re-install python with required OpenSSL version by making changes to Modules/setup.dist and Modules/setup files. If required, even setup.py also might need changes to look at right path for OpenSSL libs.
This has fixed the issue.

Thank you all.

Reply all
Reply to author
Forward
0 new messages