Saleor: Heroku uWSGI integration problem

Created on 24 Sep 2019  路  5Comments  路  Source: mirumee/saleor

Hi there, I was sucessfully using saleor to run my e-commerce platform with Heroku for over 6 months (with no changes for the last 2 months). It was all right until today. I got a Segmentation Fault on uWSGI.

I tried everything what I found on the Internet about this problem, but to no avail. Maybe some of you are concerned about what is happening here. It is particularly strange because I did not change anything and the code just stopped working.

Thanks for all answers. Keep up the good work!

Find the logs from Heroku attached.

`2019-09-24T20:36:38.536320+00:00 app[web.1]: * uWSGI is running in multiple interpreter mode *

2019-09-24T20:36:38.536323+00:00 app[web.1]: spawned uWSGI master process (pid: 4)

2019-09-24T20:36:38.539825+00:00 app[web.1]: spawned uWSGI worker 1 (pid: 11, cores: 1)

2019-09-24T20:36:38.542098+00:00 app[web.1]: spawned uWSGI worker 2 (pid: 12, cores: 1)

2019-09-24T20:36:38.544163+00:00 app[web.1]: spawned uWSGI worker 3 (pid: 13, cores: 1)

2019-09-24T20:36:38.546455+00:00 app[web.1]: spawned uWSGI worker 4 (pid: 14, cores: 1)

**2019-09-24T20:36:42.172640+00:00 heroku[router]: at=error code=H13 desc="Connection closed without response" method=GET path="/" host=atena-test2.herokuapp.com request_id=0963b2ab-e939-4dc2-bd5e-bf440b8f9ea0 fwd="159.205.241.212" dyno=web.1 connect=1ms service=5317ms status=503 bytes=0 protocol=https

2019-09-24T20:36:42.069020+00:00 app[web.1]: !!! uWSGI process 11 got Segmentation Fault !!!**

2019-09-24T20:36:42.090638+00:00 app[web.1]: * backtrace of 11 *

2019-09-24T20:36:42.090643+00:00 app[web.1]: uwsgi(uwsgi_backtrace+0x2a) [0x55917384a79a]

2019-09-24T20:36:42.090645+00:00 app[web.1]: uwsgi(uwsgi_segfault+0x23) [0x55917384ab83]

2019-09-24T20:36:42.090648+00:00 app[web.1]: /lib/x86_64-linux-gnu/libc.so.6(+0x3ef20) [0x7f6c54faef20]

2019-09-24T20:36:42.090658+00:00 app[web.1]: /app/.heroku/python/lib/python3.6/site-packages/psycopg2/.libs/./libssl-1d6df745.so.1.0.2p(ssl3_cleanup_key_block+0xb) [0x7f6c4b6d4cab]

2019-09-24T20:36:42.090663+00:00 app[web.1]: /app/.heroku/python/lib/python3.6/site-packages/psycopg2/.libs/./libssl-1d6df745.so.1.0.2p(ssl3_clear+0x16) [0x7f6c4b6d25a6]

2019-09-24T20:36:42.090666+00:00 app[web.1]: /app/.heroku/python/lib/python3.6/site-packages/psycopg2/.libs/./libssl-1d6df745.so.1.0.2p(tls1_clear+0x9) [0x7f6c4b6de219]

2019-09-24T20:36:42.090669+00:00 app[web.1]: /usr/lib/x86_64-linux-gnu/libssl.so.1.1(SSL_new+0x3f2) [0x7f6c56062a22]

2019-09-24T20:36:42.090671+00:00 app[web.1]: /app/.heroku/python/lib/python3.6/site-packages/psycopg2/.libs/libpq-3a62a61f.so.5.11(+0x23969) [0x7f6c4b969969]

2019-09-24T20:36:42.090673+00:00 app[web.1]: /app/.heroku/python/lib/python3.6/site-packages/psycopg2/.libs/libpq-3a62a61f.so.5.11(+0x24fc5) [0x7f6c4b96afc5]

2019-09-24T20:36:42.090675+00:00 app[web.1]: /app/.heroku/python/lib/python3.6/site-packages/psycopg2/.libs/libpq-3a62a61f.so.5.11(PQconnectPoll+0xb78) [0x7f6c4b954ba8]

2019-09-24T20:36:42.090680+00:00 app[web.1]: /app/.heroku/python/lib/python3.6/site-packages/psycopg2/.libs/libpq-3a62a61f.so.5.11(+0xfa28) [0x7f6c4b955a28]

2019-09-24T20:36:42.090683+00:00 app[web.1]: /app/.heroku/python/lib/python3.6/site-packages/psycopg2/.libs/libpq-3a62a61f.so.5.11(PQconnectdb+0x1f) [0x7f6c4b95841f]

2019-09-24T20:36:42.090685+00:00 app[web.1]: /app/.heroku/python/lib/python3.6/site-packages/psycopg2/_psycopg.cpython-36m-x86_64-linux-gnu.so(+0x12651) [0x7f6c4bba9651]

2019-09-24T20:36:42.090687+00:00 app[web.1]: /app/.heroku/python/lib/python3.6/site-packages/psycopg2/_psycopg.cpython-36m-x86_64-linux-gnu.so(+0x133df) [0x7f6c4bbaa3df]

2019-09-24T20:36:42.090689+00:00 app[web.1]: uwsgi(+0x1a4377) [0x559173911377]

2019-09-24T20:36:42.090691+00:00 app[web.1]: uwsgi(_PyObject_FastCallDict+0xb3) [0x5591738962c3]

2019-09-24T20:36:42.090693+00:00 app[web.1]: uwsgi(_PyObject_CallFunction_SizeT+0x244) [0x559173896f64]

2019-09-24T20:36:42.090695+00:00 app[web.1]: /app/.heroku/python/lib/python3.6/site-packages/psycopg2/_psycopg.cpython-36m-x86_64-linux-gnu.so(+0xc1a8) [0x7f6c4bba31a8]

2019-09-24T20:36:42.090697+00:00 app[web.1]: uwsgi(PyCFunction_Call+0x33) [0x5591738f6ef3]

2019-09-24T20:36:42.090699+00:00 app[web.1]: uwsgi(_PyEval_EvalFrameDefault+0x6d98) [0x559173973f18]

2019-09-24T20:36:42.090701+00:00 app[web.1]: uwsgi(+0x1fec53) [0x55917396bc53]

2019-09-24T20:36:42.090703+00:00 app[web.1]: uwsgi(PyEval_EvalCodeEx+0x3e) [0x55917396ccde]

2019-09-24T20:36:42.090705+00:00 app[web.1]: uwsgi(+0x15048d) [0x5591738bd48d]

2019-09-24T20:36:42.090707+00:00 app[web.1]: uwsgi(PyObject_Call+0x3e) [0x5591738960be]

2019-09-24T20:36:42.090710+00:00 app[web.1]: uwsgi(_PyEval_EvalFrameDefault+0x1c2a) [0x55917396edaa]

2019-09-24T20:36:42.090712+00:00 app[web.1]: uwsgi(+0x1fe128) [0x55917396b128]

2019-09-24T20:36:42.090714+00:00 app[web.1]: uwsgi(+0x1ff196) [0x55917396c196]

2019-09-24T20:36:42.090716+00:00 app[web.1]: uwsgi(_PyEval_EvalFrameDefault+0x3740) [0x5591739708c0]

2019-09-24T20:36:42.090718+00:00 app[web.1]: uwsgi(+0x1fe128) [0x55917396b128]

2019-09-24T20:36:42.090720+00:00 app[web.1]: uwsgi(+0x1ff196) [0x55917396c196]

2019-09-24T20:36:42.090722+00:00 app[web.1]: uwsgi(_PyEval_EvalFrameDefault+0x3740) [0x5591739708c0]

2019-09-24T20:36:42.090725+00:00 app[web.1]: uwsgi(+0x1fe128) [0x55917396b128]

2019-09-24T20:36:42.090727+00:00 app[web.1]: uwsgi(+0x1ff196) [0x55917396c196]

2019-09-24T20:36:42.090729+00:00 app[web.1]: uwsgi(_PyEval_EvalFrameDefault+0x3740) [0x5591739708c0]

2019-09-24T20:36:42.090731+00:00 app[web.1]: uwsgi(+0x1fec53) [0x55917396bc53]

2019-09-24T20:36:42.090733+00:00 app[web.1]: uwsgi(+0x1feeed) [0x55917396beed]

2019-09-24T20:36:42.090735+00:00 app[web.1]: uwsgi(_PyEval_EvalFrameDefault+0x3740) [0x5591739708c0]

2019-09-24T20:36:42.090737+00:00 app[web.1]: uwsgi(+0x1fe128) [0x55917396b128]

2019-09-24T20:36:42.090739+00:00 app[web.1]: uwsgi(+0x1ff196) [0x55917396c196]

2019-09-24T20:36:42.090741+00:00 app[web.1]: uwsgi(_PyEval_EvalFrameDefault+0x3740) [0x5591739708c0]

2019-09-24T20:36:42.090743+00:00 app[web.1]: uwsgi(+0x1fec53) [0x55917396bc53]

2019-09-24T20:36:42.090745+00:00 app[web.1]: uwsgi(+0x1feeed) [0x55917396beed]

2019-09-24T20:36:42.090747+00:00 app[web.1]: uwsgi(_PyEval_EvalFrameDefault+0x1ad5) [0x55917396ec55]

2019-09-24T20:36:42.090750+00:00 app[web.1]: uwsgi(+0x2c4307) [0x559173a31307]

2019-09-24T20:36:42.090752+00:00 app[web.1]: uwsgi(+0x1562fe) [0x5591738c32fe]

2019-09-24T20:36:42.090754+00:00 app[web.1]: uwsgi(+0x1567dd) [0x5591738c37dd]

2019-09-24T20:36:42.090756+00:00 app[web.1]: uwsgi(+0x1a4377) [0x559173911377]

2019-09-24T20:36:42.090758+00:00 app[web.1]: uwsgi(_PyObject_FastCallDict+0xb3) [0x5591738962c3]

2019-09-24T20:36:42.090760+00:00 app[web.1]: uwsgi(+0x1fedb0) [0x55917396bdb0]

2019-09-24T20:36:42.090762+00:00 app[web.1]: uwsgi(_PyEval_EvalFrameDefault+0x3740) [0x5591739708c0]

2019-09-24T20:36:42.090765+00:00 app[web.1]: uwsgi(+0x1fe128) [0x55917396b128]

2019-09-24T20:36:42.090767+00:00 app[web.1]: uwsgi(+0x1ff196) [0x55917396c196]

2019-09-24T20:36:42.090769+00:00 app[web.1]: uwsgi(_PyEval_EvalFrameDefault+0x3740) [0x5591739708c0]

2019-09-24T20:36:42.090771+00:00 app[web.1]: uwsgi(+0x1fe128) [0x55917396b128]

2019-09-24T20:36:42.090773+00:00 app[web.1]: uwsgi(_PyFunction_FastCallDict+0x2b0) [0x559173975290]

2019-09-24T20:36:42.090775+00:00 app[web.1]: uwsgi(_PyObject_Call_Prepend+0x249) [0x559173896659]

2019-09-24T20:36:42.090778+00:00 app[web.1]: uwsgi(PyObject_Call+0x3e) [0x5591738960be]

2019-09-24T20:36:42.090780+00:00 app[web.1]: uwsgi(+0x1ac819) [0x559173919819]

2019-09-24T20:36:42.090782+00:00 app[web.1]: uwsgi(_PyEval_EvalFrameDefault+0x1f1c) [0x55917396f09c]

2019-09-24T20:36:42.090784+00:00 app[web.1]: uwsgi(+0x1fec53) [0x55917396bc53]

2019-09-24T20:36:42.090786+00:00 app[web.1]: uwsgi(+0x1feeed) [0x55917396beed]

2019-09-24T20:36:42.090789+00:00 app[web.1]: uwsgi(_PyEval_EvalFrameDefault+0x3740) [0x5591739708c0]

2019-09-24T20:36:42.090791+00:00 app[web.1]: uwsgi(+0x1fec53) [0x55917396bc53]

2019-09-24T20:36:42.090793+00:00 app[web.1]: uwsgi(+0x1feeed) [0x55917396beed]

2019-09-24T20:36:42.090795+00:00 app[web.1]: * end of backtrace *

2019-09-24T20:36:42.552400+00:00 app[web.1]: DAMN ! worker 1 (pid: 11) died :( trying respawn ...

2019-09-24T20:36:42.556140+00:00 app[web.1]: Respawned uWSGI worker 1 (new pid: 15)

Disconnected from log stream. There may be events happening that you do not see here! Attempting to reconnect...

2019-09-24T20:36:42.090780+00:00 app[web.1]: uwsgi(+0x1ac819) [0x559173919819]

2019-09-24T20:36:42.090782+00:00 app[web.1]: uwsgi(_PyEval_EvalFrameDefault+0x1f1c) [0x55917396f09c]

2019-09-24T20:36:42.090784+00:00 app[web.1]: uwsgi(+0x1fec53) [0x55917396bc53]

2019-09-24T20:36:42.090786+00:00 app[web.1]: uwsgi(+0x1feeed) [0x55917396beed]

2019-09-24T20:36:42.090789+00:00 app[web.1]: uwsgi(_PyEval_EvalFrameDefault+0x3740) [0x5591739708c0]

2019-09-24T20:36:42.090791+00:00 app[web.1]: uwsgi(+0x1fec53) [0x55917396bc53]

2019-09-24T20:36:42.090793+00:00 app[web.1]: uwsgi(+0x1feeed) [0x55917396beed]

2019-09-24T20:36:42.090795+00:00 app[web.1]: * end of backtrace *

2019-09-24T20:36:42.552400+00:00 app[web.1]: DAMN ! worker 1 (pid: 11) died :( trying respawn ...

2019-09-24T20:36:42.556140+00:00 app[web.1]: Respawned uWSGI worker 1 (new pid: 15)`

stale support

Most helpful comment

Had no time to debug it, but swapping uwsgi for gunicorn works just fine.

Add it to requirements file/Pipenv and update Procfile to use gunicorn (web: gunicorn saleor.wsgi)

All 5 comments

Today I have created the same app with Docker and got the same Segmentation Fault with various databases.

Same happened to me with an app untouched for the last 8 months. Seems like Heroku changed something on their side

Had no time to debug it, but swapping uwsgi for gunicorn works just fine.

Add it to requirements file/Pipenv and update Procfile to use gunicorn (web: gunicorn saleor.wsgi)

I solved the problem with updating runtime to Python 3.7.3 and uwsgi from 2.0.17.1 to 2.0.18. Works fine at the moment. I suppose that there was an issue with uwsgi support from Heroku's side. Switching to gunicorn does the job as well.

Thanks for help! I enjoy using saleor very much!

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tanvirraj picture tanvirraj  路  3Comments

toguko picture toguko  路  4Comments

NumanIjaz picture NumanIjaz  路  3Comments

maltitco picture maltitco  路  3Comments

damianarechar picture damianarechar  路  3Comments