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

Fail to upgrade kiwi #3290

Closed
DMyachin opened this issue Jul 20, 2023 · 4 comments
Closed

Fail to upgrade kiwi #3290

DMyachin opened this issue Jul 20, 2023 · 4 comments

Comments

@DMyachin
Copy link

DMyachin commented Jul 20, 2023

  1. docker-compose pull
  2. docker-compose up -d
  3. docker exec -it kiwi_web_messenger /Kiwi/manage.py upgrade (kiwi_web_messenger is actual container name in yml file)
  4. Got error: django.db.utils.NotSupportedError: MariaDB 10.4 or later is required (found 10.3.27).
  5. Update docker-compose.yml to actual (centos was before)
  6. Try to migrate again
Got error
common-tcms2:/opt/kiwi_messenger # docker exec -it kiwi_web_messenger /Kiwi/manage.py upgrade
To finish the upgrade process, the following
management commands will be executed:

migrate
refresh_permissions
delete_stale_attachments
delete_stale_comments
            

1. Applying migrations:
Traceback (most recent call last):
  File "/venv/lib64/python3.9/site-packages/django/db/backends/base/base.py", line 289, in ensure_connection
    self.connect()
  File "/venv/lib64/python3.9/site-packages/django/utils/asyncio.py", line 26, in inner
    return func(*args, **kwargs)
  File "/venv/lib64/python3.9/site-packages/django/db/backends/base/base.py", line 270, in connect
    self.connection = self.get_new_connection(conn_params)
  File "/venv/lib64/python3.9/site-packages/django/utils/asyncio.py", line 26, in inner
    return func(*args, **kwargs)
  File "/venv/lib64/python3.9/site-packages/django/db/backends/mysql/base.py", line 247, in get_new_connection
    connection = Database.connect(**conn_params)
  File "/venv/lib64/python3.9/site-packages/MySQLdb/__init__.py", line 123, in Connect
    return Connection(*args, **kwargs)
  File "/venv/lib64/python3.9/site-packages/MySQLdb/connections.py", line 185, in __init__
    super().__init__(*args, **kwargs2)
