[GH-ISSUE #1852] cannot delete a domain #1451

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

Originally created by @hadifarnoud on GitHub (Mar 3, 2020).
Original GitHub issue: https://github.com/modoboa/modoboa/issues/1852

Impacted versions

  • Modoboa: 1.14.0
  • installer used: Yes
  • Webserver: Nginx

Steps to reproduce

delete a domain

Current behavior

it says internal error

Expected behavior

should delete the domain and all its accounts/aliases

Video/Screenshot link (optional)

https://sentry.io/share/issue/29b88b7426fa478bb192cd1344951544/
'NoneType' object has no attribute 'is_superuser'

Originally created by @hadifarnoud on GitHub (Mar 3, 2020). Original GitHub issue: https://github.com/modoboa/modoboa/issues/1852 # Impacted versions * Modoboa: 1.14.0 * installer used: Yes * Webserver: Nginx # Steps to reproduce delete a domain # Current behavior it says internal error # Expected behavior should delete the domain and all its accounts/aliases # Video/Screenshot link (optional) https://sentry.io/share/issue/29b88b7426fa478bb192cd1344951544/ `'NoneType' object has no attribute 'is_superuser'`
kerem 2026-02-27 11:17:11 +03:00
Author
Owner

@tonioo commented on GitHub (Mar 4, 2020):

@hadifarnoud Can you try to run the following command:
python manage.py modo repair
And try to delete again after?

<!-- gh-comment-id:594428014 --> @tonioo commented on GitHub (Mar 4, 2020): @hadifarnoud Can you try to run the following command: ```python manage.py modo repair``` And try to delete again after?
Author
Owner

@hadifarnoud commented on GitHub (Mar 6, 2020):

I ran into this issue

Checking for... Sometime mailboxes have no alias....
Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
    utility.execute()
  File "/srv/modoboa/env/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 "/srv/modoboa/env/local/lib/python2.7/site-packages/subcommand/base.py", line 53, in run_from_argv
    return super(SubcommandCommand, self).run_from_argv(argv)
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/core/management/base.py", line 283, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/core/management/base.py", line 330, in execute
    output = self.handle(*args, **options)
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/subcommand/base.py", line 84, in handle
    return command.run_from_argv(argv)
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/core/management/base.py", line 283, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/core/management/base.py", line 330, in execute
    output = self.handle(*args, **options)
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/modoboa/admin/management/commands/subcommands/_repair.py", line 126, in handle
    func(**options)
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/modoboa/admin/management/commands/subcommands/_repair.py", line 88, in sometimes_mailbox_have_no_alias
    r_mailbox=instance)
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/models/manager.py", line 85, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/models/query.py", line 466, in get_or_create
    return self._create_object_from_params(lookup, params)
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/models/query.py", line 506, in _create_object_from_params
    six.reraise(*exc_info)
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/models/query.py", line 498, in _create_object_from_params
    obj = self.create(**params)
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/models/query.py", line 394, in create
    obj.save(force_insert=True, using=self.db)
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/models/base.py", line 808, in save
    force_update=force_update, update_fields=update_fields)
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/models/base.py", line 838, in save_base
    updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/models/base.py", line 924, in _save_table
    result = self._do_insert(cls._base_manager, using, fields, update_pk, raw)
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/models/base.py", line 963, in _do_insert
    using=using, raw=raw)
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/models/manager.py", line 85, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/models/query.py", line 1076, in _insert
    return query.get_compiler(using=using).execute_sql(return_id)
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 1112, in execute_sql
    cursor.execute(sql, params)
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/utils.py", line 94, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
django.db.utils.IntegrityError: duplicate key value violates unique constraint "modoboa_admin_aliasrecipient_alias_id_c005be7e_uniq"
DETAIL:  Key (alias_id, r_mailbox_id)=(482, 300) already exists.
<!-- gh-comment-id:595686488 --> @hadifarnoud commented on GitHub (Mar 6, 2020): I ran into this issue ``` Checking for... Sometime mailboxes have no alias.... Traceback (most recent call last): File "manage.py", line 10, in <module> execute_from_command_line(sys.argv) File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 364, in execute_from_command_line utility.execute() File "/srv/modoboa/env/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 "/srv/modoboa/env/local/lib/python2.7/site-packages/subcommand/base.py", line 53, in run_from_argv return super(SubcommandCommand, self).run_from_argv(argv) File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/core/management/base.py", line 283, in run_from_argv self.execute(*args, **cmd_options) File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/core/management/base.py", line 330, in execute output = self.handle(*args, **options) File "/srv/modoboa/env/local/lib/python2.7/site-packages/subcommand/base.py", line 84, in handle return command.run_from_argv(argv) File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/core/management/base.py", line 283, in run_from_argv self.execute(*args, **cmd_options) File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/core/management/base.py", line 330, in execute output = self.handle(*args, **options) File "/srv/modoboa/env/local/lib/python2.7/site-packages/modoboa/admin/management/commands/subcommands/_repair.py", line 126, in handle func(**options) File "/srv/modoboa/env/local/lib/python2.7/site-packages/modoboa/admin/management/commands/subcommands/_repair.py", line 88, in sometimes_mailbox_have_no_alias r_mailbox=instance) File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/models/manager.py", line 85, in manager_method return getattr(self.get_queryset(), name)(*args, **kwargs) File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/models/query.py", line 466, in get_or_create return self._create_object_from_params(lookup, params) File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/models/query.py", line 506, in _create_object_from_params six.reraise(*exc_info) File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/models/query.py", line 498, in _create_object_from_params obj = self.create(**params) File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/models/query.py", line 394, in create obj.save(force_insert=True, using=self.db) File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/models/base.py", line 808, in save force_update=force_update, update_fields=update_fields) File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/models/base.py", line 838, in save_base updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields) File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/models/base.py", line 924, in _save_table result = self._do_insert(cls._base_manager, using, fields, update_pk, raw) File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/models/base.py", line 963, in _do_insert using=using, raw=raw) File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/models/manager.py", line 85, in manager_method return getattr(self.get_queryset(), name)(*args, **kwargs) File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/models/query.py", line 1076, in _insert return query.get_compiler(using=using).execute_sql(return_id) File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 1112, in execute_sql cursor.execute(sql, params) File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute return self.cursor.execute(sql, params) File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/utils.py", line 94, in __exit__ six.reraise(dj_exc_type, dj_exc_value, traceback) File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute return self.cursor.execute(sql, params) django.db.utils.IntegrityError: duplicate key value violates unique constraint "modoboa_admin_aliasrecipient_alias_id_c005be7e_uniq" DETAIL: Key (alias_id, r_mailbox_id)=(482, 300) already exists. ```
Author
Owner

