Repository: stephenmcd/mezzanine

Issue #1941: Incorrect String Value when installing Demo pages
Created: 2019-08-19T08:54:16Z
When installing the demo pages the following error occurs:

django.db.utils.OperationalError: (1366, "Incorrect string value: '\xCC\x81vila...' for column 'file' at row 1")

Django 1.11.23
Python 3.7
MySQL 5.7.27
For the time being, this can be fixed by setting your database character set to utf8mb4 after creating the database:
ALTER DATABASE yourDBname CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;

Duplicate issue #1940: Initial Demo Page Installation Error
Created: 2019-08-15T14:09:19Z
Upon answering the prompt for installing the initial demo pages, I am presented with the following traceback:

Password: 
Password (again): 
Superuser created successfully.
Installed 2 object(s) from 1 fixture(s)

Would you like to install some initial demo pages?
Eg: About us, Contact form, Gallery. (yes/no): yes

Creating demo pages: About us, Contact form, Gallery ...

Installed 16 object(s) from 3 fixture(s)
Traceback (most recent call last):
  File "/home/addohm/code_projects/WoWGuild/env/lib/python3.7/site-packages/django/db/backends/utils.py", line 65, in execute
    return self.cursor.execute(sql, params)
  File "/home/addohm/code_projects/WoWGuild/env/lib/python3.7/site-packages/django/db/backends/mysql/base.py", line 101, in execute
    return self.cursor.execute(query, args)
  File "/home/addohm/code_projects/WoWGuild/env/lib/python3.7/site-packages/MySQLdb/cursors.py", line 209, in execute
    res = self._query(query)
  File "/home/addohm/code_projects/WoWGuild/env/lib/python3.7/site-packages/MySQLdb/cursors.py", line 315, in _query
    db.query(q)
  File "/home/addohm/code_projects/WoWGuild/env/lib/python3.7/site-packages/MySQLdb/connections.py", line 226, in query
    _mysql.connection.query(self, query)
