Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Openwisp2 Migration fails on mysql #426

Open
Damodara1687 opened this issue Mar 4, 2023 · 1 comment
Open

Openwisp2 Migration fails on mysql #426

Damodara1687 opened this issue Mar 4, 2023 · 1 comment

Comments

@Damodara1687
Copy link

New installation, with MYsql:

TASK [openwisp.openwisp2 : migrate] ******************************************** fatal: [pOpenwisp2.westerwald.local]: FAILED! => {"changed": false, "cmd": ["./manage.py", "migrate", "--noinput"], "msg": "stdout: Operations to perform:\n Apply all migrations: account, admin, auth, authtoken, check, config, connection, contenttypes, device_monitoring, firmware_upgrader, geo, monitoring, openwisp_ipam, openwisp_notifications, openwisp_users, pki, reversion, sessions, sites, socialaccount, topology\nRunning migrations:\n Applying contenttypes.0001_initial... OK\n Applying contenttypes.0002_remove_content_type_name... OK\n Applying auth.0001_initial... OK\n Applying auth.0002_alter_permission_name_max_length... OK\n Applying auth.0003_alter_user_email_max_length... OK\n Applying auth.0004_alter_user_username_opts... OK\n Applying auth.0005_alter_user_last_login_null... OK\n Applying auth.0006_require_contenttypes_0002... OK\n Applying auth.0007_alter_validators_add_error_messages... OK\n Applying auth.0008_alter_user_username_max_length... OK\n Applying openwisp_users.0001_initial... OK\n Applying account.0001_initial... OK\n Applying account.0002_email_max_length... OK\n Applying admin.0001_initial... OK\n Applying admin.0002_logentry_remove_auto_add... OK\n Applying admin.0003_logentry_add_action_flag_choices... OK\n Applying auth.0009_alter_user_last_name_max_length... OK\n Applying auth.0010_alter_group_name_max_length... OK\n Applying auth.0011_update_proxy_permissions... OK\n Applying auth.0012_alter_user_first_name_max_length... OK\n Applying authtoken.0001_initial... OK\n Applying authtoken.0002_auto_20160226_1747... OK\n Applying authtoken.0003_tokenproxy... OK\n Applying openwisp_users.0002_auto_20180508_2017... OK\n Applying openwisp_users.0003_default_organization... OK\n Applying openwisp_users.0004_default_groups... OK\n Applying openwisp_notifications.0001_initial... OK\n Applying monitoring.0001_squashed_0023_alert_settings_tolerance_remove_default... OK\n Applying pki.0001_initial... OK\n Applying config.0001_squashed_0002_config_settings_uuid... OK\n Applying config.0003_template_tags... OK\n Applying config.0004_add_device_model... OK\n Applying check.0001_initial_squashed_0002_check_unique_together... OK\n Applying check.0003_create_ping... OK\n Applying check.0004_rename_active_to_is_active... OK\n Applying check.0005_create_config_applied... OK\n Applying check.0006_rename_check_check_check_type... OK\n Applying check.0007_create_checks... OK\n Applying openwisp_ipam.0001_initial...\n:stderr: System check identified some issues:\n\nWARNINGS:\nmonitoring.Metric.main_tags: (fields.W162) MariaDB does not support a database index on longtext columns.\n\tHINT: An index won't be created. Silence this warning if you don't care about it.\nTraceback (most recent call last):\n File \"/opt/openwisp2/env/lib/python3.9/site-packages/django/db/backends/utils.py\", line 87, in _execute\n return self.cursor.execute(sql)\n File \"/opt/openwisp2/env/lib/python3.9/site-packages/django/db/backends/mysql/base.py\", line 75, in execute\n return self.cursor.execute(query, args)\n File \"/usr/local/lib/python3.9/dist-packages/MySQLdb/cursors.py\", line 206, in execute\n res = self._query(query)\n File \"/usr/local/lib/python3.9/dist-packages/MySQLdb/cursors.py\", line 319, in _query\n db.query(q)\n File \"/usr/local/lib/python3.9/dist-packages/MySQLdb/connections.py\", line 254, in query\n _mysql.connection.query(self, query)\nMySQLdb.OperationalError: (4161, \"Unknown data type: 'cidr'\")\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/opt/openwisp2/./manage.py\", line 10, in \n execute_from_command_line(sys.argv)\n File \"/opt/openwisp2/env/lib/python3.9/site-packages/django/core/management/__init__.py\", line 446, in execute_from_command_line\n utility.execute()\n File \"/opt/openwisp2/env/lib/python3.9/site-packages/django/core/management/__init__.py\", line 440, in execute\n self.fetch_command(subcommand).run_from_argv(self.argv)\n File \"/opt/openwisp2/env/lib/python3.9/site-packages/django/core/management/base.py\", line 414, in run_from_argv\n self.execute(*args, **cmd_options)\n File \"/opt/openwisp2/env/lib/python3.9/site-packages/django/core/management/base.py\", line 460, in execute\n output = self.handle(*args, **options)\n File \"/opt/openwisp2/env/lib/python3.9/site-packages/django/core/management/base.py\", line 98, in wrapped\n res = handle_func(*args, **kwargs)\n File \"/opt/openwisp2/env/lib/python3.9/site-packages/django/core/management/commands/migrate.py\", line 290, in handle\n post_migrate_state = executor.migrate(\n File \"/opt/openwisp2/env/lib/python3.9/site-packages/django/db/migrations/executor.py\", line 131, in migrate\n state = self._migrate_all_forwards(\n File \"/opt/openwisp2/env/lib/python3.9/site-packages/django/db/migrations/executor.py\", line 163, in _migrate_all_forwards\n state = self.apply_migration(\n File \"/opt/openwisp2/env/lib/python3.9/site-packages/django/db/migrations/executor.py\", line 248, in apply_migration\n state = migration.apply(state, schema_editor)\n File \"/opt/openwisp2/env/lib/python3.9/site-packages/django/db/migrations/migration.py\", line 131, in apply\n operation.database_forwards(\n File \"/opt/openwisp2/env/lib/python3.9/site-packages/django/db/migrations/operations/models.py\", line 93, in database_forwards\n schema_editor.create_model(model)\n File \"/opt/openwisp2/env/lib/python3.9/site-packages/django/contrib/gis/db/backends/mysql/schema.py\", line 45, in create_model\n super().create_model(model)\n File \"/opt/openwisp2/env/lib/python3.9/site-packages/django/db/backends/base/schema.py\", line 432, in create_model\n self.execute(sql, params or None)\n File \"/opt/openwisp2/env/lib/python3.9/site-packages/django/db/backends/base/schema.py\", line 192, in execute\n cursor.execute(sql, params)\n File \"/opt/openwisp2/env/lib/python3.9/site-packages/django/db/backends/utils.py\", line 67, in execute\n return self._execute_with_wrappers(\n File \"/opt/openwisp2/env/lib/python3.9/site-packages/django/db/backends/utils.py\", line 80, in _execute_with_wrappers\n return executor(sql, params, many, context)\n File \"/opt/openwisp2/env/lib/python3.9/site-packages/django/db/backends/utils.py\", line 89, in _execute\n return self.cursor.execute(sql, params)\n File \"/opt/openwisp2/env/lib/python3.9/site-packages/django/db/utils.py\", line 91, in __exit__\n raise dj_exc_value.with_traceback(traceback) from exc_value\n File \"/opt/openwisp2/env/lib/python3.9/site-packages/django/db/backends/utils.py\", line 87, in _execute\n return self.cursor.execute(sql)\n File \"/opt/openwisp2/env/lib/python3.9/site-packages/django/db/backends/mysql/base.py\", line 75, in execute\n return self.cursor.execute(query, args)\n File \"/usr/local/lib/python3.9/dist-packages/MySQLdb/cursors.py\", line 206, in execute\n res = self._query(query)\n File \"/usr/local/lib/python3.9/dist-packages/MySQLdb/cursors.py\", line 319, in _query\n db.query(q)\n File \"/usr/local/lib/python3.9/dist-packages/MySQLdb/connections.py\", line 254, in query\n _mysql.connection.query(self, query)\ndjango.db.utils.OperationalError: (4161, \"Unknown data type: 'cidr'\")\n", "path": "/opt/openwisp2/env/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", "syspath": ["/tmp/ansible_django_manage_payload_6o23t68o/ansible_django_manage_payload.zip", "/usr/lib/python39.zip", "/usr/lib/python3.9", "/usr/lib/python3.9/lib-dynload", "/usr/local/lib/python3.9/dist-packages", "/usr/lib/python3/dist-packages"]}
@pandafy
Copy link
Member

pandafy commented Jun 29, 2023

We are tracking this issue at openwisp/openwisp-ipam#146. I would suggest using PostgreSQL if you require using Subnet Division Rule feature

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants