[GH-ISSUE #768] Cannot create users on a fresh install #691

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

Originally created by @Fulviuus on GitHub (Oct 25, 2015).
Original GitHub issue: https://github.com/modoboa/modoboa/issues/768

I have installed Modoboa using the latest automated installer on two different VPS, one running Ubuntu 14.04 and also a Debian 8.1.
The install runs fine, I add a domain on the webadmin, but when I try to create a mail user and click Submit I get a 500 server error.
I have tried checking the logs, but I see nothing in either /var/log/nginx/error.log or the modoboa specific one.
Any help to debug the issue would be really appreciated, is there a Linux distro where the software is known to run without problems?

Originally created by @Fulviuus on GitHub (Oct 25, 2015). Original GitHub issue: https://github.com/modoboa/modoboa/issues/768 I have installed Modoboa using the latest automated installer on two different VPS, one running Ubuntu 14.04 and also a Debian 8.1. The install runs fine, I add a domain on the webadmin, but when I try to create a mail user and click Submit I get a 500 server error. I have tried checking the logs, but I see nothing in either /var/log/nginx/error.log or the modoboa specific one. Any help to debug the issue would be really appreciated, is there a Linux distro where the software is known to run without problems?
kerem closed this issue 2026-02-27 11:13:04 +03:00
Author
Owner

@tonioo commented on GitHub (Oct 25, 2015):

Set DEBUG to True inside settings.py and open a javascript console (firebug or similar), you should have more information.

<!-- gh-comment-id:150936492 --> @tonioo commented on GitHub (Oct 25, 2015): Set DEBUG to True inside settings.py and open a javascript console (firebug or similar), you should have more information.
Author
Owner

@piwats commented on GitHub (Oct 25, 2015):

Is there an uwsgi log somewhere, too?

<!-- gh-comment-id:150936511 --> @piwats commented on GitHub (Oct 25, 2015): Is there an uwsgi log somewhere, too?
Author
Owner

@Fulviuus commented on GitHub (Oct 25, 2015):

Thanks for the quick reply!
This is what I got:

OSError at /admin/accounts/new/
[Errno 2] No such file or directory: '/var/lib/modoboa/pdf_crendentials'

Request Method: POST
Request URL: https://columbia.venturelli.net/admin/accounts/new/
Django Version: 1.7.10
Python Executable: /usr/bin/uwsgi-core
Python Version: 2.7.6
Python Path: ['.', '', '/srv/modoboa/env/lib/python2.7', '/srv/modoboa/env/lib/python2.7/plat-x86_64-linux-gnu', '/srv/modoboa/env/lib/python2.7/lib-tk', '/srv/modoboa/env/lib/python2.7/lib-old', '/srv/modoboa/env/lib/python2.7/lib-dynload', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/srv/modoboa/env/local/lib/python2.7/site-packages']
Server time: Sun, 25 Oct 2015 16:51:19 +0100
Installed Applications:
('django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.sites',
 'django.contrib.staticfiles',
 'reversion',
 'modoboa',
 'modoboa.core',
 'modoboa.lib',
 'modoboa_admin',
 'modoboa_admin_relaydomains',
 'modoboa_admin_limits',
 'modoboa_amavis',
 'modoboa_pdfcredentials',
 'modoboa_postfix_autoreply',
 'modoboa_sievefilters',
 'modoboa_stats',
 'modoboa_webmail')
Installed Middleware:
('x_forwarded_for.middleware.XForwardedForMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.locale.LocaleMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware',
 'modoboa.lib.middleware.AjaxLoginRedirect',
 'modoboa.lib.middleware.CommonExceptionCatcher',
 'modoboa.lib.middleware.RequestCatcherMiddleware')

Traceback:
File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
  111.                     response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/transaction.py" in inner
  394.                 return func(*args, **kwargs)
File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/transaction.py" in inner
  394.                 return func(*args, **kwargs)
File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/contrib/auth/decorators.py" in _wrapped_view
  21.                 return view_func(request, *args, **kwargs)
File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/contrib/auth/decorators.py" in _wrapped_view
  21.                 return view_func(request, *args, **kwargs)
File "/srv/modoboa/env/local/lib/python2.7/site-packages/reversion/revisions.py" in do_revision_context
  297.                 return func(*args, **kwargs)
File "/srv/modoboa/env/local/lib/python2.7/site-packages/modoboa_admin/views/identity.py" in newaccount
  167.     return AccountWizard(request).process()
File "/srv/modoboa/env/local/lib/python2.7/site-packages/modoboa/lib/form_utils.py" in process
  172.                 return self.next_step()
File "/srv/modoboa/env/local/lib/python2.7/site-packages/modoboa/lib/form_utils.py" in next_step
  157.             return self.done()
File "/srv/modoboa/env/local/lib/python2.7/site-packages/modoboa_admin/forms/account.py" in done
  508.         account = self.first_step.form.save()
File "/srv/modoboa/env/local/lib/python2.7/site-packages/modoboa_admin/forms/account.py" in save
  160.                 account.set_password(self.cleaned_data["password1"])
File "/srv/modoboa/env/local/lib/python2.7/site-packages/modoboa/core/models.py" in set_password
  148.             "PasswordUpdated", self, raw_value, self.pk is None
File "/srv/modoboa/env/local/lib/python2.7/site-packages/modoboa/lib/events.py" in raiseEvent
  90.         callback(*args, **kwargs)
File "/srv/modoboa/env/local/lib/python2.7/site-packages/modoboa_pdfcredentials/modo_extension.py" in password_updated
  38.     init_storage_dir()
File "/srv/modoboa/env/local/lib/python2.7/site-packages/modoboa_pdfcredentials/lib.py" in init_storage_dir
  22.         os.mkdir(storage_dir)

Seems like the /var/lib/modoboa directory is not there at all.

<!-- gh-comment-id:150937065 --> @Fulviuus commented on GitHub (Oct 25, 2015): Thanks for the quick reply! This is what I got: ``` OSError at /admin/accounts/new/ [Errno 2] No such file or directory: '/var/lib/modoboa/pdf_crendentials' Request Method: POST Request URL: https://columbia.venturelli.net/admin/accounts/new/ Django Version: 1.7.10 Python Executable: /usr/bin/uwsgi-core Python Version: 2.7.6 Python Path: ['.', '', '/srv/modoboa/env/lib/python2.7', '/srv/modoboa/env/lib/python2.7/plat-x86_64-linux-gnu', '/srv/modoboa/env/lib/python2.7/lib-tk', '/srv/modoboa/env/lib/python2.7/lib-old', '/srv/modoboa/env/lib/python2.7/lib-dynload', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/srv/modoboa/env/local/lib/python2.7/site-packages'] Server time: Sun, 25 Oct 2015 16:51:19 +0100 Installed Applications: ('django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.sites', 'django.contrib.staticfiles', 'reversion', 'modoboa', 'modoboa.core', 'modoboa.lib', 'modoboa_admin', 'modoboa_admin_relaydomains', 'modoboa_admin_limits', 'modoboa_amavis', 'modoboa_pdfcredentials', 'modoboa_postfix_autoreply', 'modoboa_sievefilters', 'modoboa_stats', 'modoboa_webmail') Installed Middleware: ('x_forwarded_for.middleware.XForwardedForMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.locale.LocaleMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'modoboa.lib.middleware.AjaxLoginRedirect', 'modoboa.lib.middleware.CommonExceptionCatcher', 'modoboa.lib.middleware.RequestCatcherMiddleware') Traceback: File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response 111. response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/transaction.py" in inner 394. return func(*args, **kwargs) File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/transaction.py" in inner 394. return func(*args, **kwargs) File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/contrib/auth/decorators.py" in _wrapped_view 21. return view_func(request, *args, **kwargs) File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/contrib/auth/decorators.py" in _wrapped_view 21. return view_func(request, *args, **kwargs) File "/srv/modoboa/env/local/lib/python2.7/site-packages/reversion/revisions.py" in do_revision_context 297. return func(*args, **kwargs) File "/srv/modoboa/env/local/lib/python2.7/site-packages/modoboa_admin/views/identity.py" in newaccount 167. return AccountWizard(request).process() File "/srv/modoboa/env/local/lib/python2.7/site-packages/modoboa/lib/form_utils.py" in process 172. return self.next_step() File "/srv/modoboa/env/local/lib/python2.7/site-packages/modoboa/lib/form_utils.py" in next_step 157. return self.done() File "/srv/modoboa/env/local/lib/python2.7/site-packages/modoboa_admin/forms/account.py" in done 508. account = self.first_step.form.save() File "/srv/modoboa/env/local/lib/python2.7/site-packages/modoboa_admin/forms/account.py" in save 160. account.set_password(self.cleaned_data["password1"]) File "/srv/modoboa/env/local/lib/python2.7/site-packages/modoboa/core/models.py" in set_password 148. "PasswordUpdated", self, raw_value, self.pk is None File "/srv/modoboa/env/local/lib/python2.7/site-packages/modoboa/lib/events.py" in raiseEvent 90. callback(*args, **kwargs) File "/srv/modoboa/env/local/lib/python2.7/site-packages/modoboa_pdfcredentials/modo_extension.py" in password_updated 38. init_storage_dir() File "/srv/modoboa/env/local/lib/python2.7/site-packages/modoboa_pdfcredentials/lib.py" in init_storage_dir 22. os.mkdir(storage_dir) ``` Seems like the /var/lib/modoboa directory is not there at all.
Author
Owner

@Fulviuus commented on GitHub (Oct 25, 2015):

Also got another error when clicking the "admin" user:

Exception Type: RelatedObjectDoesNotExist at /admin/accounts/edit/1/
Exception Value: User has no mailbox.
Request information:
GET:
active_tab = u'default'

POST: No POST data

FILES: No FILES data
<!-- gh-comment-id:150937800 --> @Fulviuus commented on GitHub (Oct 25, 2015): Also got another error when clicking the "admin" user: ``` Exception Type: RelatedObjectDoesNotExist at /admin/accounts/edit/1/ Exception Value: User has no mailbox. Request information: GET: active_tab = u'default' POST: No POST data FILES: No FILES data ```
Author
Owner

@tonioo commented on GitHub (Oct 25, 2015):

We have two different issues here:

  1. Some steps of the installer failed. The directory to store PDF files should not be inside /var/lib/modoboa but inside /srv/modoboa. Could you try to run the installer once again with the --debug option ? It tries to modify modoboa settings using raw SQL queries. One of them seems to fail...
  2. The second problem you encounter looks like a bug. I can reproduce it the official demo it seems to be located in the autoreply extension.
<!-- gh-comment-id:150968446 --> @tonioo commented on GitHub (Oct 25, 2015): We have two different issues here: 1. Some steps of the installer failed. The directory to store PDF files should not be inside /var/lib/modoboa but inside /srv/modoboa. Could you try to run the installer once again with the --debug option ? It tries to modify modoboa settings using raw SQL queries. One of them seems to fail... 2. The second problem you encounter looks like a bug. I can reproduce it the official demo it seems to be located in the autoreply extension.
Author
Owner

@Fulviuus commented on GitHub (Oct 25, 2015):

Ok, this is the full log of the install, with the --debug flag enabled:

http://pastebin.com/72UM83B7

Unfortunately it does not seem to log SQL queries + execution result, so I am unable to see what is wrong with it. the only weird thing that I can see is this, right at the bottom:

 * Starting PostgreSQL 9.3 database server                                                                           [ OK ]
CREATE FUNCTION
NOTICE:  trigger "mergequota" for table "admin_quota" does not exist, skipping
DROP TRIGGER
CREATE TRIGGER

By the way, I see the directory pdfcredentials inside /srv/modoboa, but it is called 'pdfcredentials' (not pdf_credentials) and it's empty.

<!-- gh-comment-id:150976247 --> @Fulviuus commented on GitHub (Oct 25, 2015): Ok, this is the full log of the install, with the --debug flag enabled: http://pastebin.com/72UM83B7 Unfortunately it does not seem to log SQL queries + execution result, so I am unable to see what is wrong with it. the only weird thing that I can see is this, right at the bottom: ``` * Starting PostgreSQL 9.3 database server [ OK ] CREATE FUNCTION NOTICE: trigger "mergequota" for table "admin_quota" does not exist, skipping DROP TRIGGER CREATE TRIGGER ``` By the way, I see the directory pdfcredentials inside /srv/modoboa, but it is called 'pdfcredentials' (not pdf_credentials) and it's empty.
Author
Owner

@tonioo commented on GitHub (Oct 26, 2015):

Ok. I've fixed the issue with the installer so modoboa settings will be applied properly. Now I need to fix the admin bug.

<!-- gh-comment-id:151048472 --> @tonioo commented on GitHub (Oct 26, 2015): Ok. I've fixed the issue with the installer so modoboa settings will be applied properly. Now I need to fix the admin bug.
Author
Owner

@tonioo commented on GitHub (Oct 31, 2015):

I've opened a specific issue for the admin bug: https://github.com/modoboa/modoboa-postfix-autoreply/issues/20.

I close this one.

<!-- gh-comment-id:152738443 --> @tonioo commented on GitHub (Oct 31, 2015): I've opened a specific issue for the admin bug: https://github.com/modoboa/modoboa-postfix-autoreply/issues/20. I close this one.
Author
Owner

@schneidermayer commented on GitHub (Apr 13, 2017):

Got the same issue, fixed it by setting proper permissions for the webserver user www-data on a) the modoboa instance and b) the wsgi lock file:

Use this if you have Nginx with uWSGI:
chmod -R 774 /run/uwsgi/app/
chown -R modoboa:www-data /run/uwsgi/

Use this if you have Apache with mod_wsgi:
chmod -R 774 /var/run/apache2/
chown -R modoboa:www-data /var/run/apache2/

Finally, set permission on those folder, just in case:
chown -R modoboa:www-data /srv/modoboa

Check syslog and apache2 access+error logs and always restart the webserver. If you use nginx don't forget to restart uwsgi seperately!

Caution, the chown is way too lose. If it works you may wanna specify it in detail.

<!-- gh-comment-id:294000886 --> @schneidermayer commented on GitHub (Apr 13, 2017): Got the same issue, fixed it by setting proper permissions for the webserver user `www-data` on a) **the modoboa instance** and b) **the wsgi lock file**: Use this if you have Nginx with uWSGI: `chmod -R 774 /run/uwsgi/app/` `chown -R modoboa:www-data /run/uwsgi/` Use this if you have Apache with mod_wsgi: `chmod -R 774 /var/run/apache2/` `chown -R modoboa:www-data /var/run/apache2/` Finally, set permission on those folder, just in case: `chown -R modoboa:www-data /srv/modoboa` Check syslog **and** apache2 access+error logs and always restart the webserver. If you use nginx don't forget to restart uwsgi seperately! Caution, the chown is way too lose. If it works you may wanna specify it in detail.
Author
Owner

@kisst commented on GitHub (Mar 16, 2022):

Just run into this on a fresh install. ( debian 11 hence on --beta due to the deprecated decodestring in 3.9 feedparser dependency in latest stable )

<!-- gh-comment-id:1069077865 --> @kisst commented on GitHub (Mar 16, 2022): Just run into this on a fresh install. ( debian 11 hence on --beta due to the deprecated decodestring in 3.9 feedparser dependency in latest stable )
Author
Owner

@kisst commented on GitHub (Mar 16, 2022):

https://github.com/modoboa/modoboa-pdfcredentials/blob/master/modoboa_pdfcredentials/forms.py#L25 still points to the folder which does not exist.

<!-- gh-comment-id:1069097678 --> @kisst commented on GitHub (Mar 16, 2022): https://github.com/modoboa/modoboa-pdfcredentials/blob/master/modoboa_pdfcredentials/forms.py#L25 still points to the folder which does not exist.
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#691
No description provided.