Gunicorn
DigiAngel opened this issue · comments
DigiAngel commented
Wow this has been a struggle. After getting an assist with the secret key, I'm now faced with this using gunicorn:
gunicorn --reload -w 4 -b 127.0.0.1:8000 web.wsgi
[2017-11-07 11:26:26 +0000] [2859] [INFO] Starting gunicorn 19.7.1
[2017-11-07 11:26:26 +0000] [2859] [INFO] Listening at: http://127.0.0.1:8000 (2859)
[2017-11-07 11:26:26 +0000] [2859] [INFO] Using worker: sync
[2017-11-07 11:26:26 +0000] [2863] [INFO] Booting worker with pid: 2863
[2017-11-07 11:26:26 +0000] [2866] [INFO] Booting worker with pid: 2866
[2017-11-07 11:26:26 +0000] [2868] [INFO] Booting worker with pid: 2868
[2017-11-07 11:26:26 +0000] [2870] [INFO] Booting worker with pid: 2870
Internal Server Error: /
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/exception.py", line 41, in inner
response = get_response(request)
File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 249, in _legacy_get_response
response = self._get_response(request)
File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 187, in _get_response
response = self.process_exception_by_middleware(e, request)
File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 185, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/views/decorators/http.py", line 40, in inner
return func(request, *args, **kwargs)
File "/opt/cuckoo/web/dashboard/views.py", line 79, in index
{"report" : report})
File "/usr/local/lib/python2.7/dist-packages/django/shortcuts.py", line 30, in render
content = loader.render_to_string(template_name, context, request, using=using)
File "/usr/local/lib/python2.7/dist-packages/django/template/loader.py", line 68, in render_to_string
return template.render(context, request)
File "/usr/local/lib/python2.7/dist-packages/django/template/backends/django.py", line 66, in render
return self.template.render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 205, in render
with context.bind_template(self):
File "/usr/lib/python2.7/contextlib.py", line 17, in __enter__
return self.gen.next()
File "/usr/local/lib/python2.7/dist-packages/django/template/context.py", line 263, in bind_template
updates.update(processor(self.request))
File "/usr/local/lib/python2.7/dist-packages/django/template/context_processors.py", line 66, in tz
return {'TIME_ZONE': timezone.get_current_timezone_name()}
File "/usr/local/lib/python2.7/dist-packages/django/utils/timezone.py", line 104, in get_current_timezone_name
return _get_timezone_name(get_current_timezone())
File "/usr/local/lib/python2.7/dist-packages/django/utils/timezone.py", line 97, in get_current_timezone
return getattr(_active, "value", get_default_timezone())
File "/usr/local/lib/python2.7/dist-packages/django/utils/lru_cache.py", line 124, in wrapper
result = user_function(*args, **kwds)
File "/usr/local/lib/python2.7/dist-packages/django/utils/timezone.py", line 79, in get_default_timezone
return pytz.timezone(settings.TIME_ZONE)
File "/usr/local/lib/python2.7/dist-packages/pytz/__init__.py", line 163, in timezone
if zone.upper() == 'UTC':
AttributeError: 'NoneType' object has no attribute 'upper'
^C[2017-11-07 11:27:51 +0000] [2859] [INFO] Handling signal: int
[2017-11-07 11:27:51 +0000] [2863] [INFO] Worker exiting (pid: 2863)
[2017-11-07 11:27:51 +0000] [2868] [INFO] Worker exiting (pid: 2868)
[2017-11-07 11:27:51 +0000] [2866] [INFO] Worker exiting (pid: 2866)
[2017-11-07 11:27:51 +0000] [2870] [INFO] Worker exiting (pid: 2870)
[2017-11-07 11:27:51 +0000] [2859] [INFO] Shutting down: Master
Not sure where to start to troubleshoot this...thank you.
doomedraven commented
that its a pytz library problem, i had it in past, google have a good solutions for it
HackDefendr commented
What version of Gunicorn and Django are you running?
I found that anything higher than Django v1.8.7 causes problems. As for Gunicorn, maybe try:
sudo pip install -U gunicorn
DigiAngel commented
Thanks...wow was this a challenge to get going! Anyway solution is here: