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

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

Open
Danrancan opened this issue Jan 11, 2023 · 4 comments

Comments

@Danrancan
Copy link

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
Copy link
Collaborator

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

@Danrancan
Copy link
Author

@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
Copy link
Contributor

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

@Top-Ranger
Copy link

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 #69 (comment) has to be applied too.

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

4 participants