MySQLdb.OperationalError: (2005, "Unknown server host 'db' (-2)")

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Kiwi/manage.py", line 12, in <module>
    execute_from_command_line(sys.argv)
  File "/venv/lib64/python3.9/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
    utility.execute()
  File "/venv/lib64/python3.9/site-packages/django/core/management/__init__.py", line 436, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/venv/lib64/python3.9/site-packages/django/core/management/base.py", line 412, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/venv/lib64/python3.9/site-packages/django/core/management/base.py", line 458, in execute
    output = self.handle(*args, **options)
  File "/venv/lib64/python3.9/site-packages/tcms/core/management/commands/upgrade.py", line 34, in handle
    call_command(
  File "/venv/lib64/python3.9/site-packages/django/core/management/__init__.py", line 194, in call_command
    return command.execute(*args, **defaults)
  File "/venv/lib64/python3.9/site-packages/django/core/management/base.py", line 458, in execute
    output = self.handle(*args, **options)
  File "/venv/lib64/python3.9/site-packages/django/core/management/base.py", line 106, in wrapper
    res = handle_func(*args, **kwargs)
  File "/venv/lib64/python3.9/site-packages/django/core/management/commands/migrate.py", line 117, in handle
    executor = MigrationExecutor(connection, self.migration_progress_callback)
  File "/venv/lib64/python3.9/site-packages/django/db/migrations/executor.py", line 18, in __init__
    self.loader = MigrationLoader(self.connection)
  File "/venv/lib64/python3.9/site-packages/django/db/migrations/loader.py", line 58, in __init__
    self.build_graph()
  File "/venv/lib64/python3.9/site-packages/django/db/migrations/loader.py", line 235, in build_graph
    self.applied_migrations = recorder.applied_migrations()
  File "/venv/lib64/python3.9/site-packages/django/db/migrations/recorder.py", line 81, in applied_migrations
    if self.has_table():
  File "/venv/lib64/python3.9/site-packages/django/db/migrations/recorder.py", line 57, in has_table
    with self.connection.cursor() as cursor:
  File "/venv/lib64/python3.9/site-packages/django/utils/asyncio.py", line 26, in inner
    return func(*args, **kwargs)
  File "/venv/lib64/python3.9/site-packages/django/db/backends/base/base.py", line 330, in cursor
    return self._cursor()
  File "/venv/lib64/python3.9/site-packages/django/db/backends/base/base.py", line 306, in _cursor
    self.ensure_connection()
  File "/venv/lib64/python3.9/site-packages/django/utils/asyncio.py", line 26, in inner
    return func(*args, **kwargs)
  File "/venv/lib64/python3.9/site-packages/django/db/backends/base/base.py", line 289, in ensure_connection
    self.connect()
  File "/venv/lib64/python3.9/site-packages/django/db/utils.py", line 91, in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
  File "/venv/lib64/python3.9/site-packages/django/db/backends/base/base.py", line 289, in ensure_connection
    self.connect()
  File "/venv/lib64/python3.9/site-packages/django/utils/asyncio.py", line 26, in inner
    return func(*args, **kwargs)
  File "/venv/lib64/python3.9/site-packages/django/db/backends/base/base.py", line 270, in connect
    self.connection = self.get_new_connection(conn_params)
  File "/venv/lib64/python3.9/site-packages/django/utils/asyncio.py", line 26, in inner
    return func(*args, **kwargs)
  File "/venv/lib64/python3.9/site-packages/django/db/backends/mysql/base.py", line 247, in get_new_connection
    connection = Database.connect(**conn_params)
  File "/venv/lib64/python3.9/site-packages/MySQLdb/__init__.py", line 123, in Connect
    return Connection(*args, **kwargs)
  File "/venv/lib64/python3.9/site-packages/MySQLdb/connections.py", line 185, in __init__
    super().__init__(*args, **kwargs2)
django.db.utils.OperationalError: (2005, "Unknown server host 'db' (-2)")

```
</details>
@DMyachin
Copy link
Author

Also:

docker-compose.yml
version: '2'
# Myachin: see https://kiwitcms.readthedocs.io/en/latest/installing_docker.html

services:
    db:
        container_name: kiwi_db_messenger
        image: mariadb:latest
        command:
            --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
        volumes:
            - db_data:/var/lib/mysql
        restart: always
        environment:
            MYSQL_ROOT_PASSWORD: kiwi-1s-aw3s0m3
            MYSQL_DATABASE: kiwi
            MYSQL_USER: kiwi
            MYSQL_PASSWORD: kiwi
            #            MYSQL_CHARSET: utf8mb4
            #            MYSQL_COLLATION: utf8mb4_unicode_ci
    web:
        container_name: kiwi_web_messenger
        depends_on:
            - db
        restart: always
        image: kiwitcms/kiwi:latest
        ports:
            - 8443:8443
        volumes:
            - uploads:/Kiwi/uploads:Z
              #            - ./local_settings.py:/venv/lib/python3.6/site-packages/tcms/settings/local_settings.py
        environment:
            KIWI_DB_HOST: db
            KIWI_DB_PORT: 3306
            KIWI_DB_NAME: kiwi
            KIWI_DB_USER: kiwi
            KIWI_DB_PASSWORD: kiwi
            KIWI_DONT_ENFORCE_HTTPS: "true"
        cap_drop:
            - ALL
volumes:
    db_data:
    uploads:

@DMyachin
Copy link
Author

2023-07-31 13:11:20+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:11.0.2+maria~ubu2204 started.
2023-07-31 13:11:20+00:00 [ERROR] [Entrypoint]: mariadbd failed while attempting to check config
        command was: mariadbd --verbose --help
        Can't initialize timer

@atodorov
Copy link
Member

This looks like a problem with either MariaDB or the versions/configurations on the host:
MariaDB/mariadb-docker#434

Kiwi TCMS has been using mariadb:latest containers for testing for a very long time and hasn't see this issue so not much we can do about it.

@DMyachin
Copy link
Author

JFYI. I set exactly image: mariadb:10.4 and the migration was sucessfull

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