Forums

web app is not responding to request

I was trying to make a new web app, as I keep squashing bugs to deploy, the error page is changed to

Internal server error Sorry, there seems to be an error. Please try again soon.

not the usual, themed error page. My request is saved in access log, but there are no more error logs (lets say last access is 09.50.01 buat last error log is 09.40.00, no errors in server log). I tried to recreate the app, no success.

I have bunch of env vars set in wsgi, is that affecting this behaviour? also the bug I was trying to manage is this, if someone kind enough to help me.

2015-08-15 09:27:05,923 :Traceback (most recent call last):
2015-08-15 09:27:05,923 :  File "/bin/user_wsgi_wrapper.py", line 130, in __call__
2015-08-15 09:27:05,923 :    self.error_log_file.logger.exception("Error running WSGI application")
2015-08-15 09:27:05,923 :  File "/usr/lib/python2.7/logging/__init__.py", line 1185, in exception
2015-08-15 09:27:05,923 :    self.error(msg, *args, **kwargs)
2015-08-15 09:27:05,923 :  File "/usr/lib/python2.7/logging/__init__.py", line 1178, in error
2015-08-15 09:27:05,924 :    self._log(ERROR, msg, args, **kwargs)
2015-08-15 09:27:05,924 :  File "/usr/lib/python2.7/logging/__init__.py", line 1270, in _log
2015-08-15 09:27:05,924 :    record = self.makeRecord(self.name, level, fn, lno, msg, args, exc_info, func, extra)
2015-08-15 09:27:05,924 :  File "/usr/lib/python2.7/logging/__init__.py", line 1244, in makeRecord
2015-08-15 09:27:05,924 :    rv = LogRecord(name, level, fn, lno, msg, args, exc_info, func)
2015-08-15 09:27:05,925 :  File "/usr/lib/python2.7/logging/__init__.py", line 284, in __init__
2015-08-15 09:27:05,925 :    self.threadName = threading.current_thread().name
2015-08-15 09:27:05,925 :  File "/usr/lib/python2.7/threading.py", line 1160, in currentThread
2015-08-15 09:27:05,925 :    return _active[_get_ident()]
2015-08-15 09:27:05,925 :  File "/bin/user_wsgi_wrapper.py", line 122, in __call__
2015-08-15 09:27:05,925 :    app_iterator = self.app(environ, start_response)
2015-08-15 09:27:05,925 :  File "/home/abirafdirp/.virtualenvs/blog_prod/local/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 189, in __call__
2015-08-15 09:27:05,926 :    response = self.get_response(request)
2015-08-15 09:27:05,926 :  File "/home/abirafdirp/.virtualenvs/blog_prod/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 218, in get_response
2015-08-15 09:27:05,927 :    response = self.handle_uncaught_exception(request, resolver, sys.exc_info())
2015-08-15 09:27:05,927 :  File "/home/abirafdirp/.virtualenvs/blog_prod/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 256, in handle_uncaught_exception
2015-08-15 09:27:05,927 :    'request': request
2015-08-15 09:27:05,928 :  File "/usr/lib/python2.7/logging/__init__.py", line 1178, in error
2015-08-15 09:27:05,928 :    self._log(ERROR, msg, args, **kwargs)
2015-08-15 09:27:05,928 :  File "/usr/lib/python2.7/logging/__init__.py", line 1271, in _log
2015-08-15 09:27:05,928 :    self.handle(record)
2015-08-15 09:27:05,928 :  File "/usr/lib/python2.7/logging/__init__.py", line 1281, in handle
2015-08-15 09:27:05,929 :    self.callHandlers(record)
2015-08-15 09:27:05,929 :  File "/usr/lib/python2.7/logging/__init__.py", line 1321, in callHandlers
2015-08-15 09:27:05,929 :    hdlr.handle(record)
2015-08-15 09:27:05,929 :  File "/usr/lib/python2.7/logging/__init__.py", line 749, in handle
2015-08-15 09:27:05,929 :    self.emit(record)
2015-08-15 09:27:05,929 :  File "/home/abirafdirp/.virtualenvs/blog_prod/local/lib/python2.7/site-packages/django/utils/log.py", line 129, in emit
2015-08-15 09:27:05,930 :    self.send_mail(subject, message, fail_silently=True, html_message=html_message)
2015-08-15 09:27:05,930 :  File "/home/abirafdirp/.virtualenvs/blog_prod/local/lib/python2.7/site-packages/django/utils/log.py", line 132, in send_mail
2015-08-15 09:27:05,930 :    mail.mail_admins(subject, message, *args, connection=self.connection(), **kwargs)
2015-08-15 09:27:05,931 :  File "/home/abirafdirp/.virtualenvs/blog_prod/local/lib/python2.7/site-packages/django/core/mail/__init__.py", line 98, in mail_admins
2015-08-15 09:27:05,931 :    mail.send(fail_silently=fail_silently)
2015-08-15 09:27:05,931 :  File "/home/abirafdirp/.virtualenvs/blog_prod/local/lib/python2.7/site-packages/django/core/mail/message.py", line 303, in send
2015-08-15 09:27:05,932 :    return self.get_connection(fail_silently).send_messages([self])
2015-08-15 09:27:05,932 :  File "/home/abirafdirp/.virtualenvs/blog_prod/local/lib/python2.7/site-packages/django/core/mail/backends/smtp.py", line 100, in send_messages
2015-08-15 09:27:05,933 :    new_conn_created = self.open()
2015-08-15 09:27:05,933 :  File "/home/abirafdirp/.virtualenvs/blog_prod/local/lib/python2.7/site-packages/django/core/mail/backends/smtp.py", line 58, in open
2015-08-15 09:27:05,933 :    self.connection = connection_class(self.host, self.port, **connection_params)
2015-08-15 09:27:05,933 :  File "/usr/lib/python2.7/smtplib.py", line 256, in __init__
2015-08-15 09:27:05,933 :    (code, msg) = self.connect(host, port)
2015-08-15 09:27:05,934 :  File "/usr/lib/python2.7/smtplib.py", line 316, in connect
2015-08-15 09:27:05,934 :    self.sock = self._get_socket(host, port, self.timeout)
2015-08-15 09:27:05,934 :  File "/usr/lib/python2.7/smtplib.py", line 291, in _get_socket
2015-08-15 09:27:05,934 :    return socket.create_connection((host, port), timeout)
2015-08-15 09:27:05,934 :  File "/usr/lib/python2.7/socket.py", line 571, in create_connection
2015-08-15 09:27:05,934 :    raise err
2015-08-15 09:27:05,934 :socket.error: [Errno 111] Connection refused

I already removed many middleware and settings that related to emails and loggings, because I'm using cookie-cutter template. Many thanks

Your app is trying to send an email and the mail server is rejecting the connection.

Yes I suspect that what happens, thats why I tried to remove many settings that related to emails.


Also if you read my question, that error is not exactly the main problem, the main problem is that no more errors log are generated, even though the request is saved in access log. Those bugs occured before the errors log no longer generated again, so its quite a bit off-topic question.


So let me explain again, I hit my main URL, it works and give me the response, but If I visit my admin page

Internal server error Sorry, there seems to be an error. Please try again soon.

no new error logs, request is saved in access, tried checking the logs folder in var/logs, no other logs file are created. I'm using angular for my web app, any page other than index page gives me errors, the django admin page will give me the error above, and angular pages errors are fail to load templates in the JS debug, I know there are something error in my Django code, so that's why I need my errors log. Thanks!

Hey there, I'm feeling so dumb today, posted 2 topics and hours later managed to solve it. I set DEBUG to True so I can track down the error.