1 (edited by arthurfabre 2012-02-06 02:25:35)

Topic: Internal server error

Hello,

First off I'd like to thank you for all the work that's got into making this a truly brilliant mail server!

Next, there are two typos in the documentation for installing the panel on RHEL:

Create addition columns in DBMail database: dbmail.

Note: It will create several new tables to store domain administrator accounts, create two new columns on table "dbmail.dbmail_users" to store user name and mail domain name.

# mysql -uroot -p
mysql> USE dbmail;
mysql> SOURCE /var/www/dbmailadmin/docs/samples/dbmail_additions.mysql;

I believe that it should read dbmail_addition.mysql and not additions

Create a global domain admin with password generated above:

# mysql -uroot -p


It should read mysql instead of ysql


After that I'm experiencing "an internal server error" as soon as I try to load the dbmailadmin page.

the error log says:

[Sun Feb 05 16:44:08 2012] [error] [client 89.158.211.253] mod_wsgi (pid=1371): Target WSGI script '/var/www/dbmailadmin/dbmailadmin.py' cannot be loaded as Python module.
[Sun Feb 05 16:44:08 2012] [error] [client 89.158.211.253] mod_wsgi (pid=1371): Exception occurred processing WSGI script '/var/www/dbmailadmin/dbmailadmin.py'.
[Sun Feb 05 16:44:08 2012] [error] [client 89.158.211.253] Traceback (most recent call last):
[Sun Feb 05 16:44:08 2012] [error] [client 89.158.211.253]   File "/var/www/dbmailadmin/dbmailadmin.py", line 8, in <module>
[Sun Feb 05 16:44:08 2012] [error] [client 89.158.211.253]     from libs import iredbase
[Sun Feb 05 16:44:08 2012] [error] [client 89.158.211.253]   File "/var/www/dbmailadmin/libs/iredbase.py", line 34, in <module>
[Sun Feb 05 16:44:08 2012] [error] [client 89.158.211.253]     webmaster = cfg.general.get('webmaster', 'root')
[Sun Feb 05 16:44:08 2012] [error] [client 89.158.211.253]   File "/usr/lib/python2.6/site-packages/web/utils.py", line 76, in __getattr__
[Sun Feb 05 16:44:08 2012] [error] [client 89.158.211.253]     raise AttributeError, k
[Sun Feb 05 16:44:08 2012] [error] [client 89.158.211.253] AttributeError: 'general'

Switching the owner of the dbmailadmin directory and all its files/subfolders to apache fixes the above error, and I'm able to login but all actions (such as creating a domain or a user) are met with an Internal server error. The actions are accomplished though as new users can log into roundcube.

The error log now shows on startup:

[Sun Feb 05 17:20:08 2012] [error] Exception KeyError: KeyError(139827866965984,) in <module 'threading' from '/usr/lib64/python2.6/threading.pyc'> ignored
[Sun Feb 05 17:20:08 2012] [warn] mod_wsgi: Compiled for Python/2.6.2.
[Sun Feb 05 17:20:08 2012] [warn] mod_wsgi: Runtime using Python/2.6.6.

I appear to be experiencing a problem due to my python installation, but I keep encountering problem after problem. A quick google search returned this instructing me to recompile mod_wsgi. But I can't get it to compile and get yet another error. Apparently the error is related to my version of python installed and I should reinstall it, but I'm having a hard time finding out which version I should reinstall...

If anyone has any ideas (aside for switching over to Fedora), they would be much appreciated
Thanks!

Arthur

Centos 6.2 x64

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Internal server error

arthurfabre wrote:

I believe that it should read dbmail_addition.mysql and not additions

Fixed.

arthurfabre wrote:

It should read mysql instead of ysql

Sorry, could you tell me where it is? I cannot find it.

arthurfabre wrote:

[Sun Feb 05 16:44:08 2012] [error] [client 89.158.211.253] AttributeError: 'general'

This error means you don't have correct file owner or permission on DBMailAdmin config file, settings.ini.
It must be owned by user 'dbmailadmin', group 'dbmailadmin', and permission '0400'. If 0400 doesn't work for you, try 0750 instead.

So, please switch the owner of DBMailAdmin directory to the original one (dbmailadmin:dbmailadmin), and try again.

It's not related to Python or mod_wsgi, both of them should be fine.

3

Re: Internal server error

Thanks for the quick reply.

I've finally got the permissions working with the dbmailadmin user, and I'm now receiving the error logs by mail for the internal server error I get when adding a domain (or user).

