[GH-ISSUE #2304] 500 Internal server error o create user, add domain,.. #1566

Closed
opened 2026-02-27 11:17:50 +03:00 by kerem · 19 comments
Owner

Originally created by @optimdevel on GitHub (Jun 30, 2021).
Original GitHub issue: https://github.com/modoboa/modoboa/issues/2304

LXC Debian GNU/Linux 10 (buster) upgraded from 8, MySql db upgraded using manage migrate from 1.5.3 to 1.17.0 + plugins, .. using instructions from https://modoboa.readthedocs.io/en/latest/upgrade.html .

After trying to add a new domain or change users password, we get 500 Internal server error.
I have enabled debug = true in settings.py in instance dir and restarted uwsgi. I checked all the log files I can think off, but have no idea where to look to get more detailed error, so I can solve it.

How to get more infor about ther internal error?
modoboa500

Originally created by @optimdevel on GitHub (Jun 30, 2021). Original GitHub issue: https://github.com/modoboa/modoboa/issues/2304 LXC Debian GNU/Linux 10 (buster) upgraded from 8, MySql db upgraded using manage migrate from 1.5.3 to 1.17.0 + plugins, .. using instructions from https://modoboa.readthedocs.io/en/latest/upgrade.html . After trying to add a new domain or change users password, we get 500 Internal server error. I have enabled debug = true in settings.py in instance dir and restarted uwsgi. I checked all the log files I can think off, but have no idea where to look to get more detailed error, so I can solve it. How to get more infor about ther internal error? ![modoboa500](https://user-images.githubusercontent.com/37371940/123953986-25fcf500-d9a8-11eb-9343-a31ac0e0b892.png)
kerem 2026-02-27 11:17:50 +03:00
  • closed this issue
  • added the
    stale
    label
Author
Owner

@tonioo commented on GitHub (Jun 30, 2021):

@optimdevel Set DEBUG to True inside settings.py and reload uwsgi.

<!-- gh-comment-id:871328577 --> @tonioo commented on GitHub (Jun 30, 2021): @optimdevel Set DEBUG to True inside settings.py and reload uwsgi.
Author
Owner

@optimdevel commented on GitHub (Jun 30, 2021):

I have done that already, however I was not aware there is more info on other tabs in the debug console.
Just fund the error:

(1364, "Field 'manager_slug' doesn't have a default value")

I guess migrations did not completely "upgrade" the database.
Will see how can I fix this.

<!-- gh-comment-id:871332549 --> @optimdevel commented on GitHub (Jun 30, 2021): I have done that already, however I was not aware there is more info on other tabs in the debug console. Just fund the error: (1364, "Field 'manager_slug' doesn't have a default value") I guess migrations did not completely "upgrade" the database. Will see how can I fix this.
Author
Owner

@optimdevel commented on GitHub (Jun 30, 2021):

Can you please show me your scheba for reversion_revision?
MariaDB [modoboa]> describe reversion_revision -> ; +--------------+--------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +--------------+--------------+------+-----+---------+----------------+ | id | int(11) | NO | PRI | NULL | auto_increment | | manager_slug | varchar(191) | NO | MUL | NULL | | | date_created | datetime | NO | MUL | NULL | | | comment | longtext | NO | | NULL | | | user_id | int(11) | YES | MUL | NULL | | +--------------+--------------+------+-----+---------+----------------+

<!-- gh-comment-id:871338796 --> @optimdevel commented on GitHub (Jun 30, 2021): Can you please show me your scheba for reversion_revision? `MariaDB [modoboa]> describe reversion_revision -> ; +--------------+--------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +--------------+--------------+------+-----+---------+----------------+ | id | int(11) | NO | PRI | NULL | auto_increment | | manager_slug | varchar(191) | NO | MUL | NULL | | | date_created | datetime | NO | MUL | NULL | | | comment | longtext | NO | | NULL | | | user_id | int(11) | YES | MUL | NULL | | +--------------+--------------+------+-----+---------+----------------+ `
Author
Owner

@tonioo commented on GitHub (Jun 30, 2021):

@optimdevel It comes from an external package (django-reversion). Can you check the version installed in your virtualenv and also run the following command:

python manage.py showmigrations
<!-- gh-comment-id:871342956 --> @tonioo commented on GitHub (Jun 30, 2021): @optimdevel It comes from an external package (django-reversion). Can you check the version installed in your virtualenv and also run the following command: ``` python manage.py showmigrations ```
Author
Owner

@optimdevel commented on GitHub (Jun 30, 2021):

Sure.
env) modoboa@mail3:~/instance$ python manage.py showmigrations admin [X] 0001_initial [X] 0002_migrate_from_modoboa_admin [X] 0003_auto_20151118_1215 [X] 0004_auto_20160914_0907 [X] 0005_auto_20161026_1003 [X] 0006_auto_20161104_1900 [X] 0007_auto_20161104_1915 [X] 0008_domain_enable_dns_checks [X] 0009_auto_20170215_0948 [X] 0010_auto_20170215_1328 [X] 0011_domain_transport [X] 0012_auto_20180112_1658 [X] 0013_auto_20180124_2311 [X] 0014_auto_20181017_1628 [X] 0015_rename_view_permissions [X] 0016_auto_20200602_1201 [X] 0017_alarm auth [X] 0001_initial [X] 0002_alter_permission_name_max_length [X] 0003_alter_user_email_max_length [X] 0004_alter_user_username_opts [X] 0005_alter_user_last_login_null [X] 0006_require_contenttypes_0002 [X] 0007_alter_validators_add_error_messages [X] 0008_alter_user_username_max_length [X] 0009_alter_user_last_name_max_length [X] 0010_alter_group_name_max_length [X] 0011_update_proxy_permissions authtoken [X] 0001_initial [X] 0002_auto_20160226_1747 contenttypes [X] 0001_initial [X] 0002_remove_content_type_name core [X] 0001_initial [X] 0002_delete_extension [X] 0003_user_master_user [X] 0004_auto_20150728_1228 [X] 0005_user_language [X] 0006_auto_20151114_1518 [X] 0007_auto_20151116_1349 [X] 0008_localconfig [X] 0009_auto_20161026_1003 [X] 0010_auto_20161026_1011 [X] 0011_auto_20161104_2217 [X] 0012_auto_20170215_1034 [X] 0013_auto_20170707_1058 [X] 0014_auto_20171010_1746 [X] 0015_auto_20180112_1642 [X] 0016_auto_20180713_1014 [X] 0017_auto_20190705_1045 [X] 0018_auto_20200104_1714 [X] 0019_auto_20200121_1659 [X] 0020_auto_20200421_0851 [X] 0021_localconfig_need_dovecot_update [X] 0022_user_tfa_enabled dnstools [X] 0001_initial lib [X] 0001_initial [X] 0002_rename_parameters [X] 0003_rename_parameters [X] 0004_auto_20151114_1409 [X] 0005_auto_20160416_1449 [X] 0006_auto_20161104_2206 limits [X] 0001_squashed_0004_auto_20160413_1312 (4 squashed migrations) [X] 0005_auto_20160415_1654 [X] 0006_auto_20170216_1112 maillog [X] 0001_initial [X] 0002_auto_20200916_1346 modoboa_amavis [X] 0001_initial modoboa_contacts [X] 0001_initial [X] 0002_auto_20180124_2311 [X] 0003_auto_20181005_1415 [X] 0004_auto_20181005_1415 [X] 0005_auto_20181005_1445 modoboa_postfix_autoreply [X] 0001_initial [X] 0002_auto_20150728_1236 [X] 0003_move_aliases [X] 0004_delete_alias [X] 0005_auto_20151202_1623 [X] 0006_auto_20160329_1501 [X] 0007_auto_20180928_1423 [X] 0008_delete_transport modoboa_radicale [X] 0001_initial [X] 0002_auto_20170831_1721 [X] 0003_auto_20180324_1834 [X] 0004_auto_20200220_1816 [X] 0005_auto_20200220_1819 otp_static [X] 0001_initial [X] 0002_throttling otp_totp [X] 0001_initial [X] 0002_auto_20190420_0723 relaydomains [X] 0001_initial [X] 0002_migrate_from_modoboa_admin_relaydomains [X] 0003_auto_20170116_1508 [X] 0004_auto_20161105_1424 [X] 0005_auto_20161105_1426 [X] 0006_auto_20170215_0948 [X] 0007_recipientaccess [X] 0008_auto_20171123_1653 [X] 0009_auto_20171124_1508 reversion [X] 0001_squashed_0004_auto_20160611_1202 sessions [X] 0001_initial sites [X] 0001_initial [X] 0002_alter_domain_unique transport [X] 0001_initial [X] 0002_auto_20180928_1520 (env) modoboa@mail3:~/instance$

