mirror of
https://github.com/modoboa/modoboa.git
synced 2026-04-25 17:06:01 +03:00
[GH-ISSUE #1831] Can't create table 'mail.#sql-498_15864' (errno: 150) #1437
Labels
No labels
bug
bug
dependencies
design
documentation
duplicate
enhancement
enhancement
enhancement
feedback-needed
help-needed
help-needed
installer
invalid
looking-for-sponsors
modoboa-contacts
new-ui
new-ui
pr
pull-request
pyconfr
python
question
security
stale
webmail
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/modoboa-modoboa#1437
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ndoody on GitHub (Jan 30, 2020).
Original GitHub issue: https://github.com/modoboa/modoboa/issues/1831
I have tried to upgrade from older modoboa versions to the latest, going through versions in series and running the upgrade procedure (python manage.py migrate) but it is having a problem creating some new tables for some of the new features / upgraded plugins.
I can run the command above and get the error "errno: 150" trying to create the temporary table, but the correct table is created (dnstools_dnsrecord) it's just empty and running subsequent migrations comes back wit the error that this table is already created.
Can reproduce by dropping the SQL table above and trying to migrate again.
Impacted versions
Steps to reproduce
Run python manage.py migrate after upgrading
Current behavior
Applying dnstools.0001_initial...Traceback (most recent call last):
File "manage.py", line 10, in
execute_from_command_line(sys.argv)
File "/usr/local/lib/python2.7/site-packages/django/core/management/init.py", line 364, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python2.7/site-packages/django/core/management/init.py", line 356, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python2.7/site-packages/django/core/management/base.py", line 283, in run_from_argv
self.execute(*args, **cmd_options)
File "/usr/local/lib/python2.7/site-packages/django/core/management/base.py", line 330, in execute
output = self.handle(*args, **options)
File "/usr/local/lib/python2.7/site-packages/django/core/management/commands/migrate.py", line 204, in handle
fake_initial=fake_initial,
File "/usr/local/lib/python2.7/site-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/local/lib/python2.7/site-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/local/lib/python2.7/site-packages/django/db/migrations/executor.py", line 244, in apply_migration
state = migration.apply(state, schema_editor)
File "/usr/local/lib/python2.7/site-packages/django/db/backends/base/schema.py", line 109, in exit
self.execute(sql)
File "/usr/local/lib/python2.7/site-packages/django/db/backends/base/schema.py", line 136, in execute
cursor.execute(sql, params)
File "/usr/local/lib/python2.7/site-packages/django/db/backends/utils.py", line 79, in execute
return super(CursorDebugWrapper, self).execute(sql, params)
File "/usr/local/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute
return self.cursor.execute(sql, params)
File "/usr/local/lib/python2.7/site-packages/django/db/utils.py", line 94, in exit
six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/usr/local/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute
return self.cursor.execute(sql, params)
File "/usr/local/lib/python2.7/site-packages/django/db/backends/mysql/base.py", line 101, in execute
return self.cursor.execute(query, args)
File "build/bdist.freebsd-9.2-RELEASE-p7-i386/egg/MySQLdb/cursors.py", line 205, in execute
File "build/bdist.freebsd-9.2-RELEASE-p7-i386/egg/MySQLdb/connections.py", line 36, in defaulterrorhandler
django.db.utils.OperationalError: (1005, "Can't create table 'mail.#sql-498_15864' (errno: 150)")
Expected behavior
The new table is created and the migrate procedure works without error.
Video/Screenshot link (optional)
@tonioo commented on GitHub (Feb 4, 2020):
@ndoody Can you check to storage engine used by your database and the encoding please?
@ndoody commented on GitHub (Feb 4, 2020):
@tonioo It's innodb and Latin1 for the new tables.
This was changed previously as part of some recommendations of another bug where it Modoboa crashed from trying to render some text in spam mail with funny characters...what should it be set too?
@tonioo commented on GitHub (Feb 4, 2020):
@ndoody utf8_general_ci for the modoboa database would be better I think.
@tonioo commented on GitHub (Feb 27, 2020):
@ndoody Have you tested the encoding change?