Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

'Thread matching query does not exist' when posting question.

I'm trying to integrate Askbot as a part of a larger site. I forked the repo (askbot-devel) to modify some tests to suit my settings, after performing a syncdb and migrate command, everything went fine, except that I can't post a question. When I submit a question, it's showing Thread does not exists.

Here is the error log:

Environment:
Request Method: POST
Request URL: http://localhost:8000/question/questions/ask/

Django Version: 1.3.1
Python Version: 2.7.3
Installed Applications:
['longerusername',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'grappelli',
'django.contrib.admin',
'django.contrib.sitemaps',
'group_messaging',
'askbot',
'askbot.deps.django_authopenid',
'askbot.deps.livesettings',
'south',
'compressor',
'tinymce',
'captcha',
'social_auth',
'taggit',
'mptt',
'easy_thumbnails',
'widget_tweaks',
'jquery_widgets',
'django_open_inviter',
'django_extensions',
'djcelery',
'djkombu',
'seacucumber',
'faq',
'django_tables2',
'haystack',
'raven.contrib.django',
'references',
'qualifications',
'accounts',
'articles',
'institutions',
'vocations',
'students',
'shortlists',
'educations',
'partners',
'partners.agents',
'applications',
'reviews',
'hescar_utils',
'pstest',
'inquiries',
'staticpages',
'medias',
'emails',
'external',
'caches',
'targeted_ads',
'treasurehunt',
'subscribers',
'backend',
'backend.assigns',
'backend.streams',
'backend.labels',
'backend.kivs',
'backend.tasks',
'backend.appointments',
'backend.reminders',
'appback.users',
'appback.core',
'appback.notes',
'appback.appointments_old',
'appback.references',
'appback.students',
'appback.reminders',
'appback.coldcalls',
'debug_toolbar']
Installed Middleware:
('django.middleware.cache.UpdateCacheMiddleware',
'johnny.middleware.LocalStoreClearMiddleware',
'johnny.middleware.QueryCacheMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'hescar_utils.middleware.LocalizationURLMiddleware',
'backend.middleware.LanguageForcingMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'askbot.middleware.anon_user.ConnectToSessionMessagesMiddleware',
'askbot.middleware.forum_mode.ForumModeMiddleware',
'askbot.middleware.cancel.CancelActionMiddleware',
'django.middleware.transaction.TransactionMiddleware',
'askbot.middleware.view_log.ViewLogMiddleware',
'askbot.middleware.spaceless.SpacelessMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'hescar_utils.middleware.SpacelessMiddleware',
'hescar_utils.middleware.ThreadLocals',
'hescar_utils.middleware.DFPMiddleware',
'hescar_utils.middleware.LoginMiddleware',
'hescar_utils.middleware.PasswordRequiredMiddleware',
'hescar_utils.middleware.PageVisitCounterMiddleware',
'hescar_utils.middleware.MBAMiddleware',
'django.middleware.cache.FetchFromCacheMiddleware',
'debug_toolbar.middleware.DebugToolbarMiddleware')


Traceback:
File "/home/kecebongsoft/workspaces/easyuni/easyuni-env/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
117.                             response = middleware_method(request, e)
File "/home/kecebongsoft/workspaces/easyuni/easyuni-env/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
111.                         response = callback(request, *callback_args, **callback_kwargs)
File "/home/kecebongsoft/workspaces/easyuni/easyuni-env/local/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapped_view
93.                     response = view_func(request, *args, **kwargs)
File "/home/kecebongsoft/workspaces/easyuni/easyuni-env/src/askbot/askbot/utils/decorators.py" in wrapper
135.             return view_func(request, *args, **kwargs)
File "/home/kecebongsoft/workspaces/easyuni/easyuni-env/src/askbot/askbot/utils/decorators.py" in wrapper
230.             return view_func(request, *args, **kwargs)
File "/home/kecebongsoft/workspaces/easyuni/easyuni-env/src/askbot/askbot/views/writers.py" in ask
244.                     return HttpResponseRedirect(question.get_absolute_url())
File "/home/kecebongsoft/workspaces/easyuni/easyuni-env/local/lib/python2.7/site-packages/django/utils/functional.py" in _curried
55.         return _curried_func(*(args+moreargs), **dict(kwargs, **morekwargs))
File "/home/kecebongsoft/workspaces/easyuni/easyuni-env/local/lib/python2.7/site-packages/django/db/models/base.py" in get_absolute_url
887.     return settings.ABSOLUTE_URL_OVERRIDES.get('%s.%s' % (opts.app_label, opts.module_name), func)(self, *args, **kwargs)
File "/home/kecebongsoft/workspaces/easyuni/easyuni-env/src/askbot/askbot/models/post.py" in get_absolute_url
758.                 url += django_urlquote(self.slug) + '/'
File "/home/kecebongsoft/workspaces/easyuni/easyuni-env/src/askbot/askbot/models/post.py" in _get_slug
821.         return slugify(self.thread.title)
File "/home/kecebongsoft/workspaces/easyuni/easyuni-env/local/lib/python2.7/site-packages/django/db/models/fields/related.py" in __get__
315.                 rel_obj = QuerySet(self.field.rel.to).using(db).get(**params)
File "/home/kecebongsoft/workspaces/easyuni/easyuni-env/local/lib/python2.7/site-packages/django/db/models/query.py" in get
349.                     % self.model._meta.object_name)

