1

Topic: Cannot login into iRedAdmin after upgrade from 0.87 to 0.9

============ Required information ====
- iRedMail version: 0.9.0
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): LDAP
- Linux/BSD distribution name and version: Debian 7.8
- Related log if you're reporting an issue: /var/log/apache2/error.log
====

Hi guys,

I recently updated iRedMail from version 0.87 to 0.9 with the provided guide http://www.iredmail.org/docs/upgrade.ir … 0.9.0.html

Everything seems to be working fine, except for the fact that I cannot login into iRedAdmin anymore.
The login screen shows up, but after I login with my postmaster credentials it just shows a blank page with "internal server error".

After a look into the error.log from Apache2 it seems like some Python script isn't working properly. I get the following error message:

Traceback (most recent call last):
   File "/usr/lib/python2.7/dist-packages/web/application.py", line 239, in process
    return self.handle()
   File "/usr/lib/python2.7/dist-packages/web/application.py", line 230, in handle
     return self._delegate(fn, self.fvars, args)
   File "/usr/lib/python2.7/dist-packages/web/application.py", line 420, in _delegate
     return handle_class(cls)
   File "/usr/lib/python2.7/dist-packages/web/application.py", line 396, in handle_class
     return tocall(*args)
   File "/usr/share/apache2/iredadmin/controllers/ldap/basic.py", line 77, in POST
     dn_user = ldaputils.convert_keyword_to_dn(username, account_type='user')
 TypeError: convert_keyword_to_dn() got an unexpected keyword argument 'account_type'

Can you tell me what went wrong?

----

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

2

Re: Cannot login into iRedAdmin after upgrade from 0.87 to 0.9

May i know the version number of iRedAdmin? Show me output of command:

# ls -l /usr/share/apache2/

3

Re: Cannot login into iRedAdmin after upgrade from 0.87 to 0.9

Please try this patch for iRedAdmin-0.4.1:

diff -r a03d404fadcc controllers/ldap/basic.py
--- a/controllers/ldap/basic.py    Mon Jan 12 19:14:49 2015 +0800
+++ b/controllers/ldap/basic.py    Tue Jan 13 21:01:40 2015 +0800
@@ -74,13 +74,13 @@
             raise web.seeother('/login?msg=%s' % web.safestr(e))
 
         # Check whether it's a mail user
-        dn_user = ldaputils.convert_keyword_to_dn(username, account_type='user')
+        dn_user = ldaputils.convert_keyword_to_dn(username, accountType='user')
         qr_user_auth = auth.Auth(dn=dn_user, password=password)
 
         qr_admin_auth = (False, 'INVALID_CREDENTIALS')
         if not qr_user_auth[0]:
             # Verify admin account under 'o=domainAdmins'.
-            dn_admin = ldaputils.convert_keyword_to_dn(username, account_type='admin')
+            dn_admin = ldaputils.convert_keyword_to_dn(username, accountType='admin')
             qr_admin_auth = auth.Auth(dn=dn_admin, password=password)
 
             if not qr_admin_auth[0]:

4

Re: Cannot login into iRedAdmin after upgrade from 0.87 to 0.9

It was in fact iRedAdmin 0.41.

I applied the patch you provided, but I still get the same "internal server error" message, when I try to login.

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/web/application.py", line 239, in process
    return self.handle()
  File "/usr/lib/python2.7/dist-packages/web/application.py", line 230, in handle
    return self._delegate(fn, self.fvars, args)
  File "/usr/lib/python2.7/dist-packages/web/application.py", line 420, in _delegate
    return handle_class(cls)
  File "/usr/lib/python2.7/dist-packages/web/application.py", line 396, in handle_class
    return tocall(*args)
  File "/usr/share/apache2/iredadmin/controllers/ldap/basic.py", line 77, in POST
    dn_user = ldaputils.convert_keyword_to_dn(username, accountType='user')
TypeError: convert_keyword_to_dn() got an unexpected keyword argument 'account_type'

5

Re: Cannot login into iRedAdmin after upgrade from 0.87 to 0.9

Did you restart Apache or uwsgi (if you're running Nginx) service to reload modified iRedAdmin?

6

Re: Cannot login into iRedAdmin after upgrade from 0.87 to 0.9

Oh I just restarted iredapd. After restarting apache2 the error stays the same, but the error message changed slightly:

 Traceback (most recent call last):
   File "/usr/lib/python2.7/dist-packages/web/application.py", line 239, in process
     return self.handle()
   File "/usr/lib/python2.7/dist-packages/web/application.py", line 230, in handle
     return self._delegate(fn, self.fvars, args)
   File "/usr/lib/python2.7/dist-packages/web/application.py", line 420, in _delegate
     return handle_class(cls)
   File "/usr/lib/python2.7/dist-packages/web/application.py", line 396, in handle_class
     return tocall(*args)
   File "/usr/share/apache2/iredadmin/controllers/ldap/basic.py", line 78, in POST
     qr_user_auth = auth.Auth(dn=dn_user, password=password)
 TypeError: Auth() takes at least 3 arguments (2 given)

7

Re: Cannot login into iRedAdmin after upgrade from 0.87 to 0.9

Sorry about this trouble. Try below patch please:

diff -r cf3f2be2d080 controllers/ldap/basic.py
--- a/controllers/ldap/basic.py    Tue Jan 13 21:29:01 2015 +0800
+++ b/controllers/ldap/basic.py    Wed Jan 14 14:07:09 2015 +0800
@@ -75,13 +75,13 @@
 
         # Check whether it's a mail user
         dn_user = ldaputils.convert_keyword_to_dn(username, accountType='user')
-        qr_user_auth = auth.Auth(dn=dn_user, password=password)
+        qr_user_auth = auth.Auth(uri=uri, dn=dn_user, password=password)
 
         qr_admin_auth = (False, 'INVALID_CREDENTIALS')
         if not qr_user_auth[0]:
             # Verify admin account under 'o=domainAdmins'.
             dn_admin = ldaputils.convert_keyword_to_dn(username, accountType='admin')
-            qr_admin_auth = auth.Auth(dn=dn_admin, password=password)
+            qr_admin_auth = auth.Auth(uri=uri, dn=dn_admin, password=password)
 
             if not qr_admin_auth[0]:
                 session['failed_times'] += 1

8

Re: Cannot login into iRedAdmin after upgrade from 0.87 to 0.9

That did the trick. I applied your new patch and restarted iredapd and apache2 and it works again!

Thank you very much!

By the way: Is there a comprehensive guide to switch from apache2 to nginx with my existing iRedMail Installation? The roadmap mentions a switch to nginx in future versions.

9

Re: Cannot login into iRedAdmin after upgrade from 0.87 to 0.9

Thanks ZhangHuangbin, the patch is working fine I faced the same error with a fresh install of iRedMail 0.9.0  with Roundcube and LDAP backend  on Centos 6.6 and I confirm your patch fixed it .

thanks .

10

Re: Cannot login into iRedAdmin after upgrade from 0.87 to 0.9

bodkov wrote:

By the way: Is there a comprehensive guide to switch from apache2 to nginx with my existing iRedMail Installation? The roadmap mentions a switch to nginx in future versions.

We're working on it. Will provide separate tutorials of setup Nginx and SOGo later.
Tutorial of installing SOGO on CentOS 6 (MySQL edition) is finished, but you know iRedMail supports several Linux/BSD distributions, and several backends, we need some time to finish them all. Please be patient.

11

Re: Cannot login into iRedAdmin after upgrade from 0.87 to 0.9

k-hussein wrote:

I confirm your patch fixed it .

Thanks for your feedback. smile