<!-- gh-comment-id:871343799 --> @optimdevel commented on GitHub (Jun 30, 2021): Sure. `env) modoboa@mail3:~/instance$ python manage.py showmigrations admin [X] 0001_initial [X] 0002_migrate_from_modoboa_admin [X] 0003_auto_20151118_1215 [X] 0004_auto_20160914_0907 [X] 0005_auto_20161026_1003 [X] 0006_auto_20161104_1900 [X] 0007_auto_20161104_1915 [X] 0008_domain_enable_dns_checks [X] 0009_auto_20170215_0948 [X] 0010_auto_20170215_1328 [X] 0011_domain_transport [X] 0012_auto_20180112_1658 [X] 0013_auto_20180124_2311 [X] 0014_auto_20181017_1628 [X] 0015_rename_view_permissions [X] 0016_auto_20200602_1201 [X] 0017_alarm auth [X] 0001_initial [X] 0002_alter_permission_name_max_length [X] 0003_alter_user_email_max_length [X] 0004_alter_user_username_opts [X] 0005_alter_user_last_login_null [X] 0006_require_contenttypes_0002 [X] 0007_alter_validators_add_error_messages [X] 0008_alter_user_username_max_length [X] 0009_alter_user_last_name_max_length [X] 0010_alter_group_name_max_length [X] 0011_update_proxy_permissions authtoken [X] 0001_initial [X] 0002_auto_20160226_1747 contenttypes [X] 0001_initial [X] 0002_remove_content_type_name core [X] 0001_initial [X] 0002_delete_extension [X] 0003_user_master_user [X] 0004_auto_20150728_1228 [X] 0005_user_language [X] 0006_auto_20151114_1518 [X] 0007_auto_20151116_1349 [X] 0008_localconfig [X] 0009_auto_20161026_1003 [X] 0010_auto_20161026_1011 [X] 0011_auto_20161104_2217 [X] 0012_auto_20170215_1034 [X] 0013_auto_20170707_1058 [X] 0014_auto_20171010_1746 [X] 0015_auto_20180112_1642 [X] 0016_auto_20180713_1014 [X] 0017_auto_20190705_1045 [X] 0018_auto_20200104_1714 [X] 0019_auto_20200121_1659 [X] 0020_auto_20200421_0851 [X] 0021_localconfig_need_dovecot_update [X] 0022_user_tfa_enabled dnstools [X] 0001_initial lib [X] 0001_initial [X] 0002_rename_parameters [X] 0003_rename_parameters [X] 0004_auto_20151114_1409 [X] 0005_auto_20160416_1449 [X] 0006_auto_20161104_2206 limits [X] 0001_squashed_0004_auto_20160413_1312 (4 squashed migrations) [X] 0005_auto_20160415_1654 [X] 0006_auto_20170216_1112 maillog [X] 0001_initial [X] 0002_auto_20200916_1346 modoboa_amavis [X] 0001_initial modoboa_contacts [X] 0001_initial [X] 0002_auto_20180124_2311 [X] 0003_auto_20181005_1415 [X] 0004_auto_20181005_1415 [X] 0005_auto_20181005_1445 modoboa_postfix_autoreply [X] 0001_initial [X] 0002_auto_20150728_1236 [X] 0003_move_aliases [X] 0004_delete_alias [X] 0005_auto_20151202_1623 [X] 0006_auto_20160329_1501 [X] 0007_auto_20180928_1423 [X] 0008_delete_transport modoboa_radicale [X] 0001_initial [X] 0002_auto_20170831_1721 [X] 0003_auto_20180324_1834 [X] 0004_auto_20200220_1816 [X] 0005_auto_20200220_1819 otp_static [X] 0001_initial [X] 0002_throttling otp_totp [X] 0001_initial [X] 0002_auto_20190420_0723 relaydomains [X] 0001_initial [X] 0002_migrate_from_modoboa_admin_relaydomains [X] 0003_auto_20170116_1508 [X] 0004_auto_20161105_1424 [X] 0005_auto_20161105_1426 [X] 0006_auto_20170215_0948 [X] 0007_recipientaccess [X] 0008_auto_20171123_1653 [X] 0009_auto_20171124_1508 reversion [X] 0001_squashed_0004_auto_20160611_1202 sessions [X] 0001_initial sites [X] 0001_initial [X] 0002_alter_domain_unique transport [X] 0001_initial [X] 0002_auto_20180928_1520 (env) modoboa@mail3:~/instance$ `
Author
Owner