@tonioo commented on GitHub (Mar 9, 2020):

@hadifarnoud There is something strange in your database... could it be possible to have an access to your server?

<!-- gh-comment-id:596401100 --> @tonioo commented on GitHub (Mar 9, 2020): @hadifarnoud There is something strange in your database... could it be possible to have an access to your server?
Author
Owner

@hadifarnoud commented on GitHub (Mar 9, 2020):

of course. I need your email address.


http://camva.ir/

Hadi Farnoud / CEO
hadi@kamva.ir / +98 (0)920 301 7490

Kamva
+98 (0)21 2842 7490
https://kamva.ir

On Mon, 9 Mar 2020 at 12:16, Antoine Nguyen notifications@github.com
wrote:

@hadifarnoud https://github.com/hadifarnoud There is something strange
in your database... could it be possible to have an access to your server?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/modoboa/modoboa/issues/1852?email_source=notifications&email_token=AAEP74FML4VLFN24TG7Q45TRGSUHDA5CNFSM4LAHITPKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEOGFXTA#issuecomment-596401100,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAEP74FEQ3WYPWXBR4LTRK3RGSUHDANCNFSM4LAHITPA
.

<!-- gh-comment-id:596801539 --> @hadifarnoud commented on GitHub (Mar 9, 2020): of course. I need your email address. _______________________ <http://camva.ir/> Hadi *Farnoud* / CEO hadi@kamva.ir / +98 (0)920 301 7490 Kamva +98 (0)21 2842 7490 https://kamva.ir On Mon, 9 Mar 2020 at 12:16, Antoine Nguyen <notifications@github.com> wrote: > @hadifarnoud <https://github.com/hadifarnoud> There is something strange > in your database... could it be possible to have an access to your server? > > — > You are receiving this because you were mentioned. > Reply to this email directly, view it on GitHub > <https://github.com/modoboa/modoboa/issues/1852?email_source=notifications&email_token=AAEP74FML4VLFN24TG7Q45TRGSUHDA5CNFSM4LAHITPKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEOGFXTA#issuecomment-596401100>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/AAEP74FEQ3WYPWXBR4LTRK3RGSUHDANCNFSM4LAHITPA> > . >
Author
Owner

