I have updated my database tables from a MySQL dump and I'm trying to buildwatson again. However, a wild UnicodeDecodeError rises every time I run that command and it hasn't been a easy task to debug it.
I am not sure if I have been encoding my input fields correctly. But either way, how could I debug it to check which MySQL table/row is raising this exception?
Marcelos-MacBook-Pro:prm marcelosalloum$ python manage.py buildwatson
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/Library/Python/2.7/site-packages/Django-1.6-py2.7.egg/django/core/management/__init__.py", line 399, in execute_from_command_line
utility.execute()
File "/Library/Python/2.7/site-packages/Django-1.6-py2.7.egg/django/core/management/__init__.py", line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/Library/Python/2.7/site-packages/Django-1.6-py2.7.egg/django/core/management/base.py", line 242, in run_from_argv
self.execute(*args, **options.__dict__)
File "/Library/Python/2.7/site-packages/Django-1.6-py2.7.egg/django/core/management/base.py", line 285, in execute
output = self.handle(*args, **options)
File "/Library/Python/2.7/site-packages/Django-1.6-py2.7.egg/django/core/management/base.py", line 415, in handle
return self.handle_noargs(**options)
File "/Library/Python/2.7/site-packages/Django-1.6-py2.7.egg/django/db/transaction.py", line 399, in inner
return func(*args, **kwargs)
File "/Library/Python/2.7/site-packages/watson/management/commands/buildwatson.py", line 50, in handle_noargs
_bulk_save_search_entries(iter_search_entries())
File "/Library/Python/2.7/site-packages/watson/registration.py", line 168, in _bulk_save_search_entries
search_entry_batch = list(islice(search_entries, 0, batch_size))
File "/Library/Python/2.7/site-packages/watson/management/commands/buildwatson.py", line 34, in iter_search_entries
for search_entry in search_engine._update_obj_index_iter(obj):
File "/Library/Python/2.7/site-packages/watson/registration.py", line 416, in _update_obj_index_iter
"content": adapter.get_content(obj),
File "/Library/Python/2.7/site-packages/watson/registration.py", line 122, in get_content
for field_name in field_names
File "/Library/Python/2.7/site-packages/watson/registration.py", line 122, in <genexpr>
for field_name in field_names
File "/Library/Python/2.7/site-packages/watson/registration.py", line 65, in _resolve_field
search_adapter = self,
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 15: ordinal not in range(128)```