d120 / pyofahrt

Verwaltungssoftware für die Erstsemesterfahrt
GNU Affero General Public License v3.0
4 stars 1 forks source link

Random Save Error in Ofahrt Wiki #113

Open miterion opened 6 years ago

miterion commented 6 years ago

From the error log

Internal Server Error: /ofahrt/wiki/Verantwortliche18/edit/

OperationalError at /wiki/Verantwortliche18/edit/
(1366, "Incorrect string value: '\\xF0\\x9F\\xA4\\xA8' for column 'text' at row 1")

Request Method: POST
Request URL: https://www.d120.de/ofahrt/wiki/Verantwortliche18/edit/
Django Version: 1.11.7
Python Executable: /usr/bin/uwsgi-core
Python Version: 3.4.2
Python Path: ['.', '', '/srv/pyofahrt/venv/lib/python3.4', '/srv/pyofahrt/venv/lib/python3.4/plat-x86_64-linux-gnu', '/srv/pyofahrt/venv/lib/python3.4/lib-dynload', '/usr/lib/python3.4', '/usr/lib/python3.4/plat-x86_64-linux-gnu', '/srv/pyofahrt/venv/lib/python3.4/site-packages']
Server time: Di, 16 Jan 2018 17:03:34 +0100
Installed Applications:
['django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'bootstrap3',
 'ofahrtbase',
 'members',
 'staff',
 'faq',
 'workshops',
 'tasks',
 'wiki']
Installed Middleware:
['django.middleware.security.SecurityMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware']

Traceback:  

File "/srv/pyofahrt/venv/lib/python3.4/site-packages/django/db/backends/utils.py" in execute
  65.                 return self.cursor.execute(sql, params)

File "/srv/pyofahrt/venv/lib/python3.4/site-packages/django/db/backends/mysql/base.py" in execute
  101.             return self.cursor.execute(query, args)

File "/srv/pyofahrt/venv/lib/python3.4/site-packages/MySQLdb/cursors.py" in execute
  250.             self.errorhandler(self, exc, value)

File "/srv/pyofahrt/venv/lib/python3.4/site-packages/MySQLdb/connections.py" in defaulterrorhandler
  50.         raise errorvalue

File "/srv/pyofahrt/venv/lib/python3.4/site-packages/MySQLdb/cursors.py" in execute
  247.             res = self._query(query)

File "/srv/pyofahrt/venv/lib/python3.4/site-packages/MySQLdb/cursors.py" in _query
  411.         rowcount = self._do_query(q)

File "/srv/pyofahrt/venv/lib/python3.4/site-packages/MySQLdb/cursors.py" in _do_query
  374.         db.query(q)

File "/srv/pyofahrt/venv/lib/python3.4/site-packages/MySQLdb/connections.py" in query
  277.             _mysql.connection.query(self, query)

      The above exception ((1366, "Incorrect string value: '\\xF0\\x9F\\xA4\\xA8' for column 'text' at row 1")) was the direct cause of the following exception:

File "/srv/pyofahrt/venv/lib/python3.4/site-packages/django/core/handlers/exception.py" in inner
  41.             response = get_response(request)

File "/srv/pyofahrt/venv/lib/python3.4/site-packages/django/core/handlers/base.py" in _legacy_get_response
  249.             response = self._get_response(request)

File "/srv/pyofahrt/venv/lib/python3.4/site-packages/django/core/handlers/base.py" in _get_response
  187.                 response = self.process_exception_by_middleware(e, request)

File "/srv/pyofahrt/venv/lib/python3.4/site-packages/django/core/handlers/base.py" in _get_response
  185.                 response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "/srv/pyofahrt/venv/lib/python3.4/site-packages/django/contrib/auth/decorators.py" in _wrapped_view
  23.                 return view_func(request, *args, **kwargs)

File "/srv/pyofahrt/venv/lib/python3.4/site-packages/django/views/generic/base.py" in view
  68.             return self.dispatch(request, *args, **kwargs)

File "/srv/pyofahrt/venv/lib/python3.4/site-packages/django/views/generic/base.py" in dispatch
  88.         return handler(request, *args, **kwargs)

