This is the environment:

AWS Aurora database compatible with MySql.
Django 2.0.3 (Python 3.6)
Pip-Mysql dependencies: django-mysql==2.2.2, mysqlclient==1.3.12.
Master-Slave database configuration.

It seems that django or mysql engine always fails on certain queries resulting in this specific error:

Traceback (most recent call last):   File
  "/home/ubuntu/ivs/vpython/lib/python3.6/site-packages/django/db/models/fields/related_descriptors.py",
  line 158, in get
      rel_obj = self.field.get_cached_value(instance)   File "/home/ubuntu/ivs/vpython/lib/python3.6/site-packages/django/db/models/fields/mixins.py",
  line 13, in get_cached_value
      return instance._state.fields_cache[cache_name] KeyError: 'assigned_to'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):   File
  "/home/ubuntu/ivs/vpython/lib/python3.6/site-packages/django/db/backends/utils.py",
  line 85, in _execute
      return self.cursor.execute(sql, params)   File "/home/ubuntu/ivs/vpython/lib/python3.6/site-packages/django/db/backends/mysql/base.py",
  line 71, in execute
      return self.cursor.execute(query, args)   File "/home/ubuntu/ivs/vpython/lib/python3.6/site-packages/MySQLdb/cursors.py",
  line 253, in execute
      self._warning_check()   File "/home/ubuntu/ivs/vpython/lib/python3.6/site-packages/MySQLdb/cursors.py",
  line 148, in _warning_check
      warnings = db.show_warnings()   File "/home/ubuntu/ivs/vpython/lib/python3.6/site-packages/MySQLdb/connections.py",
  line 381, in show_warnings
      self.query("SHOW WARNINGS")   File "/home/ubuntu/ivs/vpython/lib/python3.6/site-packages/MySQLdb/connections.py",
  line 277, in query
      _mysql.connection.query(self, query)
  _mysql_exceptions.OperationalError: (2013, 'Lost connection to MySQL server during query')

Yes, one of my models have "assigend_to" field which is a foreign key. But why does it fail with a KeyError?
Did anyone have any similar KeyErrors and MySql lost connections as a result?
Wow, what actually was happening is this:

I was making queries with reverse-foreign keys.
Objects returned with with reverse-foreign keys contained some other foreign keys.
When I tried to access them e.g. 'assigned_to' i got this exception every time.
Django ORM key error with lost MySql connection