Replies: 1 comment
-
Hard for me to tell, but the log seems to suggest you have blocking code in your application. If you are not familiar with eventlet and how to write code that doesn't block, I suggest you don't use it. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
hello miguel i had this problem above in django socketio when i try to deploy this project to heroku and give
Error R12 (Exit timeout) -> At least one process failed to exit within 30 seconds of SIGTERM
this my Procfile
release: python manage.py migrate web: gunicorn --worker-class eventlet -w 1 --timeout 600 backend.wsgi:application
and this my requirements.txt
gunicorn==20.1.0 python-socketio python-engineio eventlet==0.30.2
and this wsgi.py
`
"""
WSGI config for app2 project.
It exposes the WSGI callable as a module-level variable named
application
.For more information on this file, see
https://docs.djangoproject.com/en/3.2/howto/deployment/wsgi/
"""
import sqlite3
import os
import eventlet
import socketio
from django.core.wsgi import get_wsgi_application
from datetime import datetime
db=sqlite3.connect('app2.db', check_same_thread=False)
cur=db.cursor()
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'backend.settings')
application = get_wsgi_application()
sio = socketio.Server(async_mode='eventlet',cors_allowed_origins='*', logger=True, engineio_logger=True)
application = socketio.WSGIApp(sio, application)
@sio.on('connected')
def connect(data, datamain) :
print('the app has been connected')
print(datamain)
@sio.on('distry')
def distry(data, datamain) :
print('this the page of the connect that has the most of the ten to use in the next that has the most of ten to use in the desktop')
print(datamain)
@sio.on('sendmsg')
def sendmsg(data, datamain) :
now=datetime.utcnow()
print(now.year, now.month, now.day, now.hour, now.minute, now.second)
if now.hour==22 :
cur.execute("INSERT INTO messages(content, email, email_reciever, year, month, day, hour, minute, second, email_deleting_one, email_deleting_two) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, 'none', 'none')", [datamain['content'], datamain['email'], datamain['email_reciever'], now.year, now.month, now.day+1, 00, now.minute, now.second])
db.commit()
sio.emit('sendedmsg', {
"state" :True,
"proccess" :"the messages has been added succussfully",
"email" :datamain["email"],
"email_reciever" :datamain['email_reciever']
})
elif now.hour==23:
cur.execute("INSERT INTO messages(content, email, email_reciever, year, month, day, hour, minute, second, email_deleting_one, email_deleting_two) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, 'none', 'none')", [datamain['content'], datamain['email'], datamain['email_reciever'], now.year, now.month, now.day+1, 1, now.minute, now.second])
db.commit()
sio.emit('sendedmsg', {
"state" :True,
"proccess" :"the messages has been added succussfully",
"email" :datamain["email"],
"email_reciever" :datamain['email_reciever']
})
else :
cur.execute("INSERT INTO messages(content, email, email_reciever, year, month, day, hour, minute, second, email_deleting_one, email_deleting_two) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, 'none', 'none')", [datamain['content'], datamain['email'], datamain['email_reciever'], now.year, now.month, now.day, now.hour+2, now.minute, now.second])
db.commit()
sio.emit('sendedmsg', {
"state" :True,
"proccess" :"the messages has been added succussfully",
"email" :datamain["email"],
"email_reciever" :datamain['email_reciever']
})
eventlet.wsgi.server(eventlet.listen(('', 8000)), application)
and this the messageserror
Stopping remaining processes with SIGKILL2021-07-27T20:55:30.289564+00:00 heroku[web.1]: Process exited with status 137
2021-07-27T20:55:52.259702+00:00 app[web.1]: [2021-07-27 20:55:52 +0000] [4] [CRITICAL] WORKER TIMEOUT (pid:7)
2021-07-27T20:55:52.259971+00:00 app[web.1]: wsgi exiting
2021-07-27T20:55:52.260052+00:00 app[web.1]: (7) wsgi exited, is_accepting=True
2021-07-27T20:55:52.267741+00:00 app[web.1]: [2021-07-27 20:55:52 +0000] [7] [ERROR] Socket error processing request.
2021-07-27T20:55:52.267742+00:00 app[web.1]: Traceback (most recent call last):
2021-07-27T20:55:52.267744+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/workers/base_async.py", line 65, in handle
2021-07-27T20:55:52.267745+00:00 app[web.1]: util.reraise(*sys.exc_info())
2021-07-27T20:55:52.267746+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/util.py", line 626, in reraise
2021-07-27T20:55:52.267747+00:00 app[web.1]: raise value
2021-07-27T20:55:52.267747+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/workers/base_async.py", line 38, in handle
2021-07-27T20:55:52.267747+00:00 app[web.1]: listener_name = listener.getsockname()
2021-07-27T20:55:52.267748+00:00 app[web.1]: OSError: [Errno 9] Bad file descriptor
2021-07-27T20:55:52.268125+00:00 app[web.1]: [2021-07-27 20:55:52 +0000] [7] [ERROR] Socket error processing request.
2021-07-27T20:55:52.268126+00:00 app[web.1]: Traceback (most recent call last):
2021-07-27T20:55:52.268127+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/workers/base_async.py", line 65, in handle
2021-07-27T20:55:52.268127+00:00 app[web.1]: util.reraise(*sys.exc_info())
2021-07-27T20:55:52.268128+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/util.py", line 626, in reraise
2021-07-27T20:55:52.268128+00:00 app[web.1]: raise value
2021-07-27T20:55:52.268128+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/workers/base_async.py", line 38, in handle
2021-07-27T20:55:52.268129+00:00 app[web.1]: listener_name = listener.getsockname()
2021-07-27T20:55:52.268129+00:00 app[web.1]: OSError: [Errno 9] Bad file descriptor
2021-07-27T20:55:52.268589+00:00 app[web.1]: [2021-07-27 20:55:52 +0000] [7] [INFO] Worker exiting (pid: 7)
2021-07-27T20:55:52.452922+00:00 app[web.1]: [2021-07-27 20:55:52 +0000] [8] [INFO] Booting worker with pid: 8
2021-07-27T20:55:53.112655+00:00 app[web.1]: Server initialized for eventlet.
2021-07-27T20:55:53.113285+00:00 app[web.1]: (8) wsgi starting up on http://0.0.0.0:8000
2021-07-27T20:56:22.627093+00:00 app[web.1]: [2021-07-27 20:56:22 +0000] [4] [CRITICAL] WORKER TIMEOUT (pid:8)
2021-07-27T20:56:22.627310+00:00 app[web.1]: wsgi exiting
2021-07-27T20:56:22.627393+00:00 app[web.1]: (8) wsgi exited, is_accepting=True
2021-07-27T20:56:22.635616+00:00 app[web.1]: [2021-07-27 20:56:22 +0000] [8] [ERROR] Socket error processing request.
2021-07-27T20:56:22.635618+00:00 app[web.1]: Traceback (most recent call last):
2021-07-27T20:56:22.635619+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/workers/base_async.py", line 65, in handle
2021-07-27T20:56:22.635619+00:00 app[web.1]: util.reraise(*sys.exc_info())
2021-07-27T20:56:22.635620+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/util.py", line 626, in reraise
2021-07-27T20:56:22.635620+00:00 app[web.1]: raise value
2021-07-27T20:56:22.635621+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/workers/base_async.py", line 38, in handle
2021-07-27T20:56:22.635621+00:00 app[web.1]: listener_name = listener.getsockname()
2021-07-27T20:56:22.635622+00:00 app[web.1]: OSError: [Errno 9] Bad file descriptor
2021-07-27T20:56:22.636343+00:00 app[web.1]: [2021-07-27 20:56:22 +0000] [8] [INFO] Worker exiting (pid: 8)
2021-07-27T20:56:22.640352+00:00 heroku[router]: at=error code=H13 desc="Connection closed without response" method=GET path="/login" host=muhsocialapp.herokuapp.com request_id=17a12f95-7d5f-467e-9767-64031a7f4740 fwd="197.161.125.160" dyno=web.1 connect=1ms service=6188ms status=503 bytes=0 protocol=https`
Beta Was this translation helpful? Give feedback.
All reactions