@optimdevel commented on GitHub (Jun 30, 2021):

Better formatting:

admin
[X] 0001_initial
[X] 0002_migrate_from_modoboa_admin
[X] 0003_auto_20151118_1215
[X] 0004_auto_20160914_0907
[X] 0005_auto_20161026_1003
[X] 0006_auto_20161104_1900
[X] 0007_auto_20161104_1915
[X] 0008_domain_enable_dns_checks
[X] 0009_auto_20170215_0948
[X] 0010_auto_20170215_1328
[X] 0011_domain_transport
[X] 0012_auto_20180112_1658
[X] 0013_auto_20180124_2311
[X] 0014_auto_20181017_1628
[X] 0015_rename_view_permissions
[X] 0016_auto_20200602_1201
[X] 0017_alarm
auth
[X] 0001_initial
[X] 0002_alter_permission_name_max_length
[X] 0003_alter_user_email_max_length
[X] 0004_alter_user_username_opts
[X] 0005_alter_user_last_login_null
[X] 0006_require_contenttypes_0002
[X] 0007_alter_validators_add_error_messages
[X] 0008_alter_user_username_max_length
[X] 0009_alter_user_last_name_max_length
[X] 0010_alter_group_name_max_length
[X] 0011_update_proxy_permissions
authtoken
[X] 0001_initial
[X] 0002_auto_20160226_1747
contenttypes
[X] 0001_initial
[X] 0002_remove_content_type_name
core
[X] 0001_initial
[X] 0002_delete_extension
[X] 0003_user_master_user
[X] 0004_auto_20150728_1228
[X] 0005_user_language
[X] 0006_auto_20151114_1518
[X] 0007_auto_20151116_1349
[X] 0008_localconfig
[X] 0009_auto_20161026_1003
[X] 0010_auto_20161026_1011
[X] 0011_auto_20161104_2217
[X] 0012_auto_20170215_1034
[X] 0013_auto_20170707_1058
[X] 0014_auto_20171010_1746
[X] 0015_auto_20180112_1642
[X] 0016_auto_20180713_1014
[X] 0017_auto_20190705_1045
[X] 0018_auto_20200104_1714
[X] 0019_auto_20200121_1659
[X] 0020_auto_20200421_0851
[X] 0021_localconfig_need_dovecot_update
[X] 0022_user_tfa_enabled
dnstools
[X] 0001_initial
lib
[X] 0001_initial
[X] 0002_rename_parameters
[X] 0003_rename_parameters
[X] 0004_auto_20151114_1409
[X] 0005_auto_20160416_1449
[X] 0006_auto_20161104_2206
limits
[X] 0001_squashed_0004_auto_20160413_1312 (4 squashed migrations)
[X] 0005_auto_20160415_1654
[X] 0006_auto_20170216_1112
maillog
[X] 0001_initial
[X] 0002_auto_20200916_1346
modoboa_amavis
[X] 0001_initial
modoboa_contacts
[X] 0001_initial
[X] 0002_auto_20180124_2311
[X] 0003_auto_20181005_1415
[X] 0004_auto_20181005_1415
[X] 0005_auto_20181005_1445
modoboa_postfix_autoreply
[X] 0001_initial
[X] 0002_auto_20150728_1236
[X] 0003_move_aliases
[X] 0004_delete_alias
[X] 0005_auto_20151202_1623
[X] 0006_auto_20160329_1501
[X] 0007_auto_20180928_1423
[X] 0008_delete_transport
modoboa_radicale
[X] 0001_initial
[X] 0002_auto_20170831_1721
[X] 0003_auto_20180324_1834
[X] 0004_auto_20200220_1816
[X] 0005_auto_20200220_1819
otp_static
[X] 0001_initial
[X] 0002_throttling
otp_totp
[X] 0001_initial
[X] 0002_auto_20190420_0723
relaydomains
[X] 0001_initial
[X] 0002_migrate_from_modoboa_admin_relaydomains
[X] 0003_auto_20170116_1508
[X] 0004_auto_20161105_1424
[X] 0005_auto_20161105_1426
[X] 0006_auto_20170215_0948
[X] 0007_recipientaccess
[X] 0008_auto_20171123_1653
[X] 0009_auto_20171124_1508
reversion
[X] 0001_squashed_0004_auto_20160611_1202
sessions
[X] 0001_initial
sites
[X] 0001_initial
[X] 0002_alter_domain_unique
transport
[X] 0001_initial
[X] 0002_auto_20180928_1520
(env) modoboa@mail3:~/instance$