File "/srv/pyofahrt/venv/lib/python3.4/site-packages/django/views/generic/edit.py" in post
  217.         return super(BaseCreateView, self).post(request, *args, **kwargs)

File "/srv/pyofahrt/venv/lib/python3.4/site-packages/django/views/generic/edit.py" in post
  183.             return self.form_valid(form)

File "./wiki/views.py" in form_valid
  127.         return super(PageEditView, self).form_valid(form)

File "/srv/pyofahrt/venv/lib/python3.4/site-packages/django/views/generic/edit.py" in form_valid
  162.         self.object = form.save()

File "/srv/pyofahrt/venv/lib/python3.4/site-packages/django/forms/models.py" in save
  468.             self.instance.save()

File "/srv/pyofahrt/venv/lib/python3.4/site-packages/django/db/models/base.py" in save
  808.                        force_update=force_update, update_fields=update_fields)

File "/srv/pyofahrt/venv/lib/python3.4/site-packages/django/db/models/base.py" in save_base
  838.             updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)

File "/srv/pyofahrt/venv/lib/python3.4/site-packages/django/db/models/base.py" in _save_table
  924.             result = self._do_insert(cls._base_manager, using, fields, update_pk, raw)

File "/srv/pyofahrt/venv/lib/python3.4/site-packages/django/db/models/base.py" in _do_insert
  963.                                using=using, raw=raw)

File "/srv/pyofahrt/venv/lib/python3.4/site-packages/django/db/models/manager.py" in manager_method
  85.                 return getattr(self.get_queryset(), name)(*args, **kwargs)

File "/srv/pyofahrt/venv/lib/python3.4/site-packages/django/db/models/query.py" in _insert
  1076.         return query.get_compiler(using=using).execute_sql(return_id)

File "/srv/pyofahrt/venv/lib/python3.4/site-packages/django/db/models/sql/compiler.py" in execute_sql
  1107.                 cursor.execute(sql, params)

File "/srv/pyofahrt/venv/lib/python3.4/site-packages/django/db/backends/utils.py" in execute
  65.                 return self.cursor.execute(sql, params)

File "/srv/pyofahrt/venv/lib/python3.4/site-packages/django/db/utils.py" in __exit__
  94.                 six.reraise(dj_exc_type, dj_exc_value, traceback)

File "/srv/pyofahrt/venv/lib/python3.4/site-packages/django/utils/six.py" in reraise
  685.             raise value.with_traceback(tb)

File "/srv/pyofahrt/venv/lib/python3.4/site-packages/django/db/backends/utils.py" in execute
  65.                 return self.cursor.execute(sql, params)

File "/srv/pyofahrt/venv/lib/python3.4/site-packages/django/db/backends/mysql/base.py" in execute
  101.             return self.cursor.execute(query, args)

File "/srv/pyofahrt/venv/lib/python3.4/site-packages/MySQLdb/cursors.py" in execute
  250.             self.errorhandler(self, exc, value)

File "/srv/pyofahrt/venv/lib/python3.4/site-packages/MySQLdb/connections.py" in defaulterrorhandler
  50.         raise errorvalue

File "/srv/pyofahrt/venv/lib/python3.4/site-packages/MySQLdb/cursors.py" in execute
  247.             res = self._query(query)

File "/srv/pyofahrt/venv/lib/python3.4/site-packages/MySQLdb/cursors.py" in _query
  411.         rowcount = self._do_query(q)

File "/srv/pyofahrt/venv/lib/python3.4/site-packages/MySQLdb/cursors.py" in _do_query
  374.         db.query(q)

File "/srv/pyofahrt/venv/lib/python3.4/site-packages/MySQLdb/connections.py" in query
  277.             _mysql.connection.query(self, query)

Exception Type: OperationalError at /wiki/Verantwortliche18/edit/
Exception Value: (1366, "Incorrect string value: '\\xF0\\x9F\\xA4\\xA8' for column 'text' at row 1")
pollti commented 6 years ago

This happened when trying to paste an emoticon for testing purposes, so it's not highly critical, but it should be prevented or fixed anyway.

miterion commented 6 years ago

It also happens for other symbols so we should look into it.