Exception Type: DoesNotExist at /question/questions/ask/
Exception Value: Thread matching query does not exist.

Notice that somehow it returns a Thread and Post objects, but when I checked from admin->Askbot->Post (and from shell), nothing there, when I print the pk of the Post object for every submit, it's increasing. I tried putting a save call in the _question_post and some related places, because I thought that was the reason it's not saving, but no luck. I also thought this has something to do with Django's autocommit, is that true?

Here's my stack:

BeautifulSoup==3.2.0
Django==1.3.1
pillow
PyYAML==3.10
South==0.7.3
Whoosh==2.3.2
amqplib==1.0.2
anyjson==0.3.1
boto==2.1.1
celery==2.5.0
distribute==0.6.24
django-appconf==0.4.1
django-celery==2.5.0
django-compressor==1.1
django-debug-toolbar==0.8.5
django-extensions==0.6
django-faq
django-grappelli==2.3.4
-e git+https://github.com/toastdriven/django-haystack.git@189f6d5dc484ad00afab071296f868cffc0ea26b#egg=django_haystack-dev
django-indexer==0.3.0
django-kombu==0.9.4
django-model-utils==1.0.0
django-paging==0.2.4
django-picklefield==0.2.0
django-queued-storage==0.3
django-social-auth==0.7.7
django-recaptcha==0.0.3
django-registration==0.7
django-storages==1.1.3
django-tables2==0.10.2
django-taggit==0.9.3
django-templatetag-sugar==0.1
easy-thumbnails==1.0-alpha-18
html5lib==0.90
httplib2==0.7.2
johnny-cache==0.3.3
kombu==2.1.1
lxml==2.3
newrelic
oauth2==1.5.211
paramiko==1.7.7.1
pep8==0.6.1
pisa==3.0.33
psycopg2==2.4.2
pyPdf==1.13
pycountry==0.14.1
pycrypto==2.4.1
pyparsing==1.5.6
pysolr==2.0.15
python-dateutil==1.5
python-memcached==1.47
python-openid==2.2.5
raven==1.5.0
reportlab==2.5
requests==0.7.4
seacucumber==1.3
simplejson==2.5.0
ssh==1.7.12
wsgiref==0.1.2
-e git+https://github.com/kecebongsoft/askbot-devel#egg=askbot
pygments==1.5

'Thread matching query does not exist' when posting question.

I'm trying to integrate Askbot as a part of a larger site. I forked the repo (askbot-devel) to modify some tests to suit my settings, after performing a syncdb and migrate command, everything went fine, except that I can't post a question. When I submit a question, it's showing Thread does not exists.

Here is the error log:

Environment:
Request Method: POST
Request URL: http://localhost:8000/question/questions/ask/

Django Version: 1.3.1
Python Version: 2.7.3
Installed Applications:
['longerusername',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'grappelli',
'django.contrib.admin',
'django.contrib.sitemaps',
'group_messaging',
'askbot',
'askbot.deps.django_authopenid',
'askbot.deps.livesettings',
'south',
'compressor',
'tinymce',
'captcha',
'social_auth',
'taggit',
'mptt',
'easy_thumbnails',
'widget_tweaks',
'jquery_widgets',
'django_open_inviter',
'django_extensions',
'djcelery',
'djkombu',
'seacucumber',
'faq',
'django_tables2',
'haystack',
'raven.contrib.django',
'references',
'qualifications',
'accounts',
'articles',
'institutions',
'vocations',
'students',
'shortlists',
'educations',
'partners',
'partners.agents',
'applications',
'reviews',
'hescar_utils',
'pstest',
'inquiries',
'staticpages',
'medias',
'emails',
'external',
'caches',
'targeted_ads',
'treasurehunt',
'subscribers',
'backend',
'backend.assigns',
'backend.streams',
'backend.labels',
'backend.kivs',
'backend.tasks',
'backend.appointments',
'backend.reminders',
'appback.users',
'appback.core',
'appback.notes',
'appback.appointments_old',
'appback.references',
'appback.students',
'appback.reminders',
'appback.coldcalls',
'debug_toolbar']
Installed Middleware:
('django.middleware.cache.UpdateCacheMiddleware',
'johnny.middleware.LocalStoreClearMiddleware',
'johnny.middleware.QueryCacheMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'hescar_utils.middleware.LocalizationURLMiddleware',
'backend.middleware.LanguageForcingMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'askbot.middleware.anon_user.ConnectToSessionMessagesMiddleware',
'askbot.middleware.forum_mode.ForumModeMiddleware',
'askbot.middleware.cancel.CancelActionMiddleware',
'django.middleware.transaction.TransactionMiddleware',
'askbot.middleware.view_log.ViewLogMiddleware',
'askbot.middleware.spaceless.SpacelessMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'hescar_utils.middleware.SpacelessMiddleware',
'hescar_utils.middleware.ThreadLocals',
'hescar_utils.middleware.DFPMiddleware',
'hescar_utils.middleware.LoginMiddleware',
'hescar_utils.middleware.PasswordRequiredMiddleware',
'hescar_utils.middleware.PageVisitCounterMiddleware',
'hescar_utils.middleware.MBAMiddleware',
'django.middleware.cache.FetchFromCacheMiddleware',
'debug_toolbar.middleware.DebugToolbarMiddleware')