<!-- gh-comment-id:871344156 --> @optimdevel commented on GitHub (Jun 30, 2021): Better formatting: admin [X] 0001_initial [X] 0002_migrate_from_modoboa_admin [X] 0003_auto_20151118_1215 [X] 0004_auto_20160914_0907 [X] 0005_auto_20161026_1003 [X] 0006_auto_20161104_1900 [X] 0007_auto_20161104_1915 [X] 0008_domain_enable_dns_checks [X] 0009_auto_20170215_0948 [X] 0010_auto_20170215_1328 [X] 0011_domain_transport [X] 0012_auto_20180112_1658 [X] 0013_auto_20180124_2311 [X] 0014_auto_20181017_1628 [X] 0015_rename_view_permissions [X] 0016_auto_20200602_1201 [X] 0017_alarm auth [X] 0001_initial [X] 0002_alter_permission_name_max_length [X] 0003_alter_user_email_max_length [X] 0004_alter_user_username_opts [X] 0005_alter_user_last_login_null [X] 0006_require_contenttypes_0002 [X] 0007_alter_validators_add_error_messages [X] 0008_alter_user_username_max_length [X] 0009_alter_user_last_name_max_length [X] 0010_alter_group_name_max_length [X] 0011_update_proxy_permissions authtoken [X] 0001_initial [X] 0002_auto_20160226_1747 contenttypes [X] 0001_initial [X] 0002_remove_content_type_name core [X] 0001_initial [X] 0002_delete_extension [X] 0003_user_master_user [X] 0004_auto_20150728_1228 [X] 0005_user_language [X] 0006_auto_20151114_1518 [X] 0007_auto_20151116_1349 [X] 0008_localconfig [X] 0009_auto_20161026_1003 [X] 0010_auto_20161026_1011 [X] 0011_auto_20161104_2217 [X] 0012_auto_20170215_1034 [X] 0013_auto_20170707_1058 [X] 0014_auto_20171010_1746 [X] 0015_auto_20180112_1642 [X] 0016_auto_20180713_1014 [X] 0017_auto_20190705_1045 [X] 0018_auto_20200104_1714 [X] 0019_auto_20200121_1659 [X] 0020_auto_20200421_0851 [X] 0021_localconfig_need_dovecot_update [X] 0022_user_tfa_enabled dnstools [X] 0001_initial lib [X] 0001_initial [X] 0002_rename_parameters [X] 0003_rename_parameters [X] 0004_auto_20151114_1409 [X] 0005_auto_20160416_1449 [X] 0006_auto_20161104_2206 limits [X] 0001_squashed_0004_auto_20160413_1312 (4 squashed migrations) [X] 0005_auto_20160415_1654 [X] 0006_auto_20170216_1112 maillog [X] 0001_initial [X] 0002_auto_20200916_1346 modoboa_amavis [X] 0001_initial modoboa_contacts [X] 0001_initial [X] 0002_auto_20180124_2311 [X] 0003_auto_20181005_1415 [X] 0004_auto_20181005_1415 [X] 0005_auto_20181005_1445 modoboa_postfix_autoreply [X] 0001_initial [X] 0002_auto_20150728_1236 [X] 0003_move_aliases [X] 0004_delete_alias [X] 0005_auto_20151202_1623 [X] 0006_auto_20160329_1501 [X] 0007_auto_20180928_1423 [X] 0008_delete_transport modoboa_radicale [X] 0001_initial [X] 0002_auto_20170831_1721 [X] 0003_auto_20180324_1834 [X] 0004_auto_20200220_1816 [X] 0005_auto_20200220_1819 otp_static [X] 0001_initial [X] 0002_throttling otp_totp [X] 0001_initial [X] 0002_auto_20190420_0723 relaydomains [X] 0001_initial [X] 0002_migrate_from_modoboa_admin_relaydomains [X] 0003_auto_20170116_1508 [X] 0004_auto_20161105_1424 [X] 0005_auto_20161105_1426 [X] 0006_auto_20170215_0948 [X] 0007_recipientaccess [X] 0008_auto_20171123_1653 [X] 0009_auto_20171124_1508 reversion [X] 0001_squashed_0004_auto_20160611_1202 sessions [X] 0001_initial sites [X] 0001_initial [X] 0002_alter_domain_unique transport [X] 0001_initial [X] 0002_auto_20180928_1520 (env) modoboa@mail3:~/instance$
Author
Owner

