#17473·jumpserver

[Bug] 4.10.16升级4.10.17 SQL变更步骤报错Foreign key constraint is incorrectly formed

Author: rogerxzhangCreated Sep 14, 2026Updated Sep 14, 2026
Labels🐛 Bug🔔 Pending processing

Product Version

4.10.16

Product Edition

  • Community Edition
  • Enterprise Edition
  • Enterprise Trial Edition

Installation Method

  • Online Installation (One-click command installation)
  • Offline Package Installation
  • All-in-One
  • 1Panel
  • Kubernetes
  • Source Code

Environment Information

外置MariaDB 12.2.2

Bug Description

4.10.16升级4.10.17-4.10.19版本都在SQL Migration步骤报错,库里的字段是char(32)格式,新版本执行外键字段变成了uuid,导致这个报错。社区反馈是4.10.17版本升级Django 5.2导致的。

File "/opt/py3/lib/python3.14/site-packages/django/db/backends/utils.py", line 92, in _execute_with_wrappers return executor(sql, params, many, context) File "/opt/py3/lib/python3.14/site-packages/django/db/backends/utils.py", line 100, in _execute with self.db.wrap_database_errors: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/py3/lib/python3.14/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.14/site-packages/django/db/backends/utils.py", line 103, in _execute return self.cursor.execute(sql) ~~~~~~~~~~~~~~~~~~~^^^^^ File "/opt/py3/lib/python3.14/site-packages/django/db/backends/mysql/base.py", line 76, in execute return self.cursor.execute(query, args) ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^ File "/opt/py3/lib/python3.14/site-packages/MySQLdb/cursors.py", line 179, in execute res = self._query(mogrified_query) File "/opt/py3/lib/python3.14/site-packages/MySQLdb/cursors.py", line 330, in _query db.query(q) ~~~~~~~~^^^ File "/opt/py3/lib/python3.14/site-packages/MySQLdb/connections.py", line 261, in query _mysql.connection.query(self, query) ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^ django.db.utils.OperationalError: (1005, 'Can't create table jumpserver.assets_favoritefolder (errno: 150 "Foreign key constraint is incorrectly formed")')

Image

Recurrence Steps

4.10.16升级4.10.17-4.10.19版本

Expected Behavior

No response

Additional Information

No response

Attempted Solutions

No response