Mediathread error output while running with apache

84 views
Skip to first unread message

John wallace

unread,
Mar 20, 2014, 4:49:30 PM3/20/14
to media...@googlegroups.com
Hi,

When I run mediathread via:

         ./manage.py runserver localhost:8000

it seems to work fine but  using Apache I get the error below:

Anyone have thoughts on what to look for here?

thanks

-John

--------------- mediathread   error.log  --------------------------------------------------------
       


 mod_wsgi (pid=29013): Exception occurred processing WSGI script '/var/www/mediathread/mediathread/apache/django.wsgi'.
[Thu Mar 20 14:53:23 2014] [error] [client 127.0.0.1] Traceback (most recent call last):
[Thu Mar 20 14:53:23 2014] [error] [client 127.0.0.1]   File "/var/www/mediathread/mediathread/ve/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 241, in __call__
[Thu Mar 20 14:53:23 2014] [error] [client 127.0.0.1]     response = self.get_response(request)
[Thu Mar 20 14:53:23 2014] [error] [client 127.0.0.1]   File "/var/www/mediathread/mediathread/ve/lib/python2.7/site-packages/django/core/handlers/base.py", line 179, in get_response
[Thu Mar 20 14:53:23 2014] [error] [client 127.0.0.1]     response = self.handle_uncaught_exception(request, resolver, sys.exc_info())
[Thu Mar 20 14:53:23 2014] [error] [client 127.0.0.1]   File "/var/www/mediathread/mediathread/ve/lib/python2.7/site-packages/django/core/handlers/base.py", line 228, in handle_uncaught_exception
[Thu Mar 20 14:53:23 2014] [error] [client 127.0.0.1]     return callback(request, **param_dict)
[Thu Mar 20 14:53:23 2014] [error] [client 127.0.0.1]   File "/var/www/mediathread/mediathread/ve/lib/python2.7/site-packages/django/utils/decorators.py", line 91, in _wrapped_view
[Thu Mar 20 14:53:23 2014] [error] [client 127.0.0.1]     response = view_func(request, *args, **kwargs)
[Thu Mar 20 14:53:23 2014] [error] [client 127.0.0.1]   File "/var/www/mediathread/mediathread/ve/lib/python2.7/site-packages/django/views/defaults.py", line 33, in server_error
[Thu Mar 20 14:53:23 2014] [error] [client 127.0.0.1]     return http.HttpResponseServerError(t.render(Context({})))
[Thu Mar 20 14:53:23 2014] [error] [client 127.0.0.1]   File "/var/www/mediathread/mediathread/ve/lib/python2.7/site-packages/django/template/base.py", line 140, in render
[Thu Mar 20 14:53:23 2014] [error] [client 127.0.0.1]     return self._render(context)
[Thu Mar 20 14:53:23 2014] [error] [client 127.0.0.1]   File "/var/www/mediathread/mediathread/ve/lib/python2.7/site-packages/django/template/base.py", line 134, in _render
[Thu Mar 20 14:53:23 2014] [error] [client 127.0.0.1]     return self.nodelist.render(context)
[Thu Mar 20 14:53:23 2014] [error] [client 127.0.0.1]   File "/var/www/mediathread/mediathread/ve/lib/python2.7/site-packages/django/template/base.py", line 823, in render
[Thu Mar 20 14:53:23 2014] [error] [client 127.0.0.1]     bit = self.render_node(node, context)
[Thu Mar 20 14:53:23 2014] [error] [client 127.0.0.1]   File "/var/www/mediathread/mediathread/ve/lib/python2.7/site-packages/django/template/base.py", line 837, in render_node
[Thu Mar 20 14:53:23 2014] [error] [client 127.0.0.1]     return node.render(context)
[Thu Mar 20 14:53:23 2014] [error] [client 127.0.0.1]   File "/var/www/mediathread/mediathread/ve/lib/python2.7/site-packages/django/template/loader_tags.py", line 123, in render
[Thu Mar 20 14:53:23 2014] [error] [client 127.0.0.1]     return compiled_parent._render(context)
[Thu Mar 20 14:53:23 2014] [error] [client 127.0.0.1]   File "/var/www/mediathread/mediathread/ve/lib/python2.7/site-packages/django/template/base.py", line 134, in _render
[Thu Mar 20 14:53:23 2014] [error] [client 127.0.0.1]     return self.nodelist.render(context)
[Thu Mar 20 14:53:23 2014] [error] [client 127.0.0.1]   File "/var/www/mediathread/mediathread/ve/lib/python2.7/site-packages/django/template/base.py", line 823, in render
[Thu Mar 20 14:53:23 2014] [error] [client 127.0.0.1]     bit = self.render_node(node, context)
[Thu Mar 20 14:53:23 2014] [error] [client 127.0.0.1]   File "/var/www/mediathread/mediathread/ve/lib/python2.7/site-packages/django/template/base.py", line 837, in render_node
[Thu Mar 20 14:53:23 2014] [error] [client 127.0.0.1]     return node.render(context)
[Thu Mar 20 14:53:23 2014] [error] [client 127.0.0.1]   File "/var/www/mediathread/mediathread/ve/lib/python2.7/site-packages/django/template/defaulttags.py", line 478, in render
[Thu Mar 20 14:53:23 2014] [error] [client 127.0.0.1]     output = self.nodelist.render(context)
[Thu Mar 20 14:53:23 2014] [error] [client 127.0.0.1]   File "/var/www/mediathread/mediathread/ve/lib/python2.7/site-packages/django/template/base.py", line 823, in render
[Thu Mar 20 14:53:23 2014] [error] [client 127.0.0.1]     bit = self.render_node(node, context)
[Thu Mar 20 14:53:23 2014] [error] [client 127.0.0.1]   File "/var/www/mediathread/mediathread/ve/lib/python2.7/site-packages/django/template/base.py", line 837, in render_node
[Thu Mar 20 14:53:23 2014] [error] [client 127.0.0.1]     return node.render(context)
[Thu Mar 20 14:53:23 2014] [error] [client 127.0.0.1]   File "/var/www/mediathread/mediathread/ve/lib/python2.7/site-packages/djangohelpers/templatetags/__init__.py", line 67, in render
[Thu Mar 20 14:53:23 2014] [error] [client 127.0.0.1]     vars[key] = var.resolve(context)
[Thu Mar 20 14:53:23 2014] [error] [client 127.0.0.1]   File "/var/www/mediathread/mediathread/ve/lib/python2.7/site-packages/django/template/base.py", line 721, in resolve
[Thu Mar 20 14:53:23 2014] [error] [client 127.0.0.1]     value = self._resolve_lookup(context)
[Thu Mar 20 14:53:23 2014] [error] [client 127.0.0.1]   File "/var/www/mediathread/mediathread/ve/lib/python2.7/site-packages/django/template/base.py", line 764, in _resolve_lookup
[Thu Mar 20 14:53:23 2014] [error] [client 127.0.0.1]     (bit, current))  # missing attribute
[Thu Mar 20 14:53:23 2014] [error] [client 127.0.0.1] VariableDoesNotExist: Failed lookup for key [request] in u"[{}, {u'course': ''}, {'name': None}]"