@tonioo commented on GitHub (Jun 30, 2021):

@optimdevel Looks like migrations for reversion have been squashed... I'm afraid you need to apply missing changes manually.

<!-- gh-comment-id:871345081 --> @tonioo commented on GitHub (Jun 30, 2021): @optimdevel Looks like migrations for reversion have been squashed... I'm afraid you need to apply missing changes manually.
Author
Owner

@tonioo commented on GitHub (Jun 30, 2021):

@optimdevel Can you make sure than version 3.0.5 is installed?

<!-- gh-comment-id:871346746 --> @tonioo commented on GitHub (Jun 30, 2021): @optimdevel Can you make sure than version 3.0.5 is installed?
Author
Owner

@optimdevel commented on GitHub (Jun 30, 2021):

Thank you for your help. I really appreciate it.

It is in env and by default on the system:
(env) modoboa@mail3:/instance$ python --version
Python 3.7.3
(env) modoboa@mail3:/instance$ exit
exit
$ exit
root@mail3:/etc# python --version
Python 3.7.3

However i do think that squashing migrations actually still applies all migrations, they are just condensed a. k. a. squashed.

To be noted, is that there was an error with one of the migrations:

django.db.utils.OperationalError: (1060, "Duplicate column name '_parameters'")
->nano -w /srv/modoboa/env/lib/python3.7/site-packages/modoboa/core/migrations/

so I faked it: python manage.py migrate --fake core 0010_auto_20161026_1011

as it seemed like it already has had this column and migration was already applied.

Maybe I should just start over, as this is a copy of production virtual instance where I test the upgrade procedure, and open a new issue when I reach failed migration.

Also on a related note, because i have to remove modoboa and do a install with latest installer again (upgrade fails with python dependencies hell) I have two questions:

Will modoboa (installer) regenerate all daemon (amavis, postfix, dovecot,..) files again if I purge remove them beforehand?
Will modoboa create missing databases and users (as defined in installer.cfg) for plugins that were non existent in the previsously installed version?

