[Pkg-mailman-hackers] Bug#891691: Bug#891691: mailman3-core: Cannot install mailman3-suite with mysql database

Pierre-Elliott Bécue becue at crans.org
Wed Feb 28 18:29:18 UTC 2018


Le mercredi 28 février 2018 à 01:55:23+0000, Colin Turner a écrit :
> Package: mailman3-core
> Version: 3.1.1-4
> Severity: normal
> 
> Dear Maintainer,
> 
> Many thanks for your work on these packages. I'm following up from bug 891553.
> 
> I have attempted to install mailman3-suite, and allowed automatic configuration using mysql. I think this was the default presented choice.
> This configuration failed, with this error transcript.
> 
> Errors were encountered while processing:
>  mailman3-suite
> E: Sub-process /usr/bin/dpkg returned an error code (1)
> Setting up mailman3-suite (0+20170523-10) ...
> Determining localhost credentials from /etc/mysql/debian.cnf: succeeded.
> dbconfig-common: writing config to /etc/dbconfig-common/mailman3-suite.conf
> mailman3suite already exists and has privileges on mailman3suite.
> creating database mailman3suite: already exists.
> dbconfig-common: flushing administrative password
> Traceback (most recent call last):
>   File "/usr/bin/django-admin", line 21, in <module>
>     management.execute_from_command_line()
>   File "/usr/lib/python2.7/dist-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
>     utility.execute()
>   File "/usr/lib/python2.7/dist-packages/django/core/management/__init__.py", line 338, in execute
>     django.setup()
>   File "/usr/lib/python2.7/dist-packages/django/__init__.py", line 27, in setup
>     apps.populate(settings.INSTALLED_APPS)
>   File "/usr/lib/python2.7/dist-packages/django/apps/registry.py", line 108, in populate
>     app_config.import_models()
>   File "/usr/lib/python2.7/dist-packages/django/apps/config.py", line 202, in import_models
>     self.models_module = import_module(models_module_name)
>   File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
>     __import__(name)
>   File "/usr/lib/python2.7/dist-packages/hyperkitty/models/__init__.py", line 27, in <module>
>     from .category import ThreadCategoryg
>   File "/usr/lib/python2.7/dist-packages/hyperkitty/models/category.py", line 30, in <module>
>     class ThreadCategory(models.Model):
>   File "/usr/lib/python2.7/dist-packages/django/db/models/base.py", line 124, in __new__
>     new_class.add_to_class('_meta', Options(meta, app_label))
>   File "/usr/lib/python2.7/dist-packages/django/db/models/base.py", line 325, in add_to_class
>     value.contribute_to_class(cls, name)
>   File "/usr/lib/python2.7/dist-packages/django/db/models/options.py", line 214, in contribute_to_class
>     self.db_table = truncate_name(self.db_table, connection.ops.max_name_length())
>   File "/usr/lib/python2.7/dist-packages/django/db/__init__.py", line 33, in __getattr__
>     return getattr(connections[DEFAULT_DB_ALIAS], item)
>   File "/usr/lib/python2.7/dist-packages/django/db/utils.py", line 211, in __getitem__
>     backend = load_backend(db['ENGINE'])
>   File "/usr/lib/python2.7/dist-packages/django/db/utils.py", line 115, in load_backend
>     return import_module('%s.base' % backend_name)
>   File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
>     __import__(name)
>   File "/usr/lib/python2.7/dist-packages/django/db/backends/mysql/base.py", line 30, in <module>
>     'Did you install mysqlclient or MySQL-python?' % e
> django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No module named MySQLdb.
> Did you install mysqlclient or MySQL-python?
> dpkg: error processing package mailman3-suite (--configure):
>  installed mailman3-suite package post-installation script subprocess returned error exit status 1
> Errors were encountered while processing:
>  mailman3-suite
> 
> So I'm guessing there is a missing dependency here. I tried installing python-mysqldb, but this provided a different error:
> 
> Errors were encountered while processing:
>  mailman3-suite
> E: Sub-process /usr/bin/dpkg returned an error code (1)
> Setting up mailman3-suite (0+20170523-10) ...
> Determining localhost credentials from /etc/mysql/debian.cnf: succeeded.
> dbconfig-common: writing config to /etc/dbconfig-common/mailman3-suite.conf
> mailman3suite already exists and has privileges on mailman3suite.
> creating database mailman3suite: already exists.
> dbconfig-common: flushing administrative password
> Traceback (most recent call last):
>   File "/usr/bin/django-admin", line 21, in <module>
>     management.execute_from_command_line()
>   File "/usr/lib/python2.7/dist-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
>     utility.execute()
>   File "/usr/lib/python2.7/dist-packages/django/core/management/__init__.py", line 356, in execute
>     self.fetch_command(subcommand).run_from_argv(self.argv)
>   File "/usr/lib/python2.7/dist-packages/django/core/management/base.py", line 283, in run_from_argv
>     self.execute(*args, **cmd_options)
>   File "/usr/lib/python2.7/dist-packages/django/core/management/base.py", line 330, in execute
>     output = self.handle(*args, **options)
>   File "/usr/lib/python2.7/dist-packages/django/core/management/commands/migrate.py", line 204, in handle
>     fake_initial=fake_initial,
>   File "/usr/lib/python2.7/dist-packages/django/db/migrations/executor.py", line 115, in migrate
>     state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, fake_initial=fake_initial)
>   File "/usr/lib/python2.7/dist-packages/django/db/migrations/executor.py", line 145, in _migrate_all_forwards
>     state = self.apply_migration(state, migration, fake=fake, fake_initial=fake_initial)
>   File "/usr/lib/python2.7/dist-packages/django/db/migrations/executor.py", line 244, in apply_migration
>     state = migration.apply(state, schema_editor)
>   File "/usr/lib/python2.7/dist-packages/django/db/migrations/migration.py", line 129, in apply
>     operation.database_forwards(self.app_label, schema_editor, old_state, project_state)
>   File "/usr/lib/python2.7/dist-packages/django/db/migrations/operations/fields.py", line 221, in database_forwards
>     schema_editor.alter_field(from_model, from_field, to_field)
>   File "/usr/lib/python2.7/dist-packages/django/db/backends/base/schema.py", line 515, in alter_field
>     old_db_params, new_db_params, strict)
>   File "/usr/lib/python2.7/dist-packages/django/db/backends/base/schema.py", line 690, in _alter_field
>     params,
>   File "/usr/lib/python2.7/dist-packages/django/db/backends/base/schema.py", line 120, in execute
>     cursor.execute(sql, params)
>   File "/usr/lib/python2.7/dist-packages/django/db/backends/utils.py", line 64, in execute
>     return self.cursor.execute(sql, params)
>   File "/usr/lib/python2.7/dist-packages/django/db/utils.py", line 94, in __exit__
>     six.reraise(dj_exc_type, dj_exc_value, traceback)
>   File "/usr/lib/python2.7/dist-packages/django/db/backends/utils.py", line 64, in execute
>     return self.cursor.execute(sql, params)
>   File "/usr/lib/python2.7/dist-packages/django/db/backends/mysql/base.py", line 101, in execute
>     return self.cursor.execute(query, args)
>   File "/usr/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 250, in execute
>     self.errorhandler(self, exc, value)
>   File "/usr/lib/python2.7/dist-packages/MySQLdb/connections.py", line 50, in defaulterrorhandler
>     raise errorvalue
> django.db.utils.OperationalError: (1071, 'Specified key was too long; max key length is 767 bytes')
> dpkg: error processing package mailman3-suite (--configure):
>  installed mailman3-suite package post-installation script subprocess returned error exit status 1
> Errors were encountered while processing:
>  mailman3-suite

This error is a bummer. It comes from innoDB implementations of SQL servers.
The main idea is that there is a limited length for the index deployment on
varchar fields, and one field in django-allauth/mailman is 255 chars, which
is more than 767 bytes (191 chars).

What SQL server do you use?

Regarding the missing dependency, we'll add it as soon as possible. :)

-- 
Pierre-Elliott Bécue
GPG: 9AE0 4D98 6400 E3B6 7528  F493 0D44 2664 1949 74E2
It's far easier to fight for one's principles than to live up to them.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-mailman-hackers/attachments/20180228/5ba773fd/attachment.sig>


More information about the Pkg-mailman-hackers mailing list