MySQLdb._exceptions.OperationalError: (1366, "Incorrect string value: '\\xCC\\x81vila...' for column 'file' at row 1")

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "manage.py", line 14, in <module>
    execute_from_command_line(sys.argv)
  File "/home/addohm/code_projects/WoWGuild/env/lib/python3.7/site-packages/django/core/management/__init__.py", line 363, in execute_from_command_line
    utility.execute()
  File "/home/addohm/code_projects/WoWGuild/env/lib/python3.7/site-packages/django/core/management/__init__.py", line 355, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/addohm/code_projects/WoWGuild/env/lib/python3.7/site-packages/django/core/management/base.py", line 283, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/home/addohm/code_projects/WoWGuild/env/lib/python3.7/site-packages/django/core/management/base.py", line 330, in execute
    output = self.handle(*args, **options)
  File "/home/addohm/code_projects/WoWGuild/env/lib/python3.7/site-packages/mezzanine/core/management/commands/createdb.py", line 61, in handle
    func()
  File "/home/addohm/code_projects/WoWGuild/env/lib/python3.7/site-packages/mezzanine/core/management/commands/createdb.py", line 124, in create_pages
    gallery.save()
  File "/home/addohm/code_projects/WoWGuild/env/lib/python3.7/site-packages/mezzanine/pages/models.py", line 88, in save
    super(Page, self).save(*args, **kwargs)
  File "/home/addohm/code_projects/WoWGuild/env/lib/python3.7/site-packages/mezzanine/core/models.py", line 460, in save
    super(Orderable, self).save(*args, **kwargs)
  File "/home/addohm/code_projects/WoWGuild/env/lib/python3.7/site-packages/mezzanine/core/models.py", line 265, in save
    super(Displayable, self).save(*args, **kwargs)
  File "/home/addohm/code_projects/WoWGuild/env/lib/python3.7/site-packages/mezzanine/core/models.py", line 98, in save
    super(Slugged, self).save(*args, **kwargs)
  File "/home/addohm/code_projects/WoWGuild/env/lib/python3.7/site-packages/mezzanine/core/models.py", line 71, in save
    super(SiteRelated, self).save(*args, **kwargs)
  File "/home/addohm/code_projects/WoWGuild/env/lib/python3.7/site-packages/mezzanine/core/models.py", line 155, in save
    super(MetaData, self).save(*args, **kwargs)
  File "/home/addohm/code_projects/WoWGuild/env/lib/python3.7/site-packages/mezzanine/core/models.py", line 218, in save
    super(TimeStamped, self).save(*args, **kwargs)
  File "/home/addohm/code_projects/WoWGuild/env/lib/python3.7/site-packages/mezzanine/galleries/models.py", line 108, in save
    self.images.create(file=saved_path)
  File "/home/addohm/code_projects/WoWGuild/env/lib/python3.7/site-packages/django/db/models/fields/related_descriptors.py", line 650, in create
    return super(RelatedManager, self.db_manager(db)).create(**kwargs)
  File "/home/addohm/code_projects/WoWGuild/env/lib/python3.7/site-packages/django/db/models/manager.py", line 85, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/home/addohm/code_projects/WoWGuild/env/lib/python3.7/site-packages/django/db/models/query.py", line 393, in create
    obj.save(force_insert=True, using=self.db)
  File "/home/addohm/code_projects/WoWGuild/env/lib/python3.7/site-packages/mezzanine/galleries/models.py", line 156, in save
    super(GalleryImage, self).save(*args, **kwargs)
  File "/home/addohm/code_projects/WoWGuild/env/lib/python3.7/site-packages/mezzanine/core/models.py", line 460, in save
    super(Orderable, self).save(*args, **kwargs)
  File "/home/addohm/code_projects/WoWGuild/env/lib/python3.7/site-packages/django/db/models/base.py", line 806, in save
    force_update=force_update, update_fields=update_fields)
  File "/home/addohm/code_projects/WoWGuild/env/lib/python3.7/site-packages/django/db/models/base.py", line 836, in save_base
    updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)
  File "/home/addohm/code_projects/WoWGuild/env/lib/python3.7/site-packages/django/db/models/base.py", line 922, in _save_table
    result = self._do_insert(cls._base_manager, using, fields, update_pk, raw)
  File "/home/addohm/code_projects/WoWGuild/env/lib/python3.7/site-packages/django/db/models/base.py", line 961, in _do_insert
    using=using, raw=raw)
  File "/home/addohm/code_projects/WoWGuild/env/lib/python3.7/site-packages/django/db/models/manager.py", line 85, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/home/addohm/code_projects/WoWGuild/env/lib/python3.7/site-packages/django/db/models/query.py", line 1060, in _insert
    return query.get_compiler(using=using).execute_sql(return_id)
  File "/home/addohm/code_projects/WoWGuild/env/lib/python3.7/site-packages/django/db/models/sql/compiler.py", line 1099, in execute_sql
    cursor.execute(sql, params)
  File "/home/addohm/code_projects/WoWGuild/env/lib/python3.7/site-packages/django/db/backends/utils.py", line 80, in execute
    return super(CursorDebugWrapper, self).execute(sql, params)
  File "/home/addohm/code_projects/WoWGuild/env/lib/python3.7/site-packages/django/db/backends/utils.py", line 65, in execute
    return self.cursor.execute(sql, params)
  File "/home/addohm/code_projects/WoWGuild/env/lib/python3.7/site-packages/django/db/utils.py", line 94, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/home/addohm/code_projects/WoWGuild/env/lib/python3.7/site-packages/django/utils/six.py", line 685, in reraise
    raise value.with_traceback(tb)
  File "/home/addohm/code_projects/WoWGuild/env/lib/python3.7/site-packages/django/db/backends/utils.py", line 65, in execute
    return self.cursor.execute(sql, params)
  File "/home/addohm/code_projects/WoWGuild/env/lib/python3.7/site-packages/django/db/backends/mysql/base.py", line 101, in execute
    return self.cursor.execute(query, args)
  File "/home/addohm/code_projects/WoWGuild/env/lib/python3.7/site-packages/MySQLdb/cursors.py", line 209, in execute
    res = self._query(query)
  File "/home/addohm/code_projects/WoWGuild/env/lib/python3.7/site-packages/MySQLdb/cursors.py", line 315, in _query
    db.query(q)
  File "/home/addohm/code_projects/WoWGuild/env/lib/python3.7/site-packages/MySQLdb/connections.py", line 226, in query
    _mysql.connection.query(self, query)
django.db.utils.OperationalError: (1366, "Incorrect string value: '\\xCC\\x81vila...' for column 'file' at row 1")


Django 1.11 and Python 3.7.3
Current SQLite is not usable, is MySQL is also not usable?

mysql  Ver 14.14 Distrib 5.7.27, for Linux (x86_64)
The contact form seems okay, the gallery seems okay, the About page just says "About us" at the top and has two sub-categories - Team and History.  There are two empty boxes on the right side of the page on all pages except Blog (the bottom box fills in with "Feeds RSS/Atom"), and the footer seems a bit wonky.

Closing comment (2021-09-24T21:07:19Z): Duplicate of #1941