Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

'Callback invoke error: error' Again

When on a question page, I get the 'Callback invoke error: error' message on the following actions: 'delete', 'flag offensive', and vote up and vote down.

I would appreciate any pointers on how to resolve this. It seems to be related to using the wrong encoding at some level of the system, but I'm not sure which part. My messages are localized to Arabic, but I'm not mixing languages, so in settings.py

USE_I18N = True
LANGUAGE_CODE = 'ar'

I have included the log from the dev server for a short session:

#$ python manage.py runserver `hostname -i`:8000
/usr/local/lib/python2.6/dist-packages/django/db/__init__.py:19: DeprecationWarning: settings.DATABASE_* is deprecated; use settings.DATABASES instead.
  DeprecationWarning
/usr/local/lib/python2.6/dist-packages/django/db/__init__.py:60: DeprecationWarning: Short names for ENGINE in database configurations are deprecated. Prepend default.ENGINE with 'django.db.backends.'
  DeprecationWarning
/usr/local/lib/python2.6/dist-packages/django/db/__init__.py:19: DeprecationWarning: settings.DATABASE_* is deprecated; use settings.DATABASES instead.
  DeprecationWarning
/usr/local/lib/python2.6/dist-packages/django/db/__init__.py:60: DeprecationWarning: Short names for ENGINE in database configurations are deprecated. Prepend default.ENGINE with 'django.db.backends.'
  DeprecationWarning
Validating models...

0 errors found
Django version 1.3.1, using settings 'askbotqa.settings'
Development server is running at http://127.0.1.1:8000/
Quit the server with CONTROL-C.
/usr/local/lib/python2.6/dist-packages/django/contrib/auth/__init__.py:26: DeprecationWarning: Authentication backends without a `supports_object_permissions` attribute are deprecated. Please define it in <class 'askbot.deps.django_authopenid.backends.AuthBackend'>.
  DeprecationWarning)
/usr/local/lib/python2.6/dist-packages/django/contrib/auth/__init__.py:31: DeprecationWarning: Authentication backends without a `supports_anonymous_user` attribute are deprecated. Please define it in <class 'askbot.deps.django_authopenid.backends.AuthBackend'>.
  DeprecationWarning)
/usr/local/lib/python2.6/dist-packages/django/contrib/auth/models.py:393: DeprecationWarning: The user messaging API is deprecated. Please update your code to use the new messages framework.
  category=DeprecationWarning)
/usr/local/lib/python2.6/dist-packages/django/core/context_processors.py:27: DeprecationWarning: The context processor at `django.core.context_processors.auth` is deprecated; use the path `django.contrib.auth.context_processors.auth` instead.
  DeprecationWarning
[20/Jan/2012 21:01:06] "GET /%D8%B3%D8%A4%D8%A7%D9%84/3/d-twl-lbhth-n-lls-lhqyqy-lsrq-lhdhy HTTP/1.1" 200 22799
[20/Jan/2012 21:01:07] "GET /m/default/media/style/style.css?v=7 HTTP/1.1" 304 0
[20/Jan/2012 21:01:07] "GET /m/common/media/js/wmd/wmd.css?v=7 HTTP/1.1" 304 0
[20/Jan/2012 21:01:07] "GET /m/common/media/js/jquery-1.4.3.js?v=7 HTTP/1.1" 304 0
[20/Jan/2012 21:01:07] "GET /m/common/media/js/utils.js?v=7 HTTP/1.1" 304 0
[20/Jan/2012 21:01:07] "GET /jsi18n/ HTTP/1.1" 200 13955
[20/Jan/2012 21:01:07] "GET /m/common/media/js/editor.js?v=7 HTTP/1.1" 304 0
[20/Jan/2012 21:01:07] "GET /m/common/media/js/wmd/showdown.js?v=7 HTTP/1.1" 304 0
[20/Jan/2012 21:01:07] "GET /m/common/media/js/wmd/wmd.js?v=7 HTTP/1.1" 304 0
[20/Jan/2012 21:01:07] "GET /m/common/media/js/jquery.validate.min.js?v=7 HTTP/1.1" 304 0
[20/Jan/2012 21:01:07] "GET /m/common/media/js/post.js?v=7 HTTP/1.1" 304 0
Traceback (most recent call last):
  File "/usr/local/lib/python2.6/dist-packages/django/core/servers/basehttp.py", line 283, in run
    self.result = application(self.environ, self.start_response)
  File "/usr/local/lib/python2.6/dist-packages/django/contrib/staticfiles/handlers.py", line 68, in __call__
    return self.application(environ, start_response)
  File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/wsgi.py", line 272, in __call__
    response = self.get_response(request)
  File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/base.py", line 146, in get_response
    response = debug.technical_404_response(request, e)
  File "/usr/local/lib/python2.6/dist-packages/django/views/debug.py", line 294, in technical_404_response
    'reason': smart_str(exception, errors='replace'),
  File "/usr/local/lib/python2.6/dist-packages/django/utils/encoding.py", line 123, in smart_str
    errors) for arg in s])
  File "/usr/local/lib/python2.6/dist-packages/django/utils/encoding.py", line 124, in smart_str
    return unicode(s).encode(encoding, errors)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 24-29: ordinal not in range(128)
[20/Jan/2012 21:01:42] "POST /%D8%A7%D9%84%D8%A3%D8%B3%D8%A6%D9%84%D8%A9/3/vote/ HTTP/1.1" 500 1202

