Open reinethernal opened 3 years ago
And when i try to re-migrate db, under a user (thought there were not enough rigths) i receive this
I checked the models.py. There exists the model Models Line 324 and the index name vpn_privatekeypassword_key_name
seems to be valid.
I'll check why this is throwing this error.
(librenv) ~/Github/Libreswan-managing-interface master ● ./manage.py migrate
Operations to perform:
Apply all migrations: admin, auth, contenttypes, sessions, vpn
Running migrations:
Applying contenttypes.0001_initial... OK
Applying auth.0001_initial... OK
Applying admin.0001_initial... OK
Applying admin.0002_logentry_remove_auto_add... 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 sessions.0001_initial... OK
Applying vpn.0001_initial... OK
Applying vpn.0002_auto_20180525_2129... OK
Applying vpn.0003_dnsconfig_right_subnet_text... OK
Applying vpn.0004_auto_20180527_2031... OK
Applying vpn.0005_auto_20180527_2156... OK
Applying vpn.0006_auto_20180528_2304... OK
Applying vpn.0007_auto_20180529_0017... OK
Applying vpn.0008_auto_20180530_1502... OK
Applying vpn.0009_auto_20180530_1605... OK
Applying vpn.0010_auto_20180530_1719... OK
Applying vpn.0011_auto_20180530_1900... OK
Applying vpn.0012_auto_20180531_1408... OK
Applying vpn.0013_auto_20180531_1728... OK
Applying vpn.0014_employee... OK
Applying vpn.0015_auto_20180603_2057... OK
Applying vpn.0016_auto_20180604_1505... OK
Applying vpn.0017_auto_20180604_1538... OK
Applying vpn.0018_auto_20180604_1539... OK
Applying vpn.0019_auto_20180607_1245... OK
Applying vpn.0020_auto_20180612_1203... OK
Applying vpn.0021_auto_20180612_1440... OK
Applying vpn.0022_auto_20180620_1337... OK
Applying vpn.0023_auto_20180620_1412... OK
Applying vpn.0024_remove_generatecertificate_token... OK
Applying vpn.0025_auto_20180625_1251... OK
Applying vpn.0026_certificateconfiguration... OK
Applying vpn.0027_auto_20180629_1502... OK
Applying vpn.0028_auto_20180629_1519... OK
Applying vpn.0029_auto_20180629_1926... OK
Applying vpn.0030_generaterootca... OK
Applying vpn.0031_auto_20180629_2239... OK
Applying vpn.0032_auto_20180703_1434... OK
Applying vpn.0033_auto_20180703_1439... OK
Applying vpn.0034_auto_20180703_1504... OK
Applying vpn.0035_auto_20180703_1513... OK
Applying vpn.0036_auto_20180703_1534... OK
Applying vpn.0037_generaterootcertificate_password... OK
Applying vpn.0038_auto_20180703_1806... OK
Applying vpn.0039_latestsavedkeypassword... OK
Applying vpn.0040_auto_20180709_1352... OK
Applying vpn.0041_delete_latestsavedkeypassword... OK
Applying vpn.0042_remove_generaterootcertificate_password... OK
Applying vpn.0043_auto_20180722_1558... OK
Applying vpn.0044_auto_20180722_1605... OK
Applying vpn.0045_generatecertificate_cert_name... OK
Applying vpn.0046_auto_20180803_0314... OK
Applying vpn.0047_auto_20180813_0011... OK
Applying vpn.0048_auto_20180813_0026... OK
I did the installation from scratch and was also updating the installation guide (a few minor edits). But found no problem with the migration. They are working perfectly. And the admin is working great too.
You are getting this error
You have 5 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): vpn.
Run 'python manage.py migrate' to apply them.
because all your migration were not applied at once. Maybe the process failed mid way.
Just flush your database and start following the installation guide from 6. Preparing the app for running
Nope. that doesn't help Tried many ways, but...
MariaDB [(none)]> drop database libreweb;
Query OK, 18 rows affected (0.036 sec)
MariaDB [(none)]> CREATE DATABASE libreweb CHARACTER SET utf8;
Query OK, 1 row affected (0.001 sec)
MariaDB [(none)]> GRANT ALL PRIVILEGES ON *.* TO 'libreweb'@'localhost' IDENTIFIED BY 'GtSX6TDv';
Query OK, 0 rows affected (0.086 sec)
MariaDB [(none)]> \q
Bye
(librenv) [root@sk-av Libreswan-managing-interface-master]# clear
(librenv) [root@sk-av Libreswan-managing-interface-master]# ./manage.py migrate
Operations to perform:
Apply all migrations: admin, auth, contenttypes, sessions, vpn
Running migrations:
Applying contenttypes.0001_initial... OK
Applying auth.0001_initial... OK
Applying admin.0001_initial... OK
Applying admin.0002_logentry_remove_auto_add... 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 sessions.0001_initial... OK
Applying vpn.0001_initial... OK
Applying vpn.0002_auto_20180525_2129... OK
Applying vpn.0003_dnsconfig_right_subnet_text... OK
Applying vpn.0004_auto_20180527_2031... OK
Applying vpn.0005_auto_20180527_2156... OK
Applying vpn.0006_auto_20180528_2304... OK
Applying vpn.0007_auto_20180529_0017... OK
Applying vpn.0008_auto_20180530_1502... OK
Applying vpn.0009_auto_20180530_1605... OK
Applying vpn.0010_auto_20180530_1719... OK
Applying vpn.0011_auto_20180530_1900... OK
Applying vpn.0012_auto_20180531_1408... OK
Applying vpn.0013_auto_20180531_1728... OK
Applying vpn.0014_employee... OK
Applying vpn.0015_auto_20180603_2057... OK
Applying vpn.0016_auto_20180604_1505... OK
Applying vpn.0017_auto_20180604_1538... OK
Applying vpn.0018_auto_20180604_1539... OK
Applying vpn.0019_auto_20180607_1245... OK
Applying vpn.0020_auto_20180612_1203... OK
Applying vpn.0021_auto_20180612_1440... OK
Applying vpn.0022_auto_20180620_1337... OK
Applying vpn.0023_auto_20180620_1412... OK
Applying vpn.0024_remove_generatecertificate_token... OK
Applying vpn.0025_auto_20180625_1251... OK
Applying vpn.0026_certificateconfiguration... OK
Applying vpn.0027_auto_20180629_1502... OK
Applying vpn.0028_auto_20180629_1519... OK
Applying vpn.0029_auto_20180629_1926... OK
Applying vpn.0030_generaterootca... OK
Applying vpn.0031_auto_20180629_2239... OK
Applying vpn.0032_auto_20180703_1434... OK
Applying vpn.0033_auto_20180703_1439... OK
Applying vpn.0034_auto_20180703_1504... OK
Applying vpn.0035_auto_20180703_1513... OK
Applying vpn.0036_auto_20180703_1534... OK
Applying vpn.0037_generaterootcertificate_password... OK
Applying vpn.0038_auto_20180703_1806... OK
Applying vpn.0039_latestsavedkeypassword... OK
Applying vpn.0040_auto_20180709_1352... OK
Applying vpn.0041_delete_latestsavedkeypassword... OK
Applying vpn.0042_remove_generaterootcertificate_password... OK
Applying vpn.0043_auto_20180722_1558... OK
Applying vpn.0044_auto_20180722_1605...Traceback (most recent call last):
File "/root/Libreswan-managing-interface-master/libreswan_managing_interface/librenv/lib/python3.6/site-packages/django/db/backends/utils.py", line 85, in _execute
return self.cursor.execute(sql, params)
File "/root/Libreswan-managing-interface-master/libreswan_managing_interface/librenv/lib/python3.6/site-packages/django/db/backends/mysql/base.py", line 71, in execute
return self.cursor.execute(query, args)
File "/root/Libreswan-managing-interface-master/libreswan_managing_interface/librenv/lib/python3.6/site-packages/MySQLdb/cursors.py", line 206, in execute
res = self._query(query)
File "/root/Libreswan-managing-interface-master/libreswan_managing_interface/librenv/lib/python3.6/site-packages/MySQLdb/cursors.py", line 319, in _query
db.query(q)
File "/root/Libreswan-managing-interface-master/libreswan_managing_interface/librenv/lib/python3.6/site-packages/MySQLdb/connections.py", line 259, in query
_mysql.connection.query(self, query)
MySQLdb._exceptions.OperationalError: (1280, "Incorrect index name 'vpn_privatekeypassword_key_name_b5606c3b_uniq'")
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "./manage.py", line 22, in <module>
execute_from_command_line(sys.argv)
File "/root/Libreswan-managing-interface-master/libreswan_managing_interface/librenv/lib/python3.6/site-packages/django/core/management/__init__.py", line 371, in execute_from_command_line
utility.execute()
File "/root/Libreswan-managing-interface-master/libreswan_managing_interface/librenv/lib/python3.6/site-packages/django/core/management/__init__.py", line 365, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/root/Libreswan-managing-interface-master/libreswan_managing_interface/librenv/lib/python3.6/site-packages/django/core/management/base.py", line 288, in run_from_argv
self.execute(*args, **cmd_options)
File "/root/Libreswan-managing-interface-master/libreswan_managing_interface/librenv/lib/python3.6/site-packages/django/core/management/base.py", line 335, in execute
output = self.handle(*args, **options)
File "/root/Libreswan-managing-interface-master/libreswan_managing_interface/librenv/lib/python3.6/site-packages/django/core/management/commands/migrate.py", line 200, in handle
fake_initial=fake_initial,
File "/root/Libreswan-managing-interface-master/libreswan_managing_interface/librenv/lib/python3.6/site-packages/django/db/migrations/executor.py", line 117, in migrate
state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, fake_initial=fake_initial)
File "/root/Libreswan-managing-interface-master/libreswan_managing_interface/librenv/lib/python3.6/site-packages/django/db/migrations/executor.py", line 147, in _migrate_all_forwards
state = self.apply_migration(state, migration, fake=fake, fake_initial=fake_initial)
File "/root/Libreswan-managing-interface-master/libreswan_managing_interface/librenv/lib/python3.6/site-packages/django/db/migrations/executor.py", line 244, in apply_migration
state = migration.apply(state, schema_editor)
File "/root/Libreswan-managing-interface-master/libreswan_managing_interface/librenv/lib/python3.6/site-packages/django/db/migrations/migration.py", line 122, in apply
operation.database_forwards(self.app_label, schema_editor, old_state, project_state)
File "/root/Libreswan-managing-interface-master/libreswan_managing_interface/librenv/lib/python3.6/site-packages/django/db/migrations/operations/fields.py", line 216, in database_forwards
schema_editor.alter_field(from_model, from_field, to_field)
File "/root/Libreswan-managing-interface-master/libreswan_managing_interface/librenv/lib/python3.6/site-packages/django/db/backends/base/schema.py", line 525, in alter_field
old_db_params, new_db_params, strict)
File "/root/Libreswan-managing-interface-master/libreswan_managing_interface/librenv/lib/python3.6/site-packages/django/db/backends/base/schema.py", line 725, in _alter_field
"columns": self.quote_name(new_field.column),
File "/root/Libreswan-managing-interface-master/libreswan_managing_interface/librenv/lib/python3.6/site-packages/django/db/backends/base/schema.py", line 133, in execute
cursor.execute(sql, params)
File "/root/Libreswan-managing-interface-master/libreswan_managing_interface/librenv/lib/python3.6/site-packages/django/db/backends/utils.py", line 100, in execute
return super().execute(sql, params)
File "/root/Libreswan-managing-interface-master/libreswan_managing_interface/librenv/lib/python3.6/site-packages/django/db/backends/utils.py", line 68, in execute
return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
File "/root/Libreswan-managing-interface-master/libreswan_managing_interface/librenv/lib/python3.6/site-packages/django/db/backends/utils.py", line 77, in _execute_with_wrappers
return executor(sql, params, many, context)
File "/root/Libreswan-managing-interface-master/libreswan_managing_interface/librenv/lib/python3.6/site-packages/django/db/backends/utils.py", line 85, in _execute
return self.cursor.execute(sql, params)
File "/root/Libreswan-managing-interface-master/libreswan_managing_interface/librenv/lib/python3.6/site-packages/django/db/utils.py", line 89, in __exit__
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/root/Libreswan-managing-interface-master/libreswan_managing_interface/librenv/lib/python3.6/site-packages/django/db/backends/utils.py", line 85, in _execute
return self.cursor.execute(sql, params)
File "/root/Libreswan-managing-interface-master/libreswan_managing_interface/librenv/lib/python3.6/site-packages/django/db/backends/mysql/base.py", line 71, in execute
return self.cursor.execute(query, args)
File "/root/Libreswan-managing-interface-master/libreswan_managing_interface/librenv/lib/python3.6/site-packages/MySQLdb/cursors.py", line 206, in execute
res = self._query(query)
File "/root/Libreswan-managing-interface-master/libreswan_managing_interface/librenv/lib/python3.6/site-packages/MySQLdb/cursors.py", line 319, in _query
db.query(q)
File "/root/Libreswan-managing-interface-master/libreswan_managing_interface/librenv/lib/python3.6/site-packages/MySQLdb/connections.py", line 259, in query
_mysql.connection.query(self, query)
django.db.utils.OperationalError: (1280, "Incorrect index name 'vpn_privatekeypassword_key_name_b5606c3b_uniq'")
(librenv) [root@sk-av Libreswan-managing-interface-master]#
This problem might be due to MariaDB. I've found this tutorial for you, you can follow it from section MariaDB.
You might be having problems because you haven't flushed the privileges so that they can be used during the current session.
Also, your database name and username are the same. Just create the database and user following this section. So, as to reduce the scope of error.
If this doesn't work you can search for similar solutions.
Just the same. And to be clear - i use centos 7 and 10.4.13-MariaDB MariaDB Server
i use centos 7 and 10.4.13-MariaDB MariaDB Server
Okay.
This managing interface was also tested on CentOS. I'll try to get a CentOS system and solve this installation problem.
What Django version are you using? The managing interface is made using Django 2.0.x.
Could you try and see if this installation works on your system or not.
epel7 now has django for python3 which is older version.
@bleve Django 2.0.x also works on python 3.
Django 2.0 supports Python 3.4, 3.5, 3.6, and 3.7. We highly recommend and only officially support the latest release of each series. The Django 1.11.x series is the last to support Python 2.7.
Source -
epel7 now has django for python3 which is older version.
Yes, Django 2.0 is older but it can be easily migrated to Django 2.2 LTS
i use centos 7 and 10.4.13-MariaDB MariaDB Server
Okay.
This managing interface was also tested on CentOS. I'll try to get a CentOS system and solve this installation problem.
- What Django version are you using? The managing interface is made using Django 2.0.x.
- Could you try and see if this installation works on your system or not.
Here what i receive after installing app by your instruction
And here's the install log
This managing interface was also tested on CentOS. I'll try to get a CentOS system and solve this installation problem.
@reinethernal i couldn't get a centos server to try it out. If you or @bleve could help in some way, that would be great.
Aaaand a new error with a
at console. and https://dpaste.com/6Q6RP3B8E#line-2
at web.