[GH-ISSUE #3122] Error: Group matching query does not exist. when i try to create new mailbox simple user #1773

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

Originally created by @sherz12r on GitHub (Nov 22, 2023).
Original GitHub issue: https://github.com/modoboa/modoboa/issues/3122

Impacted versions

  • OS Type: Debian/Ubuntu, Centos/Redhat, Arch, Gentoo, Slack, ...
  • OS Version: Number or Name
  • Database Type: PostgreSQL / MySQL
  • Database version: X.y
  • Modoboa: X.X.x
  • installer used: Yes/No ?
  • Webserver: Nginx/Apache

Steps to reproduce

Current behavior

Request Method: POST
https://mail.mydomain.com/admin/accounts/new/
4.2.6
DoesNotExist at /admin/accounts/new/

Group matching query does not exist.
/srv/modoboa/env/lib/python3.8/site-packages/django/db/models/query.py, line 637, in get
modoboa.admin.views.identity.newaccount
/usr/bin/uwsgi-core
3.8.10

</html> </html> # Expected behavior

Video/Screenshot link (optional)

Capture

Originally created by @sherz12r on GitHub (Nov 22, 2023). Original GitHub issue: https://github.com/modoboa/modoboa/issues/3122 # Impacted versions * OS Type: Debian/Ubuntu, Centos/Redhat, Arch, Gentoo, Slack, ... * OS Version: Number or Name * Database Type: PostgreSQL / MySQL * Database version: X.y * Modoboa: X.X.x * installer used: Yes/No ? * Webserver: Nginx/Apache # Steps to reproduce # Current behavior Request Method: | POST -- | -- https://mail.mydomain.com/admin/accounts/new/ 4.2.6 DoesNotExist at /admin/accounts/new/ Group matching query does not exist. /srv/modoboa/env/lib/python3.8/site-packages/django/db/models/query.py, line 637, in get modoboa.admin.views.identity.newaccount /usr/bin/uwsgi-core 3.8.10 <!--EndFragment--> </body> </html> <!--EndFragment--> </body> </html> # Expected behavior # Video/Screenshot link (optional) ![Capture](https://github.com/modoboa/modoboa/assets/46225971/5e976bdd-9398-4837-bf71-fb61bb83a915)
kerem closed this issue 2026-02-27 11:19:02 +03:00
Author
Owner

@tonioo commented on GitHub (Nov 23, 2023):

@sherz12r How did you install modoboa?

<!-- gh-comment-id:1823948726 --> @tonioo commented on GitHub (Nov 23, 2023): @sherz12r How did you install modoboa?
Author
Owner

@sherz12r commented on GitHub (Nov 23, 2023):

@tonioo
i followed following steps to install modoboa on my vps
https://www.linuxbabe.com/mail-server/modoboa-email-server-ubuntu-20-04
but after istalation there was an internal server error so i followed follwod steps to correct it

sudo apt-get update
sudo apt-get install postgresql postgresql-contrib

Switch to the PostgreSQL User: Switch to the postgres user, the default superuser for PostgreSQL:

bashCopy code
sudo -i -u postgres

Create a Database: Create a new PostgreSQL database for Modoboa. Replace modoboa_db with your preferred database name:

bashCopy code
createdb modoboa_db

Create a Database User: Create a new PostgreSQL user for Modoboa. Replace modoboa_user and your_password with your preferred username and password:

bashCopy code
createuser --username=modoboa_user --password your_password

You will be prompted to enter the password for the new user.

Grant Privileges: Grant all privileges on the database to the newly created user:

bashCopy code
psql
GRANT ALL PRIVILEGES ON DATABASE modoboa_db TO modoboa_user;

Exit the PostgreSQL shell by typing \q.

Configure Modoboa Settings: Update your Modoboa configuration to use the database. Open the settings.py file, and locate the DATABASES section. Modify it with your database information:

pythonCopy code
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'modoboa_db',
'USER': 'modoboa_user',
'PASSWORD': 'your_password',
'HOST': 'localhost',
'PORT': '5432',
}
}

Save the changes.

Run Migrations: Run the Modoboa migrations to set up the database tables:

bashCopy code
python manage.py migrate

Create an Admin User: Create an administrative user for Modoboa:

bashCopy code
python manage.py createsuperuser

