-
Notifications
You must be signed in to change notification settings - Fork 41
Create a new setup page #6671
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
base: main
Are you sure you want to change the base?
Create a new setup page #6671
Conversation
|
Any INSERT INTO spuserpolicy (id, resource, action, collection_id, specifyuser_id) VALUES (1, '%', '%', null, 1); |
|
NOTES:
|
63728c3 to
31211cc
Compare
Triggered by 31211cc on branch refs/heads/issue-2931-1
grantfitzsimmons
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using a brand new database (never before created), it fails to start and get running.
2025-10-31 15:32:54 Updating static files in /volumes/static-files/.
2025-10-31 15:32:56 Applying Django migrations.
2025-10-31 15:32:56 Starting MariaDB database and user creation script...
2025-10-31 15:32:56 --------------------------------------------------
2025-10-31 15:32:56 DB Configuration:
2025-10-31 15:32:56 DB Host: host.docker.internal
2025-10-31 15:32:56 DB Port: 3306
2025-10-31 15:32:56 DB Name: somethingtotallynew
2025-10-31 15:32:56 Master User: root
2025-10-31 15:32:56 Migrator User: specify_migrator
2025-10-31 15:32:56 App User: specify_user
2025-10-31 15:32:56 --------------------------------------------------
2025-10-31 15:32:56 Checking if MariaDB instance is up and running...
2025-10-31 15:32:56 MariaDB is up and running.
2025-10-31 15:33:02 Creating database 'somethingtotallynew'...
2025-10-31 15:33:02 Executing: mysql -h "host.docker.internal" -P "3306" -u "root" --password="<hidden>" -e "CREATE DATABASE `somethingtotallynew`;"
2025-10-31 15:33:03 Creating user 'specify_migrator'...
2025-10-31 15:33:03 Executing: mysql -h "host.docker.internal" -P "3306" -u "root" --password="<hidden>" -e "CREATE USER 'specify_migrator'@'%' IDENTIFIED BY '<hidden>';"
2025-10-31 15:33:07 Granting privileges to new user...
2025-10-31 15:33:07 Executing: mysql -h "host.docker.internal" -P "3306" -u "root" --password="<hidden>" -e "GRANT ALL PRIVILEGES ON `somethingtotallynew`.* TO 'specify_migrator'@'%'; FLUSH PRIVILEGES;"
2025-10-31 15:33:08 Notice: 'specify_migrator'@'%' lacks usable access to 'somethingtotallynew'.
2025-10-31 15:33:08 Make corrections to the intended MIGRATOR user permissions to resolve. Run the following command in the database:
2025-10-31 15:33:08 GRANT ALL PRIVILEGES on somethingtotallynew.* to 'specify_migrator'@'%'; FLUSH PRIVILEGES;
2025-10-31 15:33:08 Creating user 'specify_user'...
2025-10-31 15:33:08 Executing: mysql -h "host.docker.internal" -P "3306" -u "root" --password="<hidden>" -e "CREATE USER 'specify_user'@'%' IDENTIFIED BY '<hidden>';"
2025-10-31 15:33:08 Granting privileges to new user...
2025-10-31 15:33:08 Executing: mysql -h "host.docker.internal" -P "3306" -u "root" --password="<hidden>" -e "GRANT SELECT, INSERT, UPDATE, DELETE, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE ON `somethingtotallynew`.* TO 'specify_user'@'%'; FLUSH PRIVILEGES;"
2025-10-31 15:33:08 Verified: 'specify_user'@'%' has required privileges on 'somethingtotallynew'.
2025-10-31 15:33:08 --------------------------------------------------
2025-10-31 15:33:08 Database and user setup complete.
2025-10-31 15:33:08 New database created: True
2025-10-31 15:33:08 New migrator user created: True
2025-10-31 15:33:08 New app user created: True
2025-10-31 15:33:08 --------------------------------------------------
2025-10-31 15:33:08 New database detected.
2025-10-31 15:33:59 Operations to perform:
2025-10-31 15:33:59 Apply all migrations: accounts, attachment_gw, auth, businessrules, contenttypes, notifications, patches, permissions, sessions, specify, workbench
2025-10-31 15:33:59 Running migrations:
2025-10-31 15:36:16 Applying specify.0001_initial... OK
2025-10-31 15:36:17 Applying accounts.0001_initial... OK
2025-10-31 15:36:17 Applying accounts.0002_auto_20211223_1206... OK
2025-10-31 15:36:19 Applying accounts.0003_auto_20220621_1541... OK
2025-10-31 15:36:20 Applying attachment_gw.0001_initial... OK
2025-10-31 15:36:20 Applying contenttypes.0001_initial... OK
2025-10-31 15:36:20 Applying contenttypes.0002_remove_content_type_name... OK
2025-10-31 15:33:20 [31/Oct/2025 15:33:20] [INFO] [specifyweb.specify.management.commands.base_specify_migration:29] Running base_specify_migration using database alias 'master'
2025-10-31 15:33:22 [31/Oct/2025 15:33:22] [INFO] [specifyweb.specify.management.commands.base_specify_migration:78] Completed using database alias 'master'
2025-10-31 15:36:21 Applying auth.0001_initial... OK
2025-10-31 15:36:21 Applying auth.0002_alter_permission_name_max_length... OK
2025-10-31 15:36:21 Applying auth.0003_alter_user_email_max_length... OK
2025-10-31 15:36:21 Applying auth.0004_alter_user_username_opts... OK
2025-10-31 15:36:21 Applying auth.0005_alter_user_last_login_null... OK
2025-10-31 15:36:21 Applying auth.0006_require_contenttypes_0002... OK
2025-10-31 15:36:21 Applying auth.0007_alter_validators_add_error_messages... OK
2025-10-31 15:36:21 Applying auth.0008_alter_user_username_max_length... OK
2025-10-31 15:36:21 Applying auth.0009_alter_user_last_name_max_length... OK
2025-10-31 15:36:21 Applying auth.0010_alter_group_name_max_length... OK
2025-10-31 15:36:21 Applying auth.0011_update_proxy_permissions... OK
2025-10-31 15:36:21 Applying auth.0012_alter_user_first_name_max_length... OK
2025-10-31 15:41:38 Traceback (most recent call last):
2025-10-31 15:41:38 File "/opt/specify7/ve/lib/python3.12/site-packages/django/db/backends/base/base.py", line 288, in ensure_connection
2025-10-31 15:41:38 self.connect()
2025-10-31 15:41:38 File "/opt/specify7/ve/lib/python3.12/site-packages/django/utils/asyncio.py", line 26, in inner
2025-10-31 15:41:38 return func(*args, **kwargs)
2025-10-31 15:41:38 ^^^^^^^^^^^^^^^^^^^^^
2025-10-31 15:41:38 File "/opt/specify7/ve/lib/python3.12/site-packages/django/db/backends/base/base.py", line 269, in connect
2025-10-31 15:41:38 self.connection = self.get_new_connection(conn_params)
2025-10-31 15:41:38 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-10-31 15:41:38 File "/opt/specify7/ve/lib/python3.12/site-packages/django/utils/asyncio.py", line 26, in inner
2025-10-31 15:41:38 return func(*args, **kwargs)
2025-10-31 15:41:38 ^^^^^^^^^^^^^^^^^^^^^
2025-10-31 15:41:38 File "/opt/specify7/ve/lib/python3.12/site-packages/django/db/backends/mysql/base.py", line 247, in get_new_connection
2025-10-31 15:41:38 connection = Database.connect(**conn_params)
2025-10-31 15:41:38 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-10-31 15:41:38 File "/opt/specify7/ve/lib/python3.12/site-packages/MySQLdb/__init__.py", line 123, in Connect
2025-10-31 15:41:38 return Connection(*args, **kwargs)
2025-10-31 15:41:38 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-10-31 15:41:38 File "/opt/specify7/ve/lib/python3.12/site-packages/MySQLdb/connections.py", line 185, in __init__
2025-10-31 15:41:38 super().__init__(*args, **kwargs2)
2025-10-31 15:41:38 MySQLdb.OperationalError: (1045, "Access denied for user 'specify_user'@'localhost' (using password: YES)")
2025-10-31 15:41:38
2025-10-31 15:41:38 The above exception was the direct cause of the following exception:
2025-10-31 15:41:38
2025-10-31 15:41:38 Traceback (most recent call last):
2025-10-31 15:41:38 File "/opt/specify7/manage.py", line 25, in <module>
2025-10-31 15:41:38 execute_from_command_line(sys.argv)
2025-10-31 15:41:38 File "/opt/specify7/ve/lib/python3.12/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
2025-10-31 15:41:38 utility.execute()
2025-10-31 15:41:38 File "/opt/specify7/ve/lib/python3.12/site-packages/django/core/management/__init__.py", line 436, in execute
2025-10-31 15:41:38 self.fetch_command(subcommand).run_from_argv(self.argv)
2025-10-31 15:41:38 File "/opt/specify7/ve/lib/python3.12/site-packages/django/core/management/base.py", line 412, in run_from_argv
2025-10-31 15:41:38 self.execute(*args, **cmd_options)
2025-10-31 15:41:38 File "/opt/specify7/ve/lib/python3.12/site-packages/django/core/management/base.py", line 458, in execute
2025-10-31 15:41:38 output = self.handle(*args, **options)
2025-10-31 15:41:38 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-10-31 15:41:38 File "/opt/specify7/ve/lib/python3.12/site-packages/django/core/management/base.py", line 106, in wrapper
2025-10-31 15:41:38 res = handle_func(*args, **kwargs)
2025-10-31 15:41:38 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-10-31 15:41:38 File "/opt/specify7/ve/lib/python3.12/site-packages/django/core/management/commands/migrate.py", line 356, in handle
2025-10-31 15:41:38 post_migrate_state = executor.migrate(
2025-10-31 15:41:38 ^^^^^^^^^^^^^^^^^
2025-10-31 15:41:38 File "/opt/specify7/ve/lib/python3.12/site-packages/django/db/migrations/executor.py", line 135, in migrate
2025-10-31 15:41:38 state = self._migrate_all_forwards(
2025-10-31 15:41:38 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-10-31 15:41:38 File "/opt/specify7/ve/lib/python3.12/site-packages/django/db/migrations/executor.py", line 167, in _migrate_all_forwards
2025-10-31 15:41:38 state = self.apply_migration(
2025-10-31 15:41:38 ^^^^^^^^^^^^^^^^^^^^^
2025-10-31 15:41:38 File "/opt/specify7/ve/lib/python3.12/site-packages/django/db/migrations/executor.py", line 252, in apply_migration
2025-10-31 15:41:38 state = migration.apply(state, schema_editor)
2025-10-31 15:41:38 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-10-31 15:41:38 File "/opt/specify7/ve/lib/python3.12/site-packages/django/db/migrations/migration.py", line 127, in apply
2025-10-31 15:41:38 operation.database_forwards(
2025-10-31 15:41:38 File "/opt/specify7/ve/lib/python3.12/site-packages/django/db/migrations/operations/special.py", line 193, in database_forwards
2025-10-31 15:41:38 self.code(from_state.apps, schema_editor)
2025-10-31 15:41:38 File "/opt/specify7/specifyweb/specify/migrations/0002_geo.py", line 75, in consolidated_python_django_migration_operations
2025-10-31 15:41:38 create_default_collection_types(apps)
2025-10-31 15:41:38 File "/opt/specify7/specifyweb/specify/api/utils.py", line 36, in create_default_collection_types
2025-10-31 15:41:38 code_set = set(Collection.objects.all().values_list('code', flat=True))
2025-10-31 15:41:38 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-10-31 15:41:38 File "/opt/specify7/ve/lib/python3.12/site-packages/django/db/models/query.py", line 398, in __iter__
2025-10-31 15:41:38 self._fetch_all()
2025-10-31 15:41:38 File "/opt/specify7/ve/lib/python3.12/site-packages/django/db/models/query.py", line 1881, in _fetch_all
2025-10-31 15:41:38 self._result_cache = list(self._iterable_class(self))
2025-10-31 15:41:38 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-10-31 15:41:38 File "/opt/specify7/ve/lib/python3.12/site-packages/django/db/models/query.py", line 285, in __iter__
2025-10-31 15:41:38 for row in compiler.results_iter(
2025-10-31 15:41:38 ^^^^^^^^^^^^^^^^^^^^^^
2025-10-31 15:41:38 File "/opt/specify7/ve/lib/python3.12/site-packages/django/db/models/sql/compiler.py", line 1513, in results_iter
2025-10-31 15:41:38 results = self.execute_sql(
2025-10-31 15:41:38 ^^^^^^^^^^^^^^^^^
2025-10-31 15:41:38 File "/opt/specify7/ve/lib/python3.12/site-packages/django/db/models/sql/compiler.py", line 1560, in execute_sql
2025-10-31 15:41:38 cursor = self.connection.cursor()
2025-10-31 15:41:38 ^^^^^^^^^^^^^^^^^^^^^^^^
2025-10-31 15:41:38 File "/opt/specify7/ve/lib/python3.12/site-packages/django/utils/asyncio.py", line 26, in inner
2025-10-31 15:41:38 return func(*args, **kwargs)
2025-10-31 15:41:38 ^^^^^^^^^^^^^^^^^^^^^
2025-10-31 15:41:38 File "/opt/specify7/ve/lib/python3.12/site-packages/django/db/backends/base/base.py", line 329, in cursor
2025-10-31 15:41:38 return self._cursor()
2025-10-31 15:41:38 ^^^^^^^^^^^^^^
2025-10-31 15:41:38 File "/opt/specify7/ve/lib/python3.12/site-packages/django/db/backends/base/base.py", line 305, in _cursor
2025-10-31 15:41:38 self.ensure_connection()
2025-10-31 15:41:38 File "/opt/specify7/ve/lib/python3.12/site-packages/django/utils/asyncio.py", line 26, in inner
2025-10-31 15:41:38 return func(*args, **kwargs)
2025-10-31 15:41:38 ^^^^^^^^^^^^^^^^^^^^^
2025-10-31 15:41:38 File "/opt/specify7/ve/lib/python3.12/site-packages/django/db/backends/base/base.py", line 287, in ensure_connection
2025-10-31 15:41:38 with self.wrap_database_errors:
2025-10-31 15:41:38 File "/opt/specify7/ve/lib/python3.12/site-packages/django/db/utils.py", line 91, in __exit__
2025-10-31 15:41:38 raise dj_exc_value.with_traceback(traceback) from exc_value
2025-10-31 15:41:38 File "/opt/specify7/ve/lib/python3.12/site-packages/django/db/backends/base/base.py", line 288, in ensure_connection
2025-10-31 15:41:38 self.connect()
2025-10-31 15:41:38 File "/opt/specify7/ve/lib/python3.12/site-packages/django/utils/asyncio.py", line 26, in inner
2025-10-31 15:41:38 return func(*args, **kwargs)
2025-10-31 15:41:38 ^^^^^^^^^^^^^^^^^^^^^
2025-10-31 15:41:38 File "/opt/specify7/ve/lib/python3.12/site-packages/django/db/backends/base/base.py", line 269, in connect
2025-10-31 15:41:38 self.connection = self.get_new_connection(conn_params)
2025-10-31 15:41:38 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-10-31 15:41:38 File "/opt/specify7/ve/lib/python3.12/site-packages/django/utils/asyncio.py", line 26, in inner
2025-10-31 15:41:38 return func(*args, **kwargs)
2025-10-31 15:41:38 ^^^^^^^^^^^^^^^^^^^^^
2025-10-31 15:41:38 File "/opt/specify7/ve/lib/python3.12/site-packages/django/db/backends/mysql/base.py", line 247, in get_new_connection
2025-10-31 15:41:38 connection = Database.connect(**conn_params)
2025-10-31 15:41:38 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-10-31 15:41:38 File "/opt/specify7/ve/lib/python3.12/site-packages/MySQLdb/__init__.py", line 123, in Connect
2025-10-31 15:41:38 return Connection(*args, **kwargs)
2025-10-31 15:41:38 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-10-31 15:41:38 File "/opt/specify7/ve/lib/python3.12/site-packages/MySQLdb/connections.py", line 185, in __init__
2025-10-31 15:41:38 super().__init__(*args, **kwargs2)
2025-10-31 15:41:38 django.db.utils.OperationalError: (1045, "Access denied for user 'specify_user'@'localhost' (using password: YES)")
2025-10-31 15:41:41 Watching for file changes with StatReloader
2025-10-31 15:41:43 Exception in thread django-main-thread:
2025-10-31 15:41:43 Traceback (most recent call last):
2025-10-31 15:41:43 File "/opt/specify7/ve/lib/python3.12/site-packages/django/db/backends/base/base.py", line 288, in ensure_connection
2025-10-31 15:41:43 self.connect()
2025-10-31 15:41:43 File "/opt/specify7/ve/lib/python3.12/site-packages/django/utils/asyncio.py", line 26, in inner
2025-10-31 15:41:43 return func(*args, **kwargs)
2025-10-31 15:41:43 ^^^^^^^^^^^^^^^^^^^^^
2025-10-31 15:41:43 File "/opt/specify7/ve/lib/python3.12/site-packages/django/db/backends/base/base.py", line 269, in connect
2025-10-31 15:41:43 self.connection = self.get_new_connection(conn_params)
2025-10-31 15:41:43 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-10-31 15:41:43 File "/opt/specify7/ve/lib/python3.12/site-packages/django/utils/asyncio.py", line 26, in inner
2025-10-31 15:41:43 return func(*args, **kwargs)
2025-10-31 15:41:43 ^^^^^^^^^^^^^^^^^^^^^
2025-10-31 15:41:43 File "/opt/specify7/ve/lib/python3.12/site-packages/django/db/backends/mysql/base.py", line 247, in get_new_connection
2025-10-31 15:41:43 connection = Database.connect(**conn_params)
2025-10-31 15:41:43 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-10-31 15:41:43 File "/opt/specify7/ve/lib/python3.12/site-packages/MySQLdb/__init__.py", line 123, in Connect
2025-10-31 15:41:43 return Connection(*args, **kwargs)
2025-10-31 15:41:43 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-10-31 15:41:43 File "/opt/specify7/ve/lib/python3.12/site-packages/MySQLdb/connections.py", line 185, in __init__
2025-10-31 15:41:43 super().__init__(*args, **kwargs2)
2025-10-31 15:41:43 MySQLdb.OperationalError: (1045, "Access denied for user 'specify_user'@'localhost' (using password: YES)")
Fix setup task errors
…to issue-2931-1


Fixes #2931
Fixes #4832
Fixes #6210
Adds an initial set up page for configuring your database much like the Spwizard for Specify 6.
TODO:
Future TODO:
Checklist
self-explanatory (or properly documented)
Testing instructions
setup_tool/setup_database/createsetup_tool/institution/createsetup_tool/division/createsetup_tool/discipline/createsetup_tool/collection/createsetup_tool/specifyuser/create