Here it is:

Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/web/application.py", line 237, in process
    return self.handle()
  File "/usr/lib/python2.6/site-packages/web/application.py", line 228, in handle
    return self._delegate(fn, self.fvars, args)
  File "/usr/lib/python2.6/site-packages/web/application.py", line 409, in _delegate
    return handle_class(cls)
  File "/usr/lib/python2.6/site-packages/web/application.py", line 385, in handle_class
    return tocall(*args)
  File "/var/www/dbmailadmin/libs/dbmail_mysql/decorators.py", line 14, in proxyfunc
    return func(self, *args, **kw)
  File "/var/www/dbmailadmin/controllers/dbmail_mysql/domain.py", line 157, in GET
    msg=i.get('msg'),
  File "/var/www/dbmailadmin/libs/iredbase.py", line 195, in render_template
    return jinja_env.get_template(template_name).render(context)
  File "/usr/lib64/python2.6/site-packages/jinja2/environment.py", line 669, in render
    return self.environment.handle_exception(exc_info, True)
  File "/var/www/dbmailadmin/libs/../templates/default/dbmail_mysql/domain/profile.html", line 25, in top-level template code
    {% from "macros/policyd.html" import
  File "/usr/lib64/python2.6/site-packages/jinja2/loaders.py", line 161, in get_source
    raise TemplateNotFound(template)
TemplateNotFound: macros/policyd.html

Thanks a lot for all your help!

Oh and I can't seem to find the ysql typo either, I must be off my meds...

4

Re: Internal server error

arthurfabre wrote:

TemplateNotFound: macros/policyd.html

Looks like you enabled Policyd integration in config file 'settings.ini'. It's not yet support in DBMailAdmin, please disable it then try again. And disable Amavisd integration also.

DBMailAdmin is an iRedAdmin-Pro fork, they share most of Python/CSS/HTML/JavaScript source code, and iRedAdmin-Pro supports Policyd-1.8 and Amavisd-new integration.

5

Re: Internal server error

Thanks for the reply!

Policyd enabled is set to false so unless there's a way to override that option then it's not enabled.
Also enabling it results in an Apache Internal Server error (as in the apache error page with the footer and email and all) when accessing any page.
Here, I get a different Internal Server error, just a blank page with "internal server error" in the top left corner. Also this error doesn't appear in error_log.

Thanks a lot,
Arthur

6

Re: Internal server error

I found there's something wrong in template files, could you please try this patch:

1) Download the patch:

# cd /root
# wget --no-check-certificate -O templates.patch 'https://bitbucket.org/zhb/dbmailadmin/changeset/d05fab773893/raw/'

2) Try patching it with '--dry-run':

# cd /var/www/DBMailAdmin-MySQL-1.0/
# patch -p1 --dry-run < /root/templates.patch
patching file ChangeLog.dbmail_mysql
patching file templates/default/dbmail_mysql/domain/profile.html
patching file templates/default/dbmail_mysql/user/profile.html

3) If you got same output, it's safe to apply it immediately (without '--dry-run'):

# cd /var/www/DBMailAdmin-MySQL-1.0/
# patch -p1 < /root/templates.patch

Then restart Apache web server and try accessing DBMailAdmin again.

7

Re: Internal server error

That seems to have fixed it thanks a lot!

The patching did fail for the changelog file though (I applied it though as that file is pretty much useless).

Here's the output:

[root@fr DBMailAdmin-MySQL-1.0]# patch -p1 --dry-run < /root/templates.patch
patching file ChangeLog.dbmail_mysql
Hunk #1 FAILED at 1.
1 out of 1 hunk FAILED -- saving rejects to file ChangeLog.dbmail_mysql.rej
patching file templates/default/dbmail_mysql/domain/profile.html
patching file templates/default/dbmail_mysql/user/profile.html

Thanks,

Arthur

8

Re: Internal server error

Glad to hear that, so it's working well for you now?
It's fine to ignore file ChangeLog.

9

Re: Internal server error

Yes, everything's working perfectly well!

Thanks a lot for all the invaluable help you supplied!

Arthur

10

Re: Internal server error

Thanks for your feedback, and don't forget to tell your friends this wonderful admin panel. smile

11

Re: Internal server error

Will do - you should expect a small donation too smile

12

Re: Internal server error

arthurfabre wrote:

Will do - you should expect a small donation too smile

Will public donation button soon. smile