V2.28.21 升级至 V3.9.3 报错求助

一直使用的是V2版本,现在升级到V3版本的时候报错,麻烦大神指教。

看报错,要么redis服务有问题,要么,/opt/jumpserver/config/config.txt里的redis配置有问题

环境说明:
mysql5.7+redis5.0

现在升级的是测试环境,是从生产环境克隆过来的,之前除了redis没有克隆以外其他都是克隆的,今天经过提醒将redis数据进行了迁移,现在报错如下,麻烦看下。

Operations to perform:
Apply all migrations: accounts, acls, admin, applications, assets, audits, auth, authentication, captcha, common, contenttypes, django_cas_ng, django_celery_beat, notifications, ops, orgs, perms, rbac, sessions, settings, terminal, tickets, users
Running migrations:
Applying assets.0093_auto_20220403_1627…2023-12-13 16:58:58 Perform migrate failed, exit
Traceback (most recent call last):
File “/opt/py3/lib/python3.11/site-packages/django/db/backends/utils.py”, line 89, in _execute
return self.cursor.execute(sql, params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/opt/py3/lib/python3.11/site-packages/django/db/backends/mysql/base.py”, line 75, in execute
return self.cursor.execute(query, args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/opt/py3/lib/python3.11/site-packages/MySQLdb/cursors.py”, line 179, in execute
res = self._query(mogrified_query)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/opt/py3/lib/python3.11/site-packages/MySQLdb/cursors.py”, line 330, in _query
db.query(q)
File “/opt/py3/lib/python3.11/site-packages/MySQLdb/connections.py”, line 255, in query
_mysql.connection.query(self, query)
MySQLdb.OperationalError: (1071, ‘Specified key was too long; max key length is 767 bytes’)

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

Traceback (most recent call last):
File “/opt/jumpserver/./jms”, line 88, in perform_db_migrate
management.call_command(‘migrate’)
File “/opt/py3/lib/python3.11/site-packages/django/core/management/init.py”, line 198, in call_command
return command.execute(*args, **defaults)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/opt/py3/lib/python3.11/site-packages/django/core/management/base.py”, line 448, in execute
output = self.handle(*args, **options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/opt/py3/lib/python3.11/site-packages/django/core/management/base.py”, line 96, in wrapped
res = handle_func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/opt/py3/lib/python3.11/site-packages/django/core/management/commands/migrate.py”, line 349, in handle
post_migrate_state = executor.migrate(
^^^^^^^^^^^^^^^^^
File “/opt/py3/lib/python3.11/site-packages/django/db/migrations/executor.py”, line 135, in migrate
state = self._migrate_all_forwards(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/opt/py3/lib/python3.11/site-packages/django/db/migrations/executor.py”, line 167, in _migrate_all_forwards
state = self.apply_migration(
^^^^^^^^^^^^^^^^^^^^^
File “/opt/py3/lib/python3.11/site-packages/django/db/migrations/executor.py”, line 252, in apply_migration
state = migration.apply(state, schema_editor)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/opt/py3/lib/python3.11/site-packages/django/db/migrations/migration.py”, line 130, in apply
operation.database_forwards(
File “/opt/py3/lib/python3.11/site-packages/django/db/migrations/operations/fields.py”, line 235, in database_forwards
schema_editor.alter_field(from_model, from_field, to_field)
File “/opt/py3/lib/python3.11/site-packages/django/db/backends/base/schema.py”, line 788, in alter_field
self._alter_field(
File “/opt/py3/lib/python3.11/site-packages/django/db/backends/base/schema.py”, line 1007, in _alter_field
self.execute(
File “/opt/py3/lib/python3.11/site-packages/django/db/backends/base/schema.py”, line 199, in execute
cursor.execute(sql, params)
File “/opt/py3/lib/python3.11/site-packages/django/db/backends/utils.py”, line 67, in execute
return self._execute_with_wrappers(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/opt/py3/lib/python3.11/site-packages/django/db/backends/utils.py”, line 80, in _execute_with_wrappers
return executor(sql, params, many, context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/opt/py3/lib/python3.11/site-packages/django/db/backends/utils.py”, line 84, in _execute
with self.db.wrap_database_errors:
File “/opt/py3/lib/python3.11/site-packages/django/db/utils.py”, line 91, in exit
raise dj_exc_value.with_traceback(traceback) from exc_value
File “/opt/py3/lib/python3.11/site-packages/django/db/backends/utils.py”, line 89, in _execute
return self.cursor.execute(sql, params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/opt/py3/lib/python3.11/site-packages/django/db/backends/mysql/base.py”, line 75, in execute
return self.cursor.execute(query, args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/opt/py3/lib/python3.11/site-packages/MySQLdb/cursors.py”, line 179, in execute
res = self._query(mogrified_query)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/opt/py3/lib/python3.11/site-packages/MySQLdb/cursors.py”, line 330, in _query
db.query(q)
File “/opt/py3/lib/python3.11/site-packages/MySQLdb/connections.py”, line 255, in query
_mysql.connection.query(self, query)
django.db.utils.OperationalError: (1071, ‘Specified key was too long; max key length is 767 bytes’)
[ERROR] Failed to change the table structure!

这个报错不应该出现在mysql5.7上的。。。我也查了一下这个解决办法,[Err] 1071 - Specified key was too long; max key length is 767 bytes,【各版本mysql均已解决】_specified key was too long; max key length is 767 -CSDN博客


或者实在不行,换mariadb10吧

检查了数据库,确定是mysql5.7,里面的参数也是正常的。但是升级报错依旧。