etesync / server

The Etebase server (so you can run your own)
https://www.etesync.com
GNU Affero General Public License v3.0
1.48k stars 75 forks source link

Can't Install with MariaDB, Ubuntu Server 22.04. Errors on "./manage.py migrate". #161

Open Danrancan opened 1 year ago

Danrancan commented 1 year ago

I am trying to install etebase on Ubuntu Server 22.04 for the Raspberry Pi 4, using Mariadb in accordance with this tutorial.. Everything works up until I run the ./manage.py migrate command, which returns the following errors:

Traceback (most recent call last):
  File "/home/boo/etebase/./manage.py", line 21, in <module>
    main()
  File "/home/boo/etebase/./manage.py", line 17, in main
    execute_from_command_line(sys.argv)
  File "/home/boo/etebase/.venv/lib/python3.10/site-packages/django/core/management/__init__.py", line 419, in execute_from_command_line
    utility.execute()
  File "/home/boo/etebase/.venv/lib/python3.10/site-packages/django/core/management/__init__.py", line 413, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/boo/etebase/.venv/lib/python3.10/site-packages/django/core/management/base.py", line 354, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/home/boo/etebase/.venv/lib/python3.10/site-packages/django/core/management/base.py", line 398, in execute
    output = self.handle(*args, **options)
  File "/home/boo/etebase/.venv/lib/python3.10/site-packages/django/core/management/base.py", line 89, in wrapped
    res = handle_func(*args, **kwargs)
  File "/home/boo/etebase/.venv/lib/python3.10/site-packages/django/core/management/commands/migrate.py", line 75, in handle
    self.check(databases=[database])
  File "/home/boo/etebase/.venv/lib/python3.10/site-packages/django/core/management/base.py", line 419, in check
    all_issues = checks.run_checks(
  File "/home/boo/etebase/.venv/lib/python3.10/site-packages/django/core/checks/registry.py", line 76, in run_checks
    new_errors = check(app_configs=app_configs, databases=databases)
  File "/home/boo/etebase/.venv/lib/python3.10/site-packages/django/core/checks/database.py", line 13, in check_database_backends
    issues.extend(conn.validation.check(**kwargs))
  File "/home/boo/etebase/.venv/lib/python3.10/site-packages/django/db/backends/mysql/validation.py", line 9, in check
    issues.extend(self._check_sql_mode(**kwargs))
  File "/home/boo/etebase/.venv/lib/python3.10/site-packages/django/db/backends/mysql/validation.py", line 13, in _check_sql_mode
    if not (self.connection.sql_mode & {'STRICT_TRANS_TABLES', 'STRICT_ALL_TABLES'}):
  File "/home/boo/etebase/.venv/lib/python3.10/site-packages/django/utils/functional.py", line 48, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/home/boo/etebase/.venv/lib/python3.10/site-packages/django/db/backends/mysql/base.py", line 405, in sql_mode
    sql_mode = self.mysql_server_data['sql_mode']
  File "/home/boo/etebase/.venv/lib/python3.10/site-packages/django/utils/functional.py", line 48, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/home/boo/etebase/.venv/lib/python3.10/site-packages/django/db/backends/mysql/base.py", line 366, in mysql_server_data
    with self.temporary_connection() as cursor:
  File "/usr/lib/python3.10/contextlib.py", line 135, in __enter__
    return next(self.gen)
  File "/home/boo/etebase/.venv/lib/python3.10/site-packages/django/db/backends/base/base.py", line 603, in temporary_connection
    with self.cursor() as cursor:
  File "/home/boo/etebase/.venv/lib/python3.10/site-packages/django/utils/asyncio.py", line 33, in inner
    return func(*args, **kwargs)
  File "/home/boo/etebase/.venv/lib/python3.10/site-packages/django/db/backends/base/base.py", line 259, in cursor
    return self._cursor()
  File "/home/boo/etebase/.venv/lib/python3.10/site-packages/django/db/backends/base/base.py", line 235, in _cursor
    self.ensure_connection()
  File "/home/boo/etebase/.venv/lib/python3.10/site-packages/django/utils/asyncio.py", line 33, in inner
    return func(*args, **kwargs)
  File "/home/boo/etebase/.venv/lib/python3.10/site-packages/django/db/backends/base/base.py", line 219, in ensure_connection
    self.connect()
  File "/home/boo/etebase/.venv/lib/python3.10/site-packages/django/utils/asyncio.py", line 33, in inner
    return func(*args, **kwargs)
  File "/home/boo/etebase/.venv/lib/python3.10/site-packages/django/db/backends/base/base.py", line 199, in connect
    conn_params = self.get_connection_params()
  File "/home/boo/etebase/.venv/lib/python3.10/site-packages/django/db/backends/mysql/base.py", line 217, in get_connection_params
    options = settings_dict['OPTIONS'].copy()
AttributeError: 'SectionProxy' object has no attribute 'copy'

What exactly is going on here and how can I fix this in order to complete the installation?

daftaupe commented 1 year ago

@Danrancan will have to try to reproduce first. I'll let you know how it goes.

Danrancan commented 1 year ago

@Danrancan will have to try to reproduce first. I'll let you know how it goes.

Okay thanks. I'm wondering if its a ARM64 issue since I'm running it on the Raspberry pi.

victor-rds commented 1 year ago

@Danrancan AFAIK Etesync is not compatible with MariaDB/MySQL, until etesync/server#69 is fixed.

Top-Ranger commented 1 year ago

This does sond familiar to me... I do think I fixed this by using etebase_server/settings.py instead of the etebase-server.ini.

Can you try to remove the etebase-server.ini file and change the values in etebase_server/settings.py? My database config looks like the following:

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'etesync',
        'USER': 'etesync',
        'PASSWORD': 'PASSWORD',
        'HOST': '127.0.0.1',
        'PORT': '3306',
        'OPTIONS': {'charset': 'utf8mb4'},
    }
}

Please note that the workaround in https://github.com/etesync/server/issues/69#issuecomment-768897369 has to be applied too.