You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{ "levelname": "ERROR", "asctime": "2023-04-26 16:27:00,069", "pathname": "/app/bkuser_core/common/db_sync.py", "lineno": 252, "funcName": "_sync", "process": 379, "thread": 140496526804800, "request_id": "41392d9ad2f84caa89b0d5c60dd3e848", "message": "Department bulk_create: save one by one fail, item=13-xxx-User-Groups, will not be updated, detail={'_state': <django.db.models.base.ModelState object at 0x7fc7dd17d5f8>, 'id': 13, 'create_time': datetime.datetime(2023, 4, 26, 8, 27, 0, 67009, tzinfo=<UTC>), 'update_time': datetime.datetime(2023, 4, 26, 8, 27, 0, 68840, tzinfo=<UTC>), 'name': 'xxx-User-Groups', 'code': 'xxx-User-Groups', 'parent_id': None, 'order': 1, 'enabled': True, 'extras': {'type': 'organizationalUnit'}, 'category_id': 2, 'lft': 0, 'rght': 0, 'tree_id': 0, 'level': 0, '_mptt_cached_fields': {'parent': None}}", "exc_info": "Traceback (most recent call last):\n File \"/usr/local/lib/python3.6/site-packages/django/db/backends/utils.py\", line 84, in _execute\n return self.cursor.execute(sql, params)\n File \"/usr/local/lib/python3.6/site-packages/django/db/backends/mysql/base.py\", line 73, in execute\n return self.cursor.execute(query, args)\n File \"/usr/local/lib/python3.6/site-packages/pymysql/cursors.py\", line 148, in execute\n result = self._query(query)\n File \"/usr/local/lib/python3.6/site-packages/pymysql/cursors.py\", line 310, in _query\n conn.query(q)\n File \"/usr/local/lib/python3.6/site-packages/pymysql/connections.py\", line 548, in query\n self._affected_rows = self._read_query_result(unbuffered=unbuffered)\n File \"/usr/local/lib/python3.6/site-packages/pymysql/connections.py\", line 775, in _read_query_result\n result.read()\n File \"/usr/local/lib/python3.6/site-packages/pymysql/connections.py\", line 1156, in read\n first_packet = self.connection._read_packet()\n File \"/usr/local/lib/python3.6/site-packages/pymysql/connections.py\", line 725, in _read_packet\n packet.raise_for_error()\n File \"/usr/local/lib/python3.6/site-packages/pymysql/protocol.py\", line 221, in raise_for_error\n err.raise_mysql_exception(self._data)\n File \"/usr/local/lib/python3.6/site-packages/pymysql/err.py\", line 143, in raise_mysql_exception\n raise errorclass(errno, errval)\npymysql.err.IntegrityError: (1062, \"Duplicate entry 'xxx-User-Groups' for key 'code'\")\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/app/bkuser_core/common/db_sync.py\", line 232, in _sync\n getattr(getattr(self.meta.target_model, manager), method)(part, **extra_params)\n File \"/usr/local/lib/python3.6/site-packages/django/db/models/manager.py\", line 85, in manager_method\n return getattr(self.get_queryset(), name)(*args, **kwargs)\n File \"/usr/local/lib/python3.6/site-packages/django/db/models/query.py\", line 503, in bulk_create\n objs_with_pk, fields, batch_size, ignore_conflicts=ignore_conflicts,\n File \"/usr/local/lib/python3.6/site-packages/django/db/models/query.py\", line 1293, in _batched_insert\n self._insert(item, fields=fields, using=self.db, ignore_conflicts=ignore_conflicts)\n File \"/usr/local/lib/python3.6/site-packages/django/db/models/query.py\", line 1270, in _insert\n return query.get_compiler(using=using).execute_sql(returning_fields)\n File \"/usr/local/lib/python3.6/site-packages/django/db/models/sql/compiler.py\", line 1416, in execute_sql\n cursor.execute(sql, params)\n File \"/usr/local/lib/python3.6/site-packages/django/db/backends/utils.py\", line 66, in execute\n return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)\n File \"/usr/local/lib/python3.6/site-packages/django/db/backends/utils.py\", line 75, in _execute_with_wrappers\n return executor(sql, params, many, context)\n File \"/usr/local/lib/python3.6/site-packages/django/db/backends/utils.py\", line 84, in _execute\n return self.cursor.execute(sql, params)\n File \"/usr/local/lib/python3.6/site-packages/django/db/utils.py\", line 90, in __exit__\n raise dj_exc_value.with_traceback(traceback) from exc_value\n File \"/usr/local/lib/python3.6/site-packages/django/db/backends/utils.py\", line 84, in _execute\n return self.cursor.execute(sql, params)\n File \"/usr/local/lib/python3.6/site-packages/django/db/backends/mysql/base.py\", line 73, in execute\n return self.cursor.execute(query, args)\n File \"/usr/local/lib/python3.6/site-packages/pymysql/cursors.py\", line 148, in execute\n result = self._query(query)\n File \"/usr/local/lib/python3.6/site-packages/pymysql/cursors.py\", line 310, in _query\n conn.query(q)\n File \"/usr/local/lib/python3.6/site-packages/pymysql/connections.py\", line 548, in query\n self._affected_rows = self._read_query_result(unbuffered=unbuffered)\n File \"/usr/local/lib/python3.6/site-packages/pymysql/connections.py\", line 775, in _read_query_result\n result.read()\n File \"/usr/local/lib/python3.6/site-packages/pymysql/connections.py\", line 1156, in read\n first_packet = self.connection._read_packet()\n File \"/usr/local/lib/python3.6/site-packages/pymysql/connections.py\", line 725, in _read_packet\n packet.raise_for_error()\n File \"/usr/local/lib/python3.6/site-packages/pymysql/protocol.py\", line 221, in raise_for_error\n err.raise_mysql_exception(self._data)\n File \"/usr/local/lib/python3.6/site-packages/pymysql/err.py\", line 143, in raise_mysql_exception\n raise errorclass(errno, errval)\ndjango.db.utils.IntegrityError: (1062, \"Duplicate entry 'xxx-User-Groups' for key 'code'\")\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File \"/app/bkuser_core/common/db_sync.py\", line 243, in _sync\n one.save()\n File \"/usr/local/lib/python3.6/site-packages/mptt/models.py\", line 922, in save\n return super().save(*args, **kwargs)\n File \"/usr/local/lib/python3.6/site-packages/django/db/models/base.py\", line 740, in save\n force_update=force_update, update_fields=update_fields)\n File \"/usr/local/lib/python3.6/site-packages/django/db/models/base.py\", line 778, in save_base\n force_update, using, update_fields,\n File \"/usr/local/lib/python3.6/site-packages/django/db/models/base.py\", line 859, in _save_table\n forced_update)\n File \"/usr/local/lib/python3.6/site-packages/django/db/models/base.py\", line 912, in _do_update\n return filtered._update(values) > 0\n File \"/usr/local/lib/python3.6/site-packages/django/db/models/query.py\", line 802, in _update\n return query.get_compiler(self.db).execute_sql(CURSOR)\n File \"/usr/local/lib/python3.6/site-packages/django/db/models/sql/compiler.py\", line 1559, in execute_sql\n cursor = super().execute_sql(result_type)\n File \"/usr/local/lib/python3.6/site-packages/django/db/models/sql/compiler.py\", line 1175, in execute_sql\n cursor.execute(sql, params)\n File \"/usr/local/lib/python3.6/site-packages/django/db/backends/utils.py\", line 66, in execute\n return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)\n File \"/usr/local/lib/python3.6/site-packages/django/db/backends/utils.py\", line 75, in _execute_with_wrappers\n return executor(sql, params, many, context)\n File \"/usr/local/lib/python3.6/site-packages/django/db/backends/utils.py\", line 78, in _execute\n self.db.validate_no_broken_transaction()\n File \"/usr/local/lib/python3.6/site-packages/django/db/backends/base/base.py\", line 448, in validate_no_broken_transaction\n \"An error occurred in the current transaction. You can't \"\ndjango.db.transaction.TransactionManagementError: An error occurred in the current transaction. You can't execute queries until the end of the 'atomic' block." }
重现方法
请描述问题重现的方法,如果不方便描述,可以通过截图或者视频辅助。
预期行为
版本
提供用户管理的具体版本号 bk-user-2.4.1
是否是企业版问题? 否
The text was updated successfully, but these errors were encountered:
用文字描述你遇到的问题
MAD更换“选择拉取节点”后同步失败,再恢复到原来的“选择拉取节点”也同步失败,用户都看不到了。
操作:修改“选择拉取节点”保存,然后点击同步,失败。再恢复到原来的配置,保存,同步,也失败。
我要怎么样可以恢复到之前的状态?能看到组织架构和用户?
{ "levelname": "ERROR", "asctime": "2023-04-26 16:27:00,069", "pathname": "/app/bkuser_core/common/db_sync.py", "lineno": 252, "funcName": "_sync", "process": 379, "thread": 140496526804800, "request_id": "41392d9ad2f84caa89b0d5c60dd3e848", "message": "Department bulk_create: save one by one fail, item=13-xxx-User-Groups, will not be updated, detail={'_state': <django.db.models.base.ModelState object at 0x7fc7dd17d5f8>, 'id': 13, 'create_time': datetime.datetime(2023, 4, 26, 8, 27, 0, 67009, tzinfo=<UTC>), 'update_time': datetime.datetime(2023, 4, 26, 8, 27, 0, 68840, tzinfo=<UTC>), 'name': 'xxx-User-Groups', 'code': 'xxx-User-Groups', 'parent_id': None, 'order': 1, 'enabled': True, 'extras': {'type': 'organizationalUnit'}, 'category_id': 2, 'lft': 0, 'rght': 0, 'tree_id': 0, 'level': 0, '_mptt_cached_fields': {'parent': None}}", "exc_info": "Traceback (most recent call last):\n File \"/usr/local/lib/python3.6/site-packages/django/db/backends/utils.py\", line 84, in _execute\n return self.cursor.execute(sql, params)\n File \"/usr/local/lib/python3.6/site-packages/django/db/backends/mysql/base.py\", line 73, in execute\n return self.cursor.execute(query, args)\n File \"/usr/local/lib/python3.6/site-packages/pymysql/cursors.py\", line 148, in execute\n result = self._query(query)\n File \"/usr/local/lib/python3.6/site-packages/pymysql/cursors.py\", line 310, in _query\n conn.query(q)\n File \"/usr/local/lib/python3.6/site-packages/pymysql/connections.py\", line 548, in query\n self._affected_rows = self._read_query_result(unbuffered=unbuffered)\n File \"/usr/local/lib/python3.6/site-packages/pymysql/connections.py\", line 775, in _read_query_result\n result.read()\n File \"/usr/local/lib/python3.6/site-packages/pymysql/connections.py\", line 1156, in read\n first_packet = self.connection._read_packet()\n File \"/usr/local/lib/python3.6/site-packages/pymysql/connections.py\", line 725, in _read_packet\n packet.raise_for_error()\n File \"/usr/local/lib/python3.6/site-packages/pymysql/protocol.py\", line 221, in raise_for_error\n err.raise_mysql_exception(self._data)\n File \"/usr/local/lib/python3.6/site-packages/pymysql/err.py\", line 143, in raise_mysql_exception\n raise errorclass(errno, errval)\npymysql.err.IntegrityError: (1062, \"Duplicate entry 'xxx-User-Groups' for key 'code'\")\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/app/bkuser_core/common/db_sync.py\", line 232, in _sync\n getattr(getattr(self.meta.target_model, manager), method)(part, **extra_params)\n File \"/usr/local/lib/python3.6/site-packages/django/db/models/manager.py\", line 85, in manager_method\n return getattr(self.get_queryset(), name)(*args, **kwargs)\n File \"/usr/local/lib/python3.6/site-packages/django/db/models/query.py\", line 503, in bulk_create\n objs_with_pk, fields, batch_size, ignore_conflicts=ignore_conflicts,\n File \"/usr/local/lib/python3.6/site-packages/django/db/models/query.py\", line 1293, in _batched_insert\n self._insert(item, fields=fields, using=self.db, ignore_conflicts=ignore_conflicts)\n File \"/usr/local/lib/python3.6/site-packages/django/db/models/query.py\", line 1270, in _insert\n return query.get_compiler(using=using).execute_sql(returning_fields)\n File \"/usr/local/lib/python3.6/site-packages/django/db/models/sql/compiler.py\", line 1416, in execute_sql\n cursor.execute(sql, params)\n File \"/usr/local/lib/python3.6/site-packages/django/db/backends/utils.py\", line 66, in execute\n return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)\n File \"/usr/local/lib/python3.6/site-packages/django/db/backends/utils.py\", line 75, in _execute_with_wrappers\n return executor(sql, params, many, context)\n File \"/usr/local/lib/python3.6/site-packages/django/db/backends/utils.py\", line 84, in _execute\n return self.cursor.execute(sql, params)\n File \"/usr/local/lib/python3.6/site-packages/django/db/utils.py\", line 90, in __exit__\n raise dj_exc_value.with_traceback(traceback) from exc_value\n File \"/usr/local/lib/python3.6/site-packages/django/db/backends/utils.py\", line 84, in _execute\n return self.cursor.execute(sql, params)\n File \"/usr/local/lib/python3.6/site-packages/django/db/backends/mysql/base.py\", line 73, in execute\n return self.cursor.execute(query, args)\n File \"/usr/local/lib/python3.6/site-packages/pymysql/cursors.py\", line 148, in execute\n result = self._query(query)\n File \"/usr/local/lib/python3.6/site-packages/pymysql/cursors.py\", line 310, in _query\n conn.query(q)\n File \"/usr/local/lib/python3.6/site-packages/pymysql/connections.py\", line 548, in query\n self._affected_rows = self._read_query_result(unbuffered=unbuffered)\n File \"/usr/local/lib/python3.6/site-packages/pymysql/connections.py\", line 775, in _read_query_result\n result.read()\n File \"/usr/local/lib/python3.6/site-packages/pymysql/connections.py\", line 1156, in read\n first_packet = self.connection._read_packet()\n File \"/usr/local/lib/python3.6/site-packages/pymysql/connections.py\", line 725, in _read_packet\n packet.raise_for_error()\n File \"/usr/local/lib/python3.6/site-packages/pymysql/protocol.py\", line 221, in raise_for_error\n err.raise_mysql_exception(self._data)\n File \"/usr/local/lib/python3.6/site-packages/pymysql/err.py\", line 143, in raise_mysql_exception\n raise errorclass(errno, errval)\ndjango.db.utils.IntegrityError: (1062, \"Duplicate entry 'xxx-User-Groups' for key 'code'\")\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File \"/app/bkuser_core/common/db_sync.py\", line 243, in _sync\n one.save()\n File \"/usr/local/lib/python3.6/site-packages/mptt/models.py\", line 922, in save\n return super().save(*args, **kwargs)\n File \"/usr/local/lib/python3.6/site-packages/django/db/models/base.py\", line 740, in save\n force_update=force_update, update_fields=update_fields)\n File \"/usr/local/lib/python3.6/site-packages/django/db/models/base.py\", line 778, in save_base\n force_update, using, update_fields,\n File \"/usr/local/lib/python3.6/site-packages/django/db/models/base.py\", line 859, in _save_table\n forced_update)\n File \"/usr/local/lib/python3.6/site-packages/django/db/models/base.py\", line 912, in _do_update\n return filtered._update(values) > 0\n File \"/usr/local/lib/python3.6/site-packages/django/db/models/query.py\", line 802, in _update\n return query.get_compiler(self.db).execute_sql(CURSOR)\n File \"/usr/local/lib/python3.6/site-packages/django/db/models/sql/compiler.py\", line 1559, in execute_sql\n cursor = super().execute_sql(result_type)\n File \"/usr/local/lib/python3.6/site-packages/django/db/models/sql/compiler.py\", line 1175, in execute_sql\n cursor.execute(sql, params)\n File \"/usr/local/lib/python3.6/site-packages/django/db/backends/utils.py\", line 66, in execute\n return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)\n File \"/usr/local/lib/python3.6/site-packages/django/db/backends/utils.py\", line 75, in _execute_with_wrappers\n return executor(sql, params, many, context)\n File \"/usr/local/lib/python3.6/site-packages/django/db/backends/utils.py\", line 78, in _execute\n self.db.validate_no_broken_transaction()\n File \"/usr/local/lib/python3.6/site-packages/django/db/backends/base/base.py\", line 448, in validate_no_broken_transaction\n \"An error occurred in the current transaction. You can't \"\ndjango.db.transaction.TransactionManagementError: An error occurred in the current transaction. You can't execute queries until the end of the 'atomic' block." }
重现方法
请描述问题重现的方法,如果不方便描述,可以通过截图或者视频辅助。
预期行为
版本
The text was updated successfully, but these errors were encountered: