500 error when adding a plugin in admin page editor

Showing 1-2 of 2 messages
500 error when adding a plugin in admin page editor Brandon Smith 10/8/12 6:54 PM
Hello,

I'm getting a 500 error when I try to add a plugin to a page through the admin interface. Unfortunately, my apache logging is not working, so I cant see the error trace since its occurring on an ajax post instead of a page request. However, using chrome js console I can see that its a 500 error is happening on post requests to http://localhost/admin/cms/page/20/add-plugin/. On page load, there is also this js error happening on admin/cms/page: "Uncaught TypeError: Cannot call method 'apply' of undefined "

I am using django-cms 2.3, django 1.3.1, and mptt 0.5.2. I have localization turned off (USE_I18N and USE_L10N set to false). I am not having any issues accessing static or media files. I will be happy to provide any further information if it will help. I have read many similar threads about 500 errors when adding cms plugins to pages in the admin page, but none of the suggestions have helped. It would be greatly appreciated if anyone has a recommended fix for this or can suggest a way to troubleshoot.

-Brandon
Re: 500 error when adding a plugin in admin page editor Brandon Smith 10/10/12 10:05 PM
hi guys,

I've finally gotten the logs working and here's the stack trace of the ajax server error when adding a plugin:

[Wed Oct 10 23:50:31 2012] [error] Internal Server Error: /admin/cms/page/1/add-plugin/
[Wed Oct 10 23:50:31 2012] [error] Traceback (most recent call last):
[Wed Oct 10 23:50:31 2012] [error]   File "/var/www/kathanew/lib/python2.6/site-packages/django/core/handlers/base.py", line 11
[Wed Oct 10 23:50:31 2012] [error]     response = callback(request, *callback_args, **callback_kwargs)
[Wed Oct 10 23:50:31 2012] [error]   File "/var/www/kathanew/lib/python2.6/site-packages/django/utils/decorators.py", line 93, 
[Wed Oct 10 23:50:31 2012] [error]     response = view_func(request, *args, **kwargs)
[Wed Oct 10 23:50:31 2012] [error]   File "/var/www/kathanew/lib/python2.6/site-packages/django/views/decorators/cache.py", lin
[Wed Oct 10 23:50:31 2012] [error]     response = view_func(request, *args, **kwargs)
[Wed Oct 10 23:50:31 2012] [error]   File "/var/www/kathanew/lib/python2.6/site-packages/django/contrib/admin/sites.py", line 1
[Wed Oct 10 23:50:31 2012] [error]     return view(request, *args, **kwargs)
[Wed Oct 10 23:50:31 2012] [error]   File "/var/www/kathanew/lib/python2.6/site-packages/cms/admin/pageadmin.py", line 1109, in
[Wed Oct 10 23:50:31 2012] [error]     placeholder = get_object_or_404(Placeholder, pk=placeholder_id)
[Wed Oct 10 23:50:31 2012] [error]   File "/var/www/kathanew/lib/python2.6/site-packages/django/shortcuts/__init__.py", line 11
[Wed Oct 10 23:50:31 2012] [error]     return queryset.get(*args, **kwargs)
[Wed Oct 10 23:50:31 2012] [error]   File "/var/www/kathanew/lib/python2.6/site-packages/django/db/models/query.py", line 341, 
[Wed Oct 10 23:50:31 2012] [error]     clone = self.filter(*args, **kwargs)
[Wed Oct 10 23:50:31 2012] [error]   File "/var/www/kathanew/lib/python2.6/site-packages/django/db/models/query.py", line 550, 
[Wed Oct 10 23:50:31 2012] [error]     return self._filter_or_exclude(False, *args, **kwargs)
[Wed Oct 10 23:50:31 2012] [error]   File "/var/www/kathanew/lib/python2.6/site-packages/django/db/models/query.py", line 568, 
[Wed Oct 10 23:50:31 2012] [error]     clone.query.add_q(Q(*args, **kwargs))
[Wed Oct 10 23:50:31 2012] [error]   File "/var/www/kathanew/lib/python2.6/site-packages/django/db/models/sql/query.py", line 1
[Wed Oct 10 23:50:31 2012] [error]     can_reuse=used_aliases, force_having=force_having)
[Wed Oct 10 23:50:31 2012] [error]   File "/var/www/kathanew/lib/python2.6/site-packages/django/db/models/sql/query.py", line 1
[Wed Oct 10 23:50:31 2012] [error]     connector)
[Wed Oct 10 23:50:31 2012] [error]   File "/var/www/kathanew/lib/python2.6/site-packages/django/db/models/sql/where.py", line 6
[Wed Oct 10 23:50:31 2012] [error]     value = obj.prepare(lookup_type, value)
[Wed Oct 10 23:50:31 2012] [error]   File "/var/www/kathanew/lib/python2.6/site-packages/django/db/models/sql/where.py", line 3
[Wed Oct 10 23:50:31 2012] [error]     return self.field.get_prep_lookup(lookup_type, value)
[Wed Oct 10 23:50:31 2012] [error]   File "/var/www/kathanew/lib/python2.6/site-packages/django/db/models/fields/__init__.py", 
[Wed Oct 10 23:50:31 2012] [error]     return self.get_prep_value(value)
[Wed Oct 10 23:50:31 2012] [error]   File "/var/www/kathanew/lib/python2.6/site-packages/django/db/models/fields/__init__.py", 
[Wed Oct 10 23:50:31 2012] [error]     return int(value)
[Wed Oct 10 23:50:31 2012] [error] ValueError: invalid literal for int() with base 10: 'null'

Any ideas?

-B