John wallace

unread,
Mar 20, 2014, 4:55:21 PM3/20/14
to media...@googlegroups.com
... and one more bit of information .... the apache error.log file has has a mod_wsgi version mismatch warning


   mod_wsgi: Compiled for Python/2.7.2+.
[Thu Mar 20 14:31:49 2014] [warn] mod_wsgi: Runtime using Python/2.7.3.



--------------------------------------------------------------------------

Susan Dreher

unread,
Mar 21, 2014, 9:01:48 AM3/21/14
to media...@googlegroups.com
Hi John - 

Just taking a look at this. Can you give us more information on when this error appears? I'm assuming you're hitting this error at the application root, i.e. mediathread.hostname.edu, before the login screen and such?

Thanks,
Susan 


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

john wallace

unread,
Mar 21, 2014, 9:11:33 AM3/21/14
to media...@googlegroups.com
Hi,

Yes,  this error occurs while just trying to load the application root. 



Thanks

-John
You received this message because you are subscribed to a topic in the Google Groups "Mediathread" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mediathread/1tql6gbMDNE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mediathread...@googlegroups.com.

Walter Koch

unread,
Jun 25, 2014, 6:13:22 AM6/25/14
to media...@googlegroups.com
Hi John,

   may I ask you if you've found the solution - I've got the same issue on a Ubuntu 14.04 box (but no errors in the apache-log).

The message:

     VariableDoesNotExist: Failed lookup for key [request] in u"[{}, {u'course': ''}, {'name': None}]"
seemed to me related to the (postgres) database access (just having started with mediathread I havn't got into details by now and still have to check the Apache-configuration).

Thank for any thought.

Walter

John wallace

unread,
Jul 9, 2014, 11:03:24 AM7/9/14
to media...@googlegroups.com
Hi Walter,

I never did find a solution for this so we used the hosted service for one class in the spring.  However, there were issues with the hosted service and we are again thinking of getting Mediathread running locally.

-John

Walter Koch

unread,
Jul 12, 2014, 8:58:59 PM7/12/14
to media...@googlegroups.com
Hi John,

  I think the production version of mediathread needs "pgbouncer" which has to be installed and configured properly.
You can find a hint in the file: /var/www/mediathread/mediathread/mediathread/settings_production.py .

I hope I can find out the correct configuration during the next days.

A starting point could be: http://www.guguncube.com/1692/pgbouncer-installation-and-configuration-in-ubuntu

rgds

Walter

Walter Koch

unread,
Jul 13, 2014, 5:56:49 AM7/13/14
to media...@googlegroups.com

Hi John,

just found the solution which works on my Ubuntu 14.04 machine.

Below I copy a step by step instruction how to integrate "pgbouncer" (sorry for the length):

Hope this helps, best Walter

###Mediathread - Production Version######################################

[...]

=== Install Pgbouncer
---http://www.guguncube.com/1692/pgbouncer-installation-and-configuration-in-ubuntu

sudo apt-get install -y pgbouncer

--- create logfile
sudo touch /var/log/pgbouncer.log
sudo chown postgres:postgres /var/log/pgbouncer.log
sudo chmod 777 /var/log/pgbouncer.log
--- note "777" might not be appropriate
sudo ls -l /var/log/pgbouncer.log

--- create pidfile-folder
sudo mkdir /var/run/pgbouncer
sudo chown postgres:postgres /var/run/pgbouncer
sudo ls -l /var/run/pgbouncer


--- set parameters (userlist.txt contains: "postgres" "postgres")

sudo mkdir /usr/local/postgres
sudo touch /usr/local/postgres/userlist.txt
sudo gedit /usr/local/postgres/userlist.txt
sudo cat /usr/local/postgres/userlist.txt
sudo chown postgres:postgres /usr/local/postgres/userlist.txt
#sudo rm /usr/local/postgres/*~
sudo ls -l /usr/local/postgres

--- edit the config-file: etc/pgbouncer/pgbouncer.ini
sudo gedit /etc/pgbouncer/pgbouncer.ini

---A simple working config-file ("pgbouncer.ini") looks like this:

--------------------------------------------------------------------------
---START   /etc/pgbouncer/pgbouncer.ini ----------------------------------
[databases]
mediathread = host=localhost port=5432 dbname=mediathread

[pgbouncer]
listen_port = 6432
listen_addr = 127.0.0.1
auth_type = md5
auth_file = /usr/local/postgres/userlist.txt
logfile = /var/log/pgbouncer.log
pidfile = /var/run/pgbouncer/pgbouncer.pid
admin_users = postgres
---END   /etc/pgbouncer/pgbouncer.ini ----------------------------------
--------------------------------------------------------------------------

--- edit the mediathread configuration file: "settings_production.py"
sudo gedit /var/www/mediathread/mediathread/mediathread/settings_production.py
--- Restart WebServer
sudo service apache2 restart

---A working config file ("settings_production.py") looks like this:

--------------------------------------------------------------------------
---START   /var/www/mediathread/mediathread/mediathread/settings_production.py
# flake8: noqa
from mediathread.settings import *

USE_X_FORWARDED_HOST = True

TEMPLATE_DIRS = (
    "/var/www/mediathread/mediathread/mediathread/deploy_specific/templates",
    "/var/www/mediathread/mediathread/mediathread/templates",
)

MEDIA_ROOT = '/var/www/mediathread/uploads/'
# put any static media here to override app served static media
STATICMEDIA_MOUNTS = (
    ('/sitemedia', '/var/www/mediathread/mediathread/sitemedia'),
)

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2',
        'NAME': 'mediathread',
        'HOST': 'localhost',
        'PORT': 6432,  # see /etc/pgbouncer/pgbouncer.ini
        'USER': 'postgres',
        'PASSWORD': 'postgres',
    }
}

COMPRESS_ROOT = "/var/www/mediathread/mediathread/media/"
DEBUG = False
TEMPLATE_DEBUG = DEBUG

STATSD_PREFIX = 'mediathread'
---END     /var/www/mediathread/mediathread/mediathread/settings_production.py
--------------------------------------------------------------------------


===Start & Test: Unix-user/pwd=postgres/postgres

---Start pgbouncer
cd /etc/pgbouncer
su postgres
pgbouncer -d -v pgbouncer.ini
---or if pgbouncer alread running, restart (-R):
pgbouncer -R -d -v pgbouncer.ini

=== That's it (put this into the startup configuration of the machine)===

---Test with db=mediathread (db-pwd=postgres)------------
psql -h localhost -p 6432 mediathread
--- in psql mode ("mediathread="):
mediathread=# \l  (leave with "q")
mediathread=# \q   (leave psql mode)
--- end of test -----------------------------------------

=== Check if "mediathread" works and pen in your browser:
http://localhost


=== If an error eccors you can look at the log-files:

sudo cat /var/log/apache2/mediathread/error.log | more
sudo cat /var/log/apache2/mediathread/access.log | more
--- or
sudo gedit /var/log/apache2/mediathread/error.log
sudo gedit /var/log/apache2/mediathread/access.log

=====================================================================
--- Another Source for information (amongst others):
--- http://michael.otacoo.com/postgresql-2/first-steps-with-pgbouncer-how-to-set-and-run-it/

#####################################################################



Am Mittwoch, 9. Juli 2014 17:03:24 UTC+2 schrieb John wallace:

Susan Dreher

unread,
Jul 13, 2014, 9:36:08 AM7/13/14
to media...@googlegroups.com
Just a note on pgbouncer -- that configuration is part of our infrastructure at Columbia. You can customize your own configuration via deploy_specific\settings.py. The deploy_specific setup is doc'd in the GitHub README file.

Walter Koch

unread,
Jul 13, 2014, 6:21:33 PM7/13/14
to media...@googlegroups.com
Hi Susan,

   initially I had the DATABASES section:
---

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2',
        'NAME': 'mediathread',
        'HOST': 'localhost',
        'PORT': 6432,  # see /etc/pgbouncer/pgbouncer.ini
        'USER': 'postgres',
        'PASSWORD': 'postgres',
    }
}
---
in the "deploy_specific/settings.py", but this didn't work; I don*t know what I've done wrong - so I changed "settings_production.py".

I want to access media content from an own Kultura Media Server installation; I assume there is nothing to do in any configuration file of mediathread.

@ John
To do the final integration of pgbouncer into ubuntu 14.04 was at the end quite simple:
1) Install pgbouncer (sudo apt-get install pgbouncer)
2) Create the logfile (/var/log/pgbouncer.log)
3) Create/edit userlist (/usr/local/postgres/userlist.txt)
4) Create pgbouncer conf file (/etc/pgbouncer/pgbouncer.ini)
     use "pidfile = /var/run/postgresql/pgbouncer.pid" (instead of creating an own folder in /var/run)
6) Enable pgbouncer (set "START=1" in /etc/default/pgbouncer)
7) Reboot machine

I really like mediathread - it is an excellent product and I will start using it in the next semester at university.

Rgds

Walter
To unsubscribe from this group and stop receiving emails from it, send an email to mediathread+unsubscribe@googlegroups.com.

Walter Koch

unread,
Jul 14, 2014, 2:22:10 AM7/14/14
to media...@googlegroups.com
Hi,

   changing any other parameters in deploy_specific\settings.py works in my installation but not the DATABASES section.

@John
by setting the port to 5432 (standard postgres) you can of course avoid all the exercise around pgbouncer-installation; but I still had to change this parameter in settings_production.py  .

I've used in deploy_specific\settings.py:

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2',
        'NAME': 'mediathread',
        'HOST': 'localhost',
        'PORT': 5432,  # see /etc/pgbouncer/pgbouncer.ini

        'USER': 'postgres',
        'PASSWORD': 'postgres',
    }
}
which did not overrule other settings in deploy_specific\settings.py.

Sorry for having been mislead by the the note " # see /etc/pgbouncer/pgbouncer.ini" to pgbouncer which is not necessary to run mediathread.

Regards

Walter