@tonioo commented on GitHub (Mar 11, 2020):

tonio@ngyn.org

<!-- gh-comment-id:597640261 --> @tonioo commented on GitHub (Mar 11, 2020): tonio@ngyn.org
Author
Owner

@hadifarnoud commented on GitHub (Apr 15, 2020):

Did you get my email Tonio?


http://camva.ir/

Hadi Farnoud / CEO
hadi@kamva.ir / +98 (0)920 301 7490

Kamva
+98 (0)21 2842 7490
https://kamva.ir

<!-- gh-comment-id:614200653 --> @hadifarnoud commented on GitHub (Apr 15, 2020): Did you get my email Tonio? -- _______________________ <http://camva.ir/> Hadi *Farnoud* / CEO hadi@kamva.ir / +98 (0)920 301 7490 Kamva +98 (0)21 2842 7490 https://kamva.ir
Author
Owner

@tonioo commented on GitHub (Oct 23, 2020):

@hadifarnoud Do you still encounter this issue?

<!-- gh-comment-id:715387170 --> @tonioo commented on GitHub (Oct 23, 2020): @hadifarnoud Do you still encounter this issue?
Author
Owner

@hadifarnoud commented on GitHub (Nov 8, 2020):

I was not able to update to latest version @tonioo. so, yes I still have this issue.

<!-- gh-comment-id:723565672 --> @hadifarnoud commented on GitHub (Nov 8, 2020): I was not able to update to latest version @tonioo. so, yes I still have this issue.
Author
Owner

@tonioo commented on GitHub (Nov 9, 2020):

@hadifarnoud Why are you not able to update?

<!-- gh-comment-id:724258838 --> @tonioo commented on GitHub (Nov 9, 2020): @hadifarnoud Why are you not able to update?
Author
Owner

@hadifarnoud commented on GitHub (Nov 10, 2020):

I just don't know anything about Python and I'm afraid I mess it up. this is a production server and hundreds of accounts are being used on it. I just can't risk it

<!-- gh-comment-id:724711467 --> @hadifarnoud commented on GitHub (Nov 10, 2020): I just don't know anything about Python and I'm afraid I mess it up. this is a production server and hundreds of accounts are being used on it. I just can't risk it
Author
Owner

@tonioo commented on GitHub (Nov 10, 2020):

@hadifarnoud I understand your doubts but in this case, why don't you order an upgrade service from the official website?

<!-- gh-comment-id:724765076 --> @tonioo commented on GitHub (Nov 10, 2020): @hadifarnoud I understand your doubts but in this case, why don't you order an upgrade service from the official website?
Author
Owner

@stale[bot] commented on GitHub (Jan 9, 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:757330125 --> @stale[bot] commented on GitHub (Jan 9, 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.
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#1451
No description provided.