Add compute , then Instances return 500 error. (OperationalError at /instances/,no such column: instances_instance.drbd )
Create the website as normal,the login is successful。 When I create a compute node through ssh, I switch to Instances and report a 500 error. I use Kylin V10 system (same as openeuler 20.03TLS) as computing node. Compiled against the library: libvirt 6.2.0 Libraries used: libvirt 6.2.0 API used: QEMU 6.2.0 Run the hypervisor: QEMU 4.1.0 but I don't think it's the client compute node's problem. I try to create a user, but also an error is reported. After logging in again, the user information already exists,and use the user login, change to Instances, also error(no such column: instances_instance.drbd). I use kenlee/webvirtcloud-docker create website can add compute and change to Instance successfully.
OperationalError at /instances/ no such column: instances_instance.drbd Request Method: GET Request URL: http://172.30.241.100:80/instances/ Django Version: 3.2.14 Exception Type: OperationalError Exception Value: no such column: instances_instance.drbd Exception Location: /srv/webvirtcloud/venv/lib/python3.6/site-packages/django/db/backends/sqlite3/base.py, line 423, in execute Python Executable: /srv/webvirtcloud/venv/bin/python3 Python Version: 3.6.8 Python Path: ['/srv/webvirtcloud', '/srv/webvirtcloud/venv/bin', '/srv/webvirtcloud/venv/lib64/python36.zip', '/srv/webvirtcloud/venv/lib64/python3.6', '/srv/webvirtcloud/venv/lib64/python3.6/lib-dynload', '/usr/lib64/python3.6', '/usr/lib/python3.6', '/srv/webvirtcloud/venv/lib/python3.6/site-packages'] Server time: Tue, 23 Aug 2022 03:59:59 -0400
Environment:
Request Method: GET Request URL: http://172.30.241.100:80/instances/
Django Version: 3.2.14 Python Version: 3.6.8 Installed Applications: ['django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'django_bootstrap5', 'django_icons', 'django_otp', 'django_otp.plugins.otp_totp', 'accounts', 'admin', 'appsettings', 'computes', 'console', 'datasource', 'networks', 'instances', 'interfaces', 'nwfilters', 'storages', 'virtsecrets', 'logs', 'qr_code'] Installed Middleware: ['django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.locale.LocaleMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django_otp.middleware.OTPMiddleware', 'login_required.middleware.LoginRequiredMiddleware', 'django.contrib.auth.middleware.RemoteUserMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'appsettings.middleware.AppSettingsMiddleware', 'webvirtcloud.middleware.ExceptionMiddleware']
Traceback (most recent call last): File "/srv/webvirtcloud/venv/lib/python3.6/site-packages/django/db/backends/utils.py", line 84, in _execute return self.cursor.execute(sql, params) File "/srv/webvirtcloud/venv/lib/python3.6/site-packages/django/db/backends/sqlite3/base.py", line 423, in execute return Database.Cursor.execute(self, query, params)
The above exception (no such column: instances_instance.drbd) was the direct cause of the following exception: File "/srv/webvirtcloud/venv/lib/python3.6/site-packages/django/core/handlers/exception.py", line 47, in inner response = get_response(request) File "/srv/webvirtcloud/venv/lib/python3.6/site-packages/django/core/handlers/base.py", line 181, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/srv/webvirtcloud/instances/views.py", line 47, in index for compute in computes: File "/srv/webvirtcloud/venv/lib/python3.6/site-packages/django/db/models/query.py", line 280, in iter self._fetch_all() File "/srv/webvirtcloud/venv/lib/python3.6/site-packages/django/db/models/query.py", line 1326, in _fetch_all self._prefetch_related_objects() File "/srv/webvirtcloud/venv/lib/python3.6/site-packages/django/db/models/query.py", line 813, in _prefetch_related_objects prefetch_related_objects(self._result_cache, *self._prefetch_related_lookups) File "/srv/webvirtcloud/venv/lib/python3.6/site-packages/django/db/models/query.py", line 1734, in prefetch_related_objects level, File "/srv/webvirtcloud/venv/lib/python3.6/site-packages/django/db/models/query.py", line 1855, in prefetch_one_level prefetcher.get_prefetch_queryset(instances, lookup.get_current_queryset(level))) File "/srv/webvirtcloud/venv/lib/python3.6/site-packages/django/db/models/fields/related_descriptors.py", line 637, in get_prefetch_queryset for rel_obj in queryset: File "/srv/webvirtcloud/venv/lib/python3.6/site-packages/django/db/models/query.py", line 280, in iter self._fetch_all() File "/srv/webvirtcloud/venv/lib/python3.6/site-packages/django/db/models/query.py", line 1324, in _fetch_all self._result_cache = list(self._iterable_class(self)) File "/srv/webvirtcloud/venv/lib/python3.6/site-packages/django/db/models/query.py", line 51, in iter results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size) File "/srv/webvirtcloud/venv/lib/python3.6/site-packages/django/db/models/sql/compiler.py", line 1175, in execute_sql cursor.execute(sql, params) File "/srv/webvirtcloud/venv/lib/python3.6/site-packages/django/db/backends/utils.py", line 98, in execute return super().execute(sql, params) File "/srv/webvirtcloud/venv/lib/python3.6/site-packages/django/db/backends/utils.py", line 66, in execute return self._execute_with_wrappers(sql, params, many=False, executor=self._execute) File "/srv/webvirtcloud/venv/lib/python3.6/site-packages/django/db/backends/utils.py", line 75, in _execute_with_wrappers return executor(sql, params, many, context) File "/srv/webvirtcloud/venv/lib/python3.6/site-packages/django/db/backends/utils.py", line 84, in _execute return self.cursor.execute(sql, params) File "/srv/webvirtcloud/venv/lib/python3.6/site-packages/django/db/utils.py", line 90, in exit raise dj_exc_value.with_traceback(traceback) from exc_value File "/srv/webvirtcloud/venv/lib/python3.6/site-packages/django/db/backends/utils.py", line 84, in _execute return self.cursor.execute(sql, params) File "/srv/webvirtcloud/venv/lib/python3.6/site-packages/django/db/backends/sqlite3/base.py", line 423, in execute return Database.Cursor.execute(self, query, params)
Exception Type: OperationalError at /instances/ Exception Value: no such column: instances_instance.drbd
did you run python3 manage.py makemigrations; python3 manage.py migrate commands?
@catborise
did you run
python3 manage.py makemigrations; python3 manage.py migratecommands?
I use the scripts install on centos8 , the logs:
- Django Migrate. Operations to perform: Apply all migrations: accounts, admin, appsettings, auth, computes, contenttypes, instances, logs, otp_totp, sessions Running migrations: Applying computes.0001_initial... OK Applying instances.0001_initial... OK Applying instances.0002_permissionset... OK Applying instances.0003_auto_20200615_0637... OK Applying contenttypes.0001_initial... OK Applying auth.0001_initial... OK Applying accounts.0001_initial... OK Applying accounts.0002_permissionset... OK Applying accounts.0003_auto_20200604_0930... OK Applying accounts.0004_auto_20200615_0637... OK Applying accounts.0005_auto_20200616_1039... OK Applying contenttypes.0002_remove_content_type_name... OK Applying auth.0002_alter_permission_name_max_length... OK Applying auth.0003_alter_user_email_max_length... OK Applying auth.0004_alter_user_username_opts... OK Applying auth.0005_alter_user_last_login_null... OK Applying auth.0006_require_contenttypes_0002... OK Applying auth.0007_alter_validators_add_error_messages... OK Applying auth.0008_alter_user_username_max_length... OK Applying auth.0009_alter_user_last_name_max_length... OK Applying auth.0010_alter_group_name_max_length... OK Applying auth.0011_update_proxy_permissions... OK Applying admin.0001_initial... OK Applying admin.0002_auto_20200609_0830... OK Applying admin.0003_create_group_technicians... OK Applying appsettings.0001_initial... OK Applying appsettings.0002_auto_20200527_1603... OK Applying appsettings.0003_auto_20200615_0637... OK Applying appsettings.0004_auto_20200716_0637... OK Applying appsettings.0005_auto_20200911_1233... OK Applying appsettings.0006_auto_20220630_0717... OK Applying auth.0012_alter_user_first_name_max_length... OK Applying computes.0002_auto_20200529_1320... OK Applying computes.0003_auto_20200615_0637... OK Applying instances.0004_auto_20200618_0817... OK Applying instances.0005_flavor... OK Applying instances.0006_addFlavors... OK Applying instances.0007_auto_20200624_0821... OK Applying instances.0008_auto_20200708_0950... OK Applying instances.0009_auto_20200717_0524... OK Applying logs.0001_initial... OK Applying logs.0002_auto_20200615_0637... OK Applying logs.0003_logs_host... OK Applying otp_totp.0001_initial... OK Applying otp_totp.0002_auto_20190420_0723... OK Applying sessions.0001_initial... OK
- Creating default admin user ! SHOW_PROFILE_EDIT_PASSWORD is found inside settings.py
- Applying permission can_change_password for all users ! Warning!!! Setting to True for all users ! Don`t forget to remove the option from settings.py
- Migrating can_clone_instaces user attribute to permission
- Applying permission passwordless_console for all users Operations to perform: Apply all migrations: accounts, admin, appsettings, auth, computes, contenttypes, instances, logs, otp_totp, sessions Running migrations: No migrations to apply. Your models in app(s): 'accounts', 'appsettings', 'computes', 'instances', 'logs' have changes that are not yet reflected in a migration, and so won't be applied. Run 'manage.py makemigrations' to make new migrations, and then re-run 'manage.py migrate' to apply them. ! SHOW_PROFILE_EDIT_PASSWORD is found inside settings.py
- Applying permission can_change_password for all users
! Warning!!! Setting to True for all users
! Don`t forget to remove the option from settings.py
Migrations for 'accounts':
accounts/migrations/0006_auto_20220822_2144.py
- Alter field id on userattributes
- Alter field id on userinstance
- Alter field id on usersshkey Migrations for 'appsettings': appsettings/migrations/0007_alter_appsettings_id.py
- Alter field id on appsettings Migrations for 'computes': computes/migrations/0004_alter_compute_id.py
- Alter field id on compute Migrations for 'instances': instances/migrations/0010_auto_20220822_2144.py
- Change Meta options on permissionset
- Add field drbd to instance
- Alter field id on flavor
- Alter field id on instance Migrations for 'logs': logs/migrations/0004_alter_logs_id.py
- Alter field id on logs
- Configuring Nginx.
- Copying Nginx configuration
- Configuring Supervisor.
- Copying supervisor configuration not running
- Configuring SELinux.
you can always run these commands, it does not breaks. may some scripts failed. run;
# Go to Installation Directory
cd /srv/webvirtcloud
source venv/bin/activate
pip3 install -U -r conf/requirements.txt
python3 manage.py makemigrations
python3 manage.py migrate
you can always run these commands, it does not breaks. may some scripts failed. run;
# Go to Installation Directory cd /srv/webvirtcloud source venv/bin/activate pip3 install -U -r conf/requirements.txt python3 manage.py makemigrations python3 manage.py migrate
I remove the db.sqlite3 file, and run again, this problem solved. Thanks.