Am Sonntag, 13. Juli 2014 15:36:08 UTC+2 schrieb Susan Dreher:
To unsubscribe from this group and stop receiving emails from it, send an email to mediathread+unsubscribe@googlegroups.com.

Susan Dreher

unread,
Jul 14, 2014, 7:45:56 AM7/14/14
to media...@googlegroups.com
Hi Walter -

Ah - I think you've stumbled on to an import ordering issue vis a vis the settings chain.

Perhaps the correct answer is to remove the DATABASES defs from settings_production and settings_stage completely. That should ensure that deploy_specific/settings.py is picked up properly. If you want to do that and issue a pull request, I will happily do the merge.

Thanks!
Susan

Walter Koch

unread,
Jul 14, 2014, 9:56:15 AM7/14/14
to media...@googlegroups.com
Hi Susan,
   thank you for your help; I am just on the road, will test this tomorrow and will be happy to issue a pull request by then.

Regards
Walter
NB: if it is of interest: I will prepare a course about "Museum Documentation" which is part of a the "Euromachs" Masterstudy (http://euromachs.uni-graz.at/de/ ) using "Mediathread".

John wallace

unread,
Aug 19, 2014, 3:17:53 PM8/19/14
to media...@googlegroups.com
Hi Walter, 

Thanks very much for your post.  I'm finally getting back to installing Mediathread today and hope to use the solutions you suggest in the next day.  

thanks

-John

steven hodges

unread,
Sep 27, 2014, 10:28:50 PM9/27/14
to media...@googlegroups.com
Hi...

I seem to have the same issue as outlined here -- Ubuntu 14.04.1 LTS -- Mediathread works fine when run with manage.py runserver, but when run via mod_wsgi I get the VariableDoesNotExist error:

[Sat Sep 27 21:38:30.691994 2014] [:error] [pid 1777] [remote 143.215.16.78:43855] VariableDoesNotExist: Failed lookup for key [request] in u"[{'False': False, 'None': None, 'True': True}, {}, {u'course': '', 'compressed': {'name': None}}]"

The full error trace is below, but I was wondering if anyone found a way to deal with this. I did remove other DATABASES sections except for local_settings.py file. I'd be grateful for any suggestions. Thanks!

****


[Sat Sep 27 21:38:30.690100 2014] [:error] [pid 1777] [remote 143.215.16.78:43855] mod_wsgi (pid=1777): Exception occurred processing WSGI script '/var/www/mediathread/mediathread/apache/django.wsgi'.
[Sat Sep 27 21:38:30.690169 2014] [:error] [pid 1777] [remote 143.215.16.78:43855] Traceback (most recent call last):
[Sat Sep 27 21:38:30.690194 2014] [:error] [pid 1777] [remote 143.215.16.78:43855]   File "/var/www/mediathread/mediathread/ve/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 255, in __call__
[Sat Sep 27 21:38:30.690305 2014] [:error] [pid 1777] [remote 143.215.16.78:43855]     response = self.get_response(request)
[Sat Sep 27 21:38:30.690326 2014] [:error] [pid 1777] [remote 143.215.16.78:43855]   File "/var/www/mediathread/mediathread/ve/lib/python2.7/site-packages/django/core/handlers/base.py", line 178, in get_response
[Sat Sep 27 21:38:30.690465 2014] [:error] [pid 1777] [remote 143.215.16.78:43855]     response = self.handle_uncaught_exception(request, resolver, sys.exc_info())
[Sat Sep 27 21:38:30.690490 2014] [:error] [pid 1777] [remote 143.215.16.78:43855]   File "/var/www/mediathread/mediathread/ve/lib/python2.7/site-packages/django/core/handlers/base.py", line 224, in handle_uncaught_exception
[Sat Sep 27 21:38:30.690512 2014] [:error] [pid 1777] [remote 143.215.16.78:43855]     return callback(request, **param_dict)
[Sat Sep 27 21:38:30.690526 2014] [:error] [pid 1777] [remote 143.215.16.78:43855]   File "/var/www/mediathread/mediathread/ve/lib/python2.7/site-packages/django/utils/decorators.py", line 91, in _wrapped_view
[Sat Sep 27 21:38:30.690615 2014] [:error] [pid 1777] [remote 143.215.16.78:43855]     response = view_func(request, *args, **kwargs)
[Sat Sep 27 21:38:30.690677 2014] [:error] [pid 1777] [remote 143.215.16.78:43855]   File "/var/www/mediathread/mediathread/ve/lib/python2.7/site-packages/django/views/defaults.py", line 41, in server_error
[Sat Sep 27 21:38:30.690754 2014] [:error] [pid 1777] [remote 143.215.16.78:43855]     return http.HttpResponseServerError(template.render(Context({})))
[Sat Sep 27 21:38:30.690772 2014] [:error] [pid 1777] [remote 143.215.16.78:43855]   File "/var/www/mediathread/mediathread/ve/lib/python2.7/site-packages/django/template/base.py", line 140, in render
[Sat Sep 27 21:38:30.691062 2014] [:error] [pid 1777] [remote 143.215.16.78:43855]     return self._render(context)
[Sat Sep 27 21:38:30.691085 2014] [:error] [pid 1777] [remote 143.215.16.78:43855]   File "/var/www/mediathread/mediathread/ve/lib/python2.7/site-packages/django/template/base.py", line 134, in _render
[Sat Sep 27 21:38:30.691106 2014] [:error] [pid 1777] [remote 143.215.16.78:43855]     return self.nodelist.render(context)
[Sat Sep 27 21:38:30.691119 2014] [:error] [pid 1777] [remote 143.215.16.78:43855]   File "/var/www/mediathread/mediathread/ve/lib/python2.7/site-packages/django/template/base.py", line 830, in render
[Sat Sep 27 21:38:30.691136 2014] [:error] [pid 1777] [remote 143.215.16.78:43855]     bit = self.render_node(node, context)
[Sat Sep 27 21:38:30.691146 2014] [:error] [pid 1777] [remote 143.215.16.78:43855]   File "/var/www/mediathread/mediathread/ve/lib/python2.7/site-packages/django/template/base.py", line 844, in render_node
[Sat Sep 27 21:38:30.691164 2014] [:error] [pid 1777] [remote 143.215.16.78:43855]     return node.render(context)
[Sat Sep 27 21:38:30.691177 2014] [:error] [pid 1777] [remote 143.215.16.78:43855]   File "/var/www/mediathread/mediathread/ve/lib/python2.7/site-packages/django/template/loader_tags.py", line 124, in render
[Sat Sep 27 21:38:30.691274 2014] [:error] [pid 1777] [remote 143.215.16.78:43855]     return compiled_parent._render(context)
[Sat Sep 27 21:38:30.691296 2014] [:error] [pid 1777] [remote 143.215.16.78:43855]   File "/var/www/mediathread/mediathread/ve/lib/python2.7/site-packages/django/template/base.py", line 134, in _render
[Sat Sep 27 21:38:30.691315 2014] [:error] [pid 1777] [remote 143.215.16.78:43855]     return self.nodelist.render(context)
[Sat Sep 27 21:38:30.691328 2014] [:error] [pid 1777] [remote 143.215.16.78:43855]   File "/var/www/mediathread/mediathread/ve/lib/python2.7/site-packages/django/template/base.py", line 830, in render
[Sat Sep 27 21:38:30.691344 2014] [:error] [pid 1777] [remote 143.215.16.78:43855]     bit = self.render_node(node, context)
[Sat Sep 27 21:38:30.691354 2014] [:error] [pid 1777] [remote 143.215.16.78:43855]   File "/var/www/mediathread/mediathread/ve/lib/python2.7/site-packages/django/template/base.py", line 844, in render_node
[Sat Sep 27 21:38:30.691372 2014] [:error] [pid 1777] [remote 143.215.16.78:43855]     return node.render(context)
[Sat Sep 27 21:38:30.691385 2014] [:error] [pid 1777] [remote 143.215.16.78:43855]   File "/var/www/mediathread/mediathread/ve/lib/python2.7/site-packages/django/template/defaulttags.py", line 485, in render
[Sat Sep 27 21:38:30.691675 2014] [:error] [pid 1777] [remote 143.215.16.78:43855]     output = self.nodelist.render(context)
[Sat Sep 27 21:38:30.691697 2014] [:error] [pid 1777] [remote 143.215.16.78:43855]   File "/var/www/mediathread/mediathread/ve/lib/python2.7/site-packages/django/template/base.py", line 830, in render
[Sat Sep 27 21:38:30.691717 2014] [:error] [pid 1777] [remote 143.215.16.78:43855]     bit = self.render_node(node, context)
[Sat Sep 27 21:38:30.691731 2014] [:error] [pid 1777] [remote 143.215.16.78:43855]   File "/var/www/mediathread/mediathread/ve/lib/python2.7/site-packages/django/template/base.py", line 844, in render_node
[Sat Sep 27 21:38:30.691747 2014] [:error] [pid 1777] [remote 143.215.16.78:43855]     return node.render(context)
[Sat Sep 27 21:38:30.691777 2014] [:error] [pid 1777] [remote 143.215.16.78:43855]   File "/var/www/mediathread/mediathread/ve/lib/python2.7/site-packages/courseaffils/templatetags/coursetags.py", line 71, in render
[Sat Sep 27 21:38:30.691858 2014] [:error] [pid 1777] [remote 143.215.16.78:43855]     vars[key] = var.resolve(context)
[Sat Sep 27 21:38:30.691880 2014] [:error] [pid 1777] [remote 143.215.16.78:43855]   File "/var/www/mediathread/mediathread/ve/lib/python2.7/site-packages/django/template/base.py", line 728, in resolve
[Sat Sep 27 21:38:30.691899 2014] [:error] [pid 1777] [remote 143.215.16.78:43855]     value = self._resolve_lookup(context)
[Sat Sep 27 21:38:30.691913 2014] [:error] [pid 1777] [remote 143.215.16.78:43855]   File "/var/www/mediathread/mediathread/ve/lib/python2.7/site-packages/django/template/base.py", line 771, in _resolve_lookup
[Sat Sep 27 21:38:30.691929 2014] [:error] [pid 1777] [remote 143.215.16.78:43855]     (bit, current))  # missing attribute
[Sat Sep 27 21:38:30.691994 2014] [:error] [pid 1777] [remote 143.215.16.78:43855] VariableDoesNotExist: Failed lookup for key [request] in u"[{'False': False, 'None': None, 'True': True}, {}, {u'course': '', 'compressed': {'name': None}}]"