'Callback invoke error: error' Again

When on a question page, I get the 'Callback invoke error: error' message on the following actions: 'delete', 'flag offensive', and vote up and vote down.

I would appreciate any pointers on how to resolve this. It seems to be related to using the wrong encoding at some level of the system, but I'm not sure which part. My messages are localized to Arabic, but I'm not mixing languages, so in settings.py

USE_I18N = True
LANGUAGE_CODE = 'ar'

I have included the log from the dev server for a short session:

#$ python manage.py runserver `hostname -i`:8000
/usr/local/lib/python2.6/dist-packages/django/db/__init__.py:19: DeprecationWarning: settings.DATABASE_* is deprecated; use settings.DATABASES instead.
  DeprecationWarning
/usr/local/lib/python2.6/dist-packages/django/db/__init__.py:60: DeprecationWarning: Short names for ENGINE in database configurations are deprecated. Prepend default.ENGINE with 'django.db.backends.'
  DeprecationWarning
/usr/local/lib/python2.6/dist-packages/django/db/__init__.py:19: DeprecationWarning: settings.DATABASE_* is deprecated; use settings.DATABASES instead.
  DeprecationWarning
/usr/local/lib/python2.6/dist-packages/django/db/__init__.py:60: DeprecationWarning: Short names for ENGINE in database configurations are deprecated. Prepend default.ENGINE with 'django.db.backends.'
  DeprecationWarning
Validating models...

0 errors found
Django version 1.3.1, using settings 'askbotqa.settings'
Development server is running at http://127.0.1.1:8000/
Quit the server with CONTROL-C.
/usr/local/lib/python2.6/dist-packages/django/contrib/auth/__init__.py:26: DeprecationWarning: Authentication backends without a `supports_object_permissions` attribute are deprecated. Please define it in <class 'askbot.deps.django_authopenid.backends.AuthBackend'>.
  DeprecationWarning)
/usr/local/lib/python2.6/dist-packages/django/contrib/auth/__init__.py:31: DeprecationWarning: Authentication backends without a `supports_anonymous_user` attribute are deprecated. Please define it in <class 'askbot.deps.django_authopenid.backends.AuthBackend'>.
  DeprecationWarning)
/usr/local/lib/python2.6/dist-packages/django/contrib/auth/models.py:393: DeprecationWarning: The user messaging API is deprecated. Please update your code to use the new messages framework.
  category=DeprecationWarning)
/usr/local/lib/python2.6/dist-packages/django/core/context_processors.py:27: DeprecationWarning: The context processor at `django.core.context_processors.auth` is deprecated; use the path `django.contrib.auth.context_processors.auth` instead.
  DeprecationWarning
[20/Jan/2012 21:01:06] "GET /%D8%B3%D8%A4%D8%A7%D9%84/3/d-twl-lbhth-n-lls-lhqyqy-lsrq-lhdhy HTTP/1.1" 200 22799
[20/Jan/2012 21:01:07] "GET /m/default/media/style/style.css?v=7 HTTP/1.1" 304 0
[20/Jan/2012 21:01:07] "GET /m/common/media/js/wmd/wmd.css?v=7 HTTP/1.1" 304 0
[20/Jan/2012 21:01:07] "GET /m/common/media/js/jquery-1.4.3.js?v=7 HTTP/1.1" 304 0
[20/Jan/2012 21:01:07] "GET /m/common/media/js/utils.js?v=7 HTTP/1.1" 304 0
[20/Jan/2012 21:01:07] "GET /jsi18n/ HTTP/1.1" 200 13955
[20/Jan/2012 21:01:07] "GET /m/common/media/js/editor.js?v=7 HTTP/1.1" 304 0
[20/Jan/2012 21:01:07] "GET /m/common/media/js/wmd/showdown.js?v=7 HTTP/1.1" 304 0
[20/Jan/2012 21:01:07] "GET /m/common/media/js/wmd/wmd.js?v=7 HTTP/1.1" 304 0
[20/Jan/2012 21:01:07] "GET /m/common/media/js/jquery.validate.min.js?v=7 HTTP/1.1" 304 0
[20/Jan/2012 21:01:07] "GET /m/common/media/js/post.js?v=7 HTTP/1.1" 304 0
Traceback (most recent call last):
  File "/usr/local/lib/python2.6/dist-packages/django/core/servers/basehttp.py", line 283, in run
    self.result = application(self.environ, self.start_response)
  File "/usr/local/lib/python2.6/dist-packages/django/contrib/staticfiles/handlers.py", line 68, in __call__
    return self.application(environ, start_response)
  File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/wsgi.py", line 272, in __call__
    response = self.get_response(request)
  File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/base.py", line 146, in get_response
    response = debug.technical_404_response(request, e)
  File "/usr/local/lib/python2.6/dist-packages/django/views/debug.py", line 294, in technical_404_response
    'reason': smart_str(exception, errors='replace'),
  File "/usr/local/lib/python2.6/dist-packages/django/utils/encoding.py", line 123, in smart_str
    errors) for arg in s])
  File "/usr/local/lib/python2.6/dist-packages/django/utils/encoding.py", line 124, in smart_str
    return unicode(s).encode(encoding, errors)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 24-29: ordinal not in range(128)
[20/Jan/2012 21:01:42] "POST /%D8%A7%D9%84%D8%A3%D8%B3%D8%A6%D9%84%D8%A9/3/vote/ HTTP/1.1" 500 1202