<!-- gh-comment-id:871355752 --> @optimdevel commented on GitHub (Jun 30, 2021): Thank you for your help. I really appreciate it. It is in env and by default on the system: (env) modoboa@mail3:/instance$ python --version Python 3.7.3 (env) modoboa@mail3:/instance$ exit exit $ exit root@mail3:/etc# python --version Python 3.7.3 However i do think that squashing migrations actually still applies all migrations, they are just condensed a. k. a. squashed. To be noted, is that there was an error with one of the migrations: django.db.utils.OperationalError: (1060, "Duplicate column name '_parameters'") ->nano -w /srv/modoboa/env/lib/python3.7/site-packages/modoboa/core/migrations/ so I faked it: python manage.py migrate --fake core 0010_auto_20161026_1011 as it seemed like it already has had this column and migration was already applied. Maybe I should just start over, as this is a copy of production virtual instance where I test the upgrade procedure, and open a new issue when I reach failed migration. Also on a related note, because i have to remove modoboa and do a install with latest installer again (upgrade fails with python dependencies hell) I have two questions: Will modoboa (installer) regenerate all daemon (amavis, postfix, dovecot,..) files again if I purge remove them beforehand? Will modoboa create missing databases and users (as defined in installer.cfg) for plugins that were non existent in the previsously installed version?
Author
Owner

@tonioo commented on GitHub (Jun 30, 2021):

I was talking about the django-reversion installed version.

The issues your are facing are pretty strange? Are you trying to upgrade from a pretty old version?

<!-- gh-comment-id:871357611 --> @tonioo commented on GitHub (Jun 30, 2021): I was talking about the django-reversion installed version. The issues your are facing are pretty strange? Are you trying to upgrade from a pretty old version?
Author
Owner

@optimdevel commented on GitHub (Jun 30, 2021):

I got 1.5.3 on Debian 8 to upgrade to recent version and it has proved not to be so easy.

Maybe I should just empty revisions table and make django regenerate it? I think I this can be done.

<!-- gh-comment-id:871364423 --> @optimdevel commented on GitHub (Jun 30, 2021): I got 1.5.3 on Debian 8 to upgrade to recent version and it has proved not to be so easy. Maybe I should just empty revisions table and make django regenerate it? I think I this can be done.
Author
Owner

@tonioo commented on GitHub (Jun 30, 2021):

If you want to do that, you can remove all reversion tables and also delete corresponding rows in the migrations table, otherwise tables won't be recreated.
And of course, you'll loose your audit trail history

<!-- gh-comment-id:871367953 --> @tonioo commented on GitHub (Jun 30, 2021): If you want to do that, you can remove all reversion tables and also delete corresponding rows in the migrations table, otherwise tables won't be recreated. And of course, you'll loose your audit trail history
Author
Owner

@optimdevel commented on GitHub (Jun 30, 2021):

I tried emptying it with django. What a fail:

(env) modoboa@mail3:~/instance$ python manage.py deleterevisions
Finding stale revisions for user
Finding stale revisions for alarm
Finding stale revisions for domain
Finding stale revisions for mailbox
Finding stale revisions for sender address
Finding stale revisions for alias
Finding stale revisions for domain alias
Finding stale revisions for transport
Traceback (most recent call last):
File "/srv/modoboa/env/lib/python3.7/site-packages/django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
File "/srv/modoboa/env/lib/python3.7/site-packages/django/db/backends/mysql/base.py", line 71, in execute
return self.cursor.execute(query, args)
File "/srv/modoboa/env/lib/python3.7/site-packages/MySQLdb/cursors.py", line 206, in execute
res = self._query(query)
File "/srv/modoboa/env/lib/python3.7/site-packages/MySQLdb/cursors.py", line 319, in _query
db.query(q)
File "/srv/modoboa/env/lib/python3.7/site-packages/MySQLdb/connections.py", line 259, in query
_mysql.connection.query(self, query)
MySQLdb._exceptions.OperationalError: (1054, "Unknown column 'U0.db' in 'where clause'")

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