Follow the prompts to set up the admin user.

Collect Static Files: Collect static files required by Modoboa:

bashCopy code
python manage.py collectstatic

Restart Modoboa: Restart the Modoboa services to apply the changes:

bashCopy code
service modoboa restart

Now, Modoboa should be set up with the PostgreSQL database, and you can access the

and its running but i have error mentioned in issue
some steps to setup database and after running migration it worked but now i have above mentioned error

<!-- gh-comment-id:1824252564 --> @sherz12r commented on GitHub (Nov 23, 2023): @tonioo i followed following steps to install modoboa on my vps https://www.linuxbabe.com/mail-server/modoboa-email-server-ubuntu-20-04 but after istalation there was an internal server error so i followed follwod steps to correct it sudo apt-get update sudo apt-get install postgresql postgresql-contrib Switch to the PostgreSQL User: Switch to the postgres user, the default superuser for PostgreSQL: bashCopy code sudo -i -u postgres Create a Database: Create a new PostgreSQL database for Modoboa. Replace modoboa_db with your preferred database name: bashCopy code createdb modoboa_db Create a Database User: Create a new PostgreSQL user for Modoboa. Replace modoboa_user and your_password with your preferred username and password: bashCopy code createuser --username=modoboa_user --password your_password You will be prompted to enter the password for the new user. Grant Privileges: Grant all privileges on the database to the newly created user: bashCopy code psql GRANT ALL PRIVILEGES ON DATABASE modoboa_db TO modoboa_user; Exit the PostgreSQL shell by typing \q. Configure Modoboa Settings: Update your Modoboa configuration to use the database. Open the settings.py file, and locate the DATABASES section. Modify it with your database information: pythonCopy code DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql', 'NAME': 'modoboa_db', 'USER': 'modoboa_user', 'PASSWORD': 'your_password', 'HOST': 'localhost', 'PORT': '5432', } } Save the changes. Run Migrations: Run the Modoboa migrations to set up the database tables: bashCopy code python manage.py migrate Create an Admin User: Create an administrative user for Modoboa: bashCopy code python manage.py createsuperuser Follow the prompts to set up the admin user. Collect Static Files: Collect static files required by Modoboa: bashCopy code python manage.py collectstatic Restart Modoboa: Restart the Modoboa services to apply the changes: bashCopy code service modoboa restart Now, Modoboa should be set up with the PostgreSQL database, and you can access the and its running but i have error mentioned in issue some steps to setup database and after running migration it worked but now i have above mentioned error
Author
Owner

@sherz12r commented on GitHub (Nov 24, 2023):

@sherz12r How did you install modoboa?

please reply

<!-- gh-comment-id:1825442240 --> @sherz12r commented on GitHub (Nov 24, 2023): > @sherz12r How did you install modoboa? please reply
Author
Owner

@tonioo commented on GitHub (Nov 24, 2023):

@sherz12r Something went wrong during the install. Can you try to run the installer once again using the --debug option?

<!-- gh-comment-id:1825452101 --> @tonioo commented on GitHub (Nov 24, 2023): @sherz12r Something went wrong during the install. Can you try to run the installer once again using the --debug option?
Author
Owner

@sherz12r commented on GitHub (Nov 25, 2023):

@sherz12r Something went wrong during the install. Can you try to run the installer once again using the --debug option?

thanks i resolved by reinstalling and writing correct values in installer.cfg

<!-- gh-comment-id:1826302687 --> @sherz12r commented on GitHub (Nov 25, 2023): > @sherz12r Something went wrong during the install. Can you try to run the installer once again using the --debug option? thanks i resolved by reinstalling and writing correct values in installer.cfg
Author
Owner

@meh4i commented on GitHub (Jan 9, 2024):

@sherz12r I have the same problem could you help me with correct values in installer.cfg?
at first login i got error which fixed by running python manage.py migrate and then create django super user then i could login but i can not create new user because of the same error as you.

<!-- gh-comment-id:1882504558 --> @meh4i commented on GitHub (Jan 9, 2024): @sherz12r I have the same problem could you help me with correct values in installer.cfg? at first login i got error which fixed by running `python manage.py migrate` and then create django super user then i could login but i can not create new user because of the same error as you.
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#1773
No description provided.