#4187 Test hotfix that fixes feedback bug in ask
Closed: Fixed None Opened 10 years ago by ankursinha.

We seem to have found a fix for the feedback bug. Unfortunately, it was made just after the 0.7.49 release that we're using:

https://github.com/ASKBOT/askbot-devel/pull/173

I'm attaching a patch to be tested as a hotfix on the staging instance. I'll try it out as soon as I have the cycles to get up to speed with ansible.

Thanks,[[BR]]
Warm regards,[[BR]]
Ankur


Patch from 0.7.49 to the commit that fixes it, only for the required file
askbot-fix-feedback-function.patch

Staging actually works, just production doesn't. ;(

I pushed this patch/hotfix into production, but it didn't seem to help.

I still got:

{{{
[Tue Jan 21 18:28:16 2014] [error] [client 192.168.1.12] mod_wsgi (pid=10970): Exception occurred processing WSGI script '/usr/sbin/askbot.wsgi'.
[Tue Jan 21 18:28:16 2014] [error] [client 192.168.1.12] Traceback (most recent call last):
[Tue Jan 21 18:28:16 2014] [error] [client 192.168.1.12] File "/usr/lib/python2.6/site-packages/django/core/handlers/wsgi.py", line 241, in call
[Tue Jan 21 18:28:16 2014] [error] [client 192.168.1.12] response = self.get_response(request)
[Tue Jan 21 18:28:16 2014] [error] [client 192.168.1.12] File "/usr/lib/python2.6/site-packages/django/core/handlers/base.py", line 179, in get_response
[Tue Jan 21 18:28:16 2014] [error] [client 192.168.1.12] response = self.handle_uncaught_exception(request, resolver, sys.exc_info())
[Tue Jan 21 18:28:16 2014] [error] [client 192.168.1.12] File "/usr/lib/python2.6/site-packages/django/core/handlers/base.py", line 228, in handle_uncaught_exception
[Tue Jan 21 18:28:16 2014] [error] [client 192.168.1.12] return callback(request, param_dict)
[Tue Jan 21 18:28:16 2014] [error] [client 192.168.1.12] File "/usr/lib/python2.6/site-packages/django/utils/decorators.py", line 91, in _wrapped_view
[Tue Jan 21 18:28:16 2014] [error] [client 192.168.1.12] response = view_func(request, *args,
kwargs)
[Tue Jan 21 18:28:16 2014] [error] [client 192.168.1.12] File "/usr/lib/python2.6/site-packages/django/views/defaults.py", line 33, in server_error
[Tue Jan 21 18:28:16 2014] [error] [client 192.168.1.12] return http.HttpResponseServerError(t.render(Context({})))
[Tue Jan 21 18:28:16 2014] [error] [client 192.168.1.12] File "/usr/lib/python2.6/site-packages/coffin/template/init.py", line 54, in render
[Tue Jan 21 18:28:16 2014] [error] [client 192.168.1.12] return super(Template, self).render(**context)
[Tue Jan 21 18:28:16 2014] [error] [client 192.168.1.12] File "/usr/lib64/python2.6/site-packages/jinja2/environment.py", line 669, in render
[Tue Jan 21 18:28:16 2014] [error] [client 192.168.1.12] return self.environment.handle_exception(exc_info, True)
[Tue Jan 21 18:28:16 2014] [error] [client 192.168.1.12] File "/usr/lib/python2.6/site-packages/askbot/templates/500.html", line 1, in top-level template code
[Tue Jan 21 18:28:16 2014] [error] [client 192.168.1.12] {% extends "two_column_body.html" %}
[Tue Jan 21 18:28:16 2014] [error] [client 192.168.1.12] File "/usr/lib/python2.6/site-packages/askbot/templates/two_column_body.html", line 1, in top-level template code
[Tue Jan 21 18:28:16 2014] [error] [client 192.168.1.12] {% extends "base.html" %}
[Tue Jan 21 18:28:16 2014] [error] [client 192.168.1.12] File "/usr/lib/python2.6/site-packages/askbot/templates/base.html", line 5, in top-level template code
[Tue Jan 21 18:28:16 2014] [error] [client 192.168.1.12] <title>{% block title %}{% endblock %} - {{ settings.APP_TITLE|escape }}</title>
[Tue Jan 21 18:28:16 2014] [error] [client 192.168.1.12] File "/usr/lib64/python2.6/site-packages/jinja2/environment.py", line 350, in getattr
[Tue Jan 21 18:28:16 2014] [error] [client 192.168.1.12] return getattr(obj, attribute)
[Tue Jan 21 18:28:16 2014] [error] [client 192.168.1.12] UndefinedError: 'settings' is undefined
}}}

Since we're using exactly the same environment (package versions etc.) in both staging and prod, the bug should either hit both, or neither. It's a weird one. I'll look into it this week.

There are a few differences, possibly one of them is causing things:

  • They have different databases/db content.

  • There's a few language settings different.

  • Staging is using locmem caching (local memory) and production uses memcached.

Dunno if any of those play into it.

I realized that we need to check logs of both ask01 and ask02 and got this from the httpd error log:

{{{
/usr/lib/python2.6/site-packages/django/core/handlers/base.py TIME: 2014-01-28 05:17:29,209 MSG: base.py:handle_uncaught_exception:215 Internal Server Error: /en/feedback/
Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/django/core/handlers/base.py", line 111, in get_response
response = callback(request, callback_args, callback_kwargs)
File "/usr/lib/python2.6/site-packages/django/utils/decorators.py", line 91, in _wrapped_view
response = view_func(request, *args,
kwargs)
File "/usr/lib/python2.6/site-packages/askbot/views/meta.py", line 120, in feedback
headers=headers
File "/usr/lib/python2.6/site-packages/askbot/mail/init.py", line 181, in mail_moderators
msg.send()
File "/usr/lib/python2.6/site-packages/django/core/mail/message.py", line 248, in send
return self.get_connection(fail_silently).send_messages([self])
File "/usr/lib/python2.6/site-packages/post_office/backends.py", line 42, in send_messages
priority=PRIORITY.medium)
File "/usr/lib/python2.6/site-packages/django/db/models/manager.py", line 137, in create
return self.get_query_set().create(
*kwargs)
File "/usr/lib/python2.6/site-packages/django/db/models/query.py", line 377, in create
obj.save(force_insert=True, using=self.db)
File "/usr/lib/python2.6/site-packages/post_office/models.py", line 108, in save
self.full_clean()
File "/usr/lib/python2.6/site-packages/django/db/models/base.py", line 824, in full_clean
raise ValidationError(errors)
ValidationError: {'to': [u'This field cannot be blank.']}
}}}

Looking at https://github.com/ASKBOT/askbot-devel/blob/cfe6efc153e5ad37e506b931af15e3c2e6635a73/askbot/mail/__init__.py#L161 , this implies that recipient_list is for some reason empty. (post_office says that only this field is mandatory: https://github.com/ui/django-post_office )

It's working in staging though, so it shouldn't be a code issue. Thoughts?

No idea. :( I looked at config on both and didn't see anything stand out for a feedback to or anything. ;(

Feedback now works with the newly updated askbot version.

Login to comment on this ticket.

Metadata