Traceback (most recent call last):
File "manage.py", line 21, in
main()
File "manage.py", line 17, in main
execute_from_command_line(sys.argv)
File "/srv/modoboa/env/lib/python3.7/site-packages/django/core/management/init.py", line 381, in execute_from_command_line
utility.execute()
File "/srv/modoboa/env/lib/python3.7/site-packages/django/core/management/init.py", line 375, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/srv/modoboa/env/lib/python3.7/site-packages/django/core/management/base.py", line 323, in run_from_argv
self.execute(*args, **cmd_options)
File "/srv/modoboa/env/lib/python3.7/site-packages/django/core/management/base.py", line 364, in execute
output = self.handle(*args, **options)
File "/srv/modoboa/env/lib/python3.7/site-packages/reversion/management/commands/deleterevisions.py", line 92, in handle
total=revisions_to_delete.count(),
File "/srv/modoboa/env/lib/python3.7/site-packages/django/db/models/query.py", line 392, in count
return self.query.get_count(using=self.db)
File "/srv/modoboa/env/lib/python3.7/site-packages/django/db/models/sql/query.py", line 504, in get_count
number = obj.get_aggregation(using, ['__count'])['__count']
File "/srv/modoboa/env/lib/python3.7/site-packages/django/db/models/sql/query.py", line 489, in get_aggregation
result = compiler.execute_sql(SINGLE)
File "/srv/modoboa/env/lib/python3.7/site-packages/django/db/models/sql/compiler.py", line 1142, in execute_sql
cursor.execute(sql, params)
File "/srv/modoboa/env/lib/python3.7/site-packages/django/db/backends/utils.py", line 99, in execute
return super().execute(sql, params)
File "/srv/modoboa/env/lib/python3.7/site-packages/django/db/backends/utils.py", line 67, in execute
return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
File "/srv/modoboa/env/lib/python3.7/site-packages/django/db/backends/utils.py", line 76, in _execute_with_wrappers
return executor(sql, params, many, context)
File "/srv/modoboa/env/lib/python3.7/site-packages/django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
File "/srv/modoboa/env/lib/python3.7/site-packages/django/db/utils.py", line 89, in exit
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/srv/modoboa/env/lib/python3.7/site-packages/django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
File "/srv/modoboa/env/lib/python3.7/site-packages/django/db/backends/mysql/base.py", line 71, in execute
return self.cursor.execute(query, args)
File "/srv/modoboa/env/lib/python3.7/site-packages/MySQLdb/cursors.py", line 206, in execute
res = self._query(query)
File "/srv/modoboa/env/lib/python3.7/site-packages/MySQLdb/cursors.py", line 319, in _query
db.query(q)
File "/srv/modoboa/env/lib/python3.7/site-packages/MySQLdb/connections.py", line 259, in query
_mysql.connection.query(self, query)
django.db.utils.OperationalError: (1054, "Unknown column 'U0.db' in 'where clause'")

<!-- gh-comment-id:871379163 --> @optimdevel commented on GitHub (Jun 30, 2021): I tried emptying it with django. What a fail: (env) modoboa@mail3:~/instance$ python manage.py deleterevisions Finding stale revisions for user Finding stale revisions for alarm Finding stale revisions for domain Finding stale revisions for mailbox Finding stale revisions for sender address Finding stale revisions for alias Finding stale revisions for domain alias Finding stale revisions for transport Traceback (most recent call last): File "/srv/modoboa/env/lib/python3.7/site-packages/django/db/backends/utils.py", line 84, in _execute return self.cursor.execute(sql, params) File "/srv/modoboa/env/lib/python3.7/site-packages/django/db/backends/mysql/base.py", line 71, in execute return self.cursor.execute(query, args) File "/srv/modoboa/env/lib/python3.7/site-packages/MySQLdb/cursors.py", line 206, in execute res = self._query(query) File "/srv/modoboa/env/lib/python3.7/site-packages/MySQLdb/cursors.py", line 319, in _query db.query(q) File "/srv/modoboa/env/lib/python3.7/site-packages/MySQLdb/connections.py", line 259, in query _mysql.connection.query(self, query) MySQLdb._exceptions.OperationalError: (1054, "Unknown column 'U0.db' in 'where clause'") The above exception was the direct cause of the following exception: Traceback (most recent call last): File "manage.py", line 21, in <module> main() File "manage.py", line 17, in main execute_from_command_line(sys.argv) File "/srv/modoboa/env/lib/python3.7/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line utility.execute() File "/srv/modoboa/env/lib/python3.7/site-packages/django/core/management/__init__.py", line 375, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/srv/modoboa/env/lib/python3.7/site-packages/django/core/management/base.py", line 323, in run_from_argv self.execute(*args, **cmd_options) File "/srv/modoboa/env/lib/python3.7/site-packages/django/core/management/base.py", line 364, in execute output = self.handle(*args, **options) File "/srv/modoboa/env/lib/python3.7/site-packages/reversion/management/commands/deleterevisions.py", line 92, in handle total=revisions_to_delete.count(), File "/srv/modoboa/env/lib/python3.7/site-packages/django/db/models/query.py", line 392, in count return self.query.get_count(using=self.db) File "/srv/modoboa/env/lib/python3.7/site-packages/django/db/models/sql/query.py", line 504, in get_count number = obj.get_aggregation(using, ['__count'])['__count'] File "/srv/modoboa/env/lib/python3.7/site-packages/django/db/models/sql/query.py", line 489, in get_aggregation result = compiler.execute_sql(SINGLE) File "/srv/modoboa/env/lib/python3.7/site-packages/django/db/models/sql/compiler.py", line 1142, in execute_sql cursor.execute(sql, params) File "/srv/modoboa/env/lib/python3.7/site-packages/django/db/backends/utils.py", line 99, in execute return super().execute(sql, params) File "/srv/modoboa/env/lib/python3.7/site-packages/django/db/backends/utils.py", line 67, in execute return self._execute_with_wrappers(sql, params, many=False, executor=self._execute) File "/srv/modoboa/env/lib/python3.7/site-packages/django/db/backends/utils.py", line 76, in _execute_with_wrappers return executor(sql, params, many, context) File "/srv/modoboa/env/lib/python3.7/site-packages/django/db/backends/utils.py", line 84, in _execute return self.cursor.execute(sql, params) File "/srv/modoboa/env/lib/python3.7/site-packages/django/db/utils.py", line 89, in __exit__ raise dj_exc_value.with_traceback(traceback) from exc_value File "/srv/modoboa/env/lib/python3.7/site-packages/django/db/backends/utils.py", line 84, in _execute return self.cursor.execute(sql, params) File "/srv/modoboa/env/lib/python3.7/site-packages/django/db/backends/mysql/base.py", line 71, in execute return self.cursor.execute(query, args) File "/srv/modoboa/env/lib/python3.7/site-packages/MySQLdb/cursors.py", line 206, in execute res = self._query(query) File "/srv/modoboa/env/lib/python3.7/site-packages/MySQLdb/cursors.py", line 319, in _query db.query(q) File "/srv/modoboa/env/lib/python3.7/site-packages/MySQLdb/connections.py", line 259, in query _mysql.connection.query(self, query) django.db.utils.OperationalError: (1054, "Unknown column 'U0.db' in 'where clause'")
Author
Owner