Traceback:
File "/home/kecebongsoft/workspaces/easyuni/easyuni-env/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
117.                             response = middleware_method(request, e)
File "/home/kecebongsoft/workspaces/easyuni/easyuni-env/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
111.                         response = callback(request, *callback_args, **callback_kwargs)
File "/home/kecebongsoft/workspaces/easyuni/easyuni-env/local/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapped_view
93.                     response = view_func(request, *args, **kwargs)
File "/home/kecebongsoft/workspaces/easyuni/easyuni-env/src/askbot/askbot/utils/decorators.py" in wrapper
135.             return view_func(request, *args, **kwargs)
File "/home/kecebongsoft/workspaces/easyuni/easyuni-env/src/askbot/askbot/utils/decorators.py" in wrapper
230.             return view_func(request, *args, **kwargs)
File "/home/kecebongsoft/workspaces/easyuni/easyuni-env/src/askbot/askbot/views/writers.py" in ask
244.                     return HttpResponseRedirect(question.get_absolute_url())
File "/home/kecebongsoft/workspaces/easyuni/easyuni-env/local/lib/python2.7/site-packages/django/utils/functional.py" in _curried
55.         return _curried_func(*(args+moreargs), **dict(kwargs, **morekwargs))
File "/home/kecebongsoft/workspaces/easyuni/easyuni-env/local/lib/python2.7/site-packages/django/db/models/base.py" in get_absolute_url
887.     return settings.ABSOLUTE_URL_OVERRIDES.get('%s.%s' % (opts.app_label, opts.module_name), func)(self, *args, **kwargs)
File "/home/kecebongsoft/workspaces/easyuni/easyuni-env/src/askbot/askbot/models/post.py" in get_absolute_url
758.                 url += django_urlquote(self.slug) + '/'
File "/home/kecebongsoft/workspaces/easyuni/easyuni-env/src/askbot/askbot/models/post.py" in _get_slug
821.         return slugify(self.thread.title)
File "/home/kecebongsoft/workspaces/easyuni/easyuni-env/local/lib/python2.7/site-packages/django/db/models/fields/related.py" in __get__
315.                 rel_obj = QuerySet(self.field.rel.to).using(db).get(**params)
File "/home/kecebongsoft/workspaces/easyuni/easyuni-env/local/lib/python2.7/site-packages/django/db/models/query.py" in get
349.                     % self.model._meta.object_name)

Exception Type: DoesNotExist at /question/questions/ask/
Exception Value: Thread matching query does not exist.

Notice that somehow it returns a Thread and Post objects, but when I checked from admin->Askbot->Post (and from shell), nothing there, when I print the pk of the Post object for every submit, it's increasing. I tried putting a save call in the _question_post and some related places, because I thought that was the reason it's not saving, but no luck. I also thought this has something to do with Django's autocommit, is that true?

Here's my stack:

BeautifulSoup==3.2.0
Django==1.3.1
pillow
PyYAML==3.10
South==0.7.3
Whoosh==2.3.2
amqplib==1.0.2
anyjson==0.3.1
boto==2.1.1
celery==2.5.0
distribute==0.6.24
django-appconf==0.4.1
django-celery==2.5.0
django-compressor==1.1
django-debug-toolbar==0.8.5
django-extensions==0.6
django-faq
django-grappelli==2.3.4
-e git+https://github.com/toastdriven/django-haystack.git@189f6d5dc484ad00afab071296f868cffc0ea26b#egg=django_haystack-dev
django-indexer==0.3.0
django-kombu==0.9.4
django-model-utils==1.0.0
django-paging==0.2.4
django-picklefield==0.2.0
django-queued-storage==0.3
django-social-auth==0.7.7
django-recaptcha==0.0.3
django-registration==0.7
django-storages==1.1.3
django-tables2==0.10.2
django-taggit==0.9.3
django-templatetag-sugar==0.1
easy-thumbnails==1.0-alpha-18
html5lib==0.90
httplib2==0.7.2
johnny-cache==0.3.3
kombu==2.1.1
lxml==2.3
newrelic
oauth2==1.5.211
paramiko==1.7.7.1
pep8==0.6.1
pisa==3.0.33
psycopg2==2.4.2
pyPdf==1.13
pycountry==0.14.1
pycrypto==2.4.1
pyparsing==1.5.6
pysolr==2.0.15
python-dateutil==1.5
python-memcached==1.47
python-openid==2.2.5
raven==1.5.0
reportlab==2.5
requests==0.7.4
seacucumber==1.3
simplejson==2.5.0
ssh==1.7.12
wsgiref==0.1.2
-e git+https://github.com/kecebongsoft/askbot-devel#egg=askbot
pygments==1.5