steven hodges

unread,
Sep 28, 2014, 8:10:41 PM9/28/14
to media...@googlegroups.com
Following up on this: I found that setting debug to true in my localsettings.py caused this problem to go away:

DEBUG = True
TEMPLATE_DEBUG = DEBUG

I don't understand mediathread well enough to see why this works, but it seems like the error indicated a problem with a template, and perhaps the setting change above causes an alternate set of templates that happen not to have that problem to be used?

Susan Dreher

unread,
Sep 29, 2014, 9:37:44 AM9/29/14
to media...@googlegroups.com
Hi Steven - 

Thanks - that actually provides an important clue to the puzzle you and John are having. We think that the sentry/raven configuration may be resulting in this strange error that masks the actual underlying issue. Setting DEBUG = True circumnavigates this configuration.

Though everything is working fine, can you check your logs and see if there are any stack traces as you run the application? I might have you add some additional debug settings as well, but let's start there.

Cheers,
Susan

 

Susan Dreher

unread,
Oct 1, 2014, 1:36:50 PM10/1/14
to media...@googlegroups.com
Hi Steve -
 
Can you verify that you have your ALLOWED_HOSTS set up correctly? Here's more information:


Thanks,
Susan

On Sun, Sep 28, 2014 at 8:10 PM, steven hodges <sho...@gmail.com> wrote:

steven hodges

unread,
Oct 1, 2014, 1:59:20 PM10/1/14
to media...@googlegroups.com
Hi Susan...

It seems like that was exactly the problem -- I had not overridden the ALLOWED_HOSTS that appears in the settings_shared.py file. I put this into my local_settings.py file:

ALLOWED_HOSTS = [ '*' ]

​and removed the DEBUG=True statement, and things work fine now. Thank you very much!

Susan Dreher

unread,
Oct 2, 2014, 11:48:21 AM10/2/14
to media...@googlegroups.com
Hi Steven -
 
That's terrific. John Wallace and I tracked down this problem in his environment, and I was hoping this was your issue too.

Just a note: Narrowing down your ALLOWED_HOSTS to include your domain is a more secure way to go. Ours looks like this: ALLOWED_HOSTS = ['.ccnmtl.columbia.edu', 'localhost'].

Cheers,
Susan


Reply all
Reply to author
Forward
0 new messages