@tonioo commented on GitHub (Jun 30, 2021):

I suggest you drop tables and corresponding rows in the migration table directly from mariadb if you know a bit of SQL

<!-- gh-comment-id:871380846 --> @tonioo commented on GitHub (Jun 30, 2021): I suggest you drop tables and corresponding rows in the migration table directly from mariadb if you know a bit of SQL
Author
Owner

@optimdevel commented on GitHub (Jun 30, 2021):

Yeah, I could do that and I might have to.
In the mean time, please read you email. :-)

<!-- gh-comment-id:871381299 --> @optimdevel commented on GitHub (Jun 30, 2021): Yeah, I could do that and I might have to. In the mean time, please read you email. :-)
Author
Owner

@stale[bot] commented on GitHub (Aug 29, 2021):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

<!-- gh-comment-id:907819641 --> @stale[bot] commented on GitHub (Aug 29, 2021): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Author
Owner

@ilovefreesw commented on GitHub (Oct 5, 2021):

Got the same error....

image

<!-- gh-comment-id:934341775 --> @ilovefreesw commented on GitHub (Oct 5, 2021): Got the same error.... ![image](https://user-images.githubusercontent.com/77317006/136018126-807db075-60f6-44a5-bc7c-584e95b1d8ec.png)
Author
Owner

@marutichintan commented on GitHub (Feb 17, 2022):

i am getting the same 500 error. i have enable the debug and show me full error. error is "Error 111 connecting to localhost:6379. Connection refused."

modoboa is not able to connect redis.

my redis service is down.

service redis start

it working now.

<!-- gh-comment-id:1042874151 --> @marutichintan commented on GitHub (Feb 17, 2022): i am getting the same 500 error. i have enable the debug and show me full error. error is "Error 111 connecting to localhost:6379. Connection refused." modoboa is not able to connect redis. my redis service is down. service redis start it working now.
Author
Owner

@sacb2 commented on GitHub (Feb 12, 2025):

Hi (i know is a bit late for this ...sorry, but if someone arrive here on the future i want to share this) , i install this in a clean debian 11 and found two problems maybe can help you ... first of all i have the same problem as you when i use the mysql database i reintall using the postgress and all works well... but on the installation i found this

First ... the nginx fails because the creation of certs fail ... so i run this:
certbot certonly --standalone -d mail.example.com

and then i found the permission are not right on this socket so run this:

sudo chown www-data:www-data /run/uwsgi/app/modoboa_instance/socket
chmod 770 /run/uwsgi/app/modoboa_instance/socket

and finally i firts try to install this on a mysql database but i encounter a problem on the rout that create the users bur i reinstall it using the postgres database and the userrs run well :)

<!-- gh-comment-id:2652542582 --> @sacb2 commented on GitHub (Feb 12, 2025): Hi (i know is a bit late for this ...sorry, but if someone arrive here on the future i want to share this) , i install this in a clean debian 11 and found two problems maybe can help you ... first of all i have the same problem as you when i use the mysql database i reintall using the postgress and all works well... but on the installation i found this First ... the nginx fails because the creation of certs fail ... so i run this: certbot certonly --standalone -d mail.example.com and then i found the permission are not right on this socket so run this: sudo chown www-data:www-data /run/uwsgi/app/modoboa_instance/socket chmod 770 /run/uwsgi/app/modoboa_instance/socket and finally i firts try to install this on a mysql database but i encounter a problem on the rout that create the users bur i reinstall it using the postgres database and the userrs run well :)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/modoboa-modoboa#1566
No description provided.