1

Topic: iRedadmin pro 2.2.0 internal server errors after upgrade

==== Required information ====
- iRedMail version (check /etc/iredmail-release): 0.9.0
- Linux/BSD distribution name and version: Ubuntu 14.04
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MYSQL
- Web server (Apache or Nginx):Apache
- Manage mail accounts with iRedAdmin-Pro? YES
- Related log if you're reporting an issue:
====

I upgraded Iredadmin pro to 2.2.0 today and can not access licensing/preferences or account settings anymore - internal server errors.

I just found out that iRedmail is at 0.9.0 but i never received any information there would be an upgrade available... is this the reason that it doesn't work anymore and how to upgrade from 0.9.0 to 0.9.3 - the instructions seem like a huge list of things to do - while i thought with iRedadmin pro things get easier in total, this seems like a huge and difficult upgrade procedure for every step from 0.9.0 to 0.9.1 to 0.9.2 to 0.9.3?!

thanks!!
Michael

----

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

2

Re: iRedadmin pro 2.2.0 internal server errors after upgrade

Dear Michael,

You have to upgrade iRedMail from 0.9.0 to 0.9.1, 0.9.2, then 0.9.3. The upgrade tutorials are available here:
http://www.iredmail.org/docs/iredmail.releases.html

The iRedAdmin-Pro "internal server error" of License page is a bug, i will send you a patched version, and we will release a bugfix release soon. Sorry about this trouble.

3

Re: iRedadmin pro 2.2.0 internal server errors after upgrade

Hi Zhang,

how do i find out what version of iRedAPD i am running - it says the upgrade process is different from version >< 1.3/1.4

thanks!
Michael

4

Re: iRedadmin pro 2.2.0 internal server errors after upgrade

You can try this command:

ls -l /opt/

Also, version number is stored in file /opt/iredapd/libs/__init__.py.

5

Re: iRedadmin pro 2.2.0 internal server errors after upgrade

ok so if i understood right i have upgraded iRedMail to 0.9.3 (there were only all those manual changes to be done and even the version is to be changed manually, right?)
I updated iRedAPD to 1.7.0 during the process
i updated iRedAdminPro to the 2.2.0 version you have sent me in the latest email.
however, i still have the problem that i can not access license page or domain preference pages...got internal server errors there.
i have rebooted the server and have cleared cache thoo - doesn't change anything though.

6

Re: iRedadmin pro 2.2.0 internal server errors after upgrade

Any related log in Apache or uwsgi log file?

7

Re: iRedadmin pro 2.2.0 internal server errors after upgrade

Yes in fact - sorry i am not experienced in debugging iredadmin - here the iredadmin.log file content after trying to enter the preferences for a domain in backend. (i added ******** for some server/domain related data...


******* [pid: 2528|app: 0|req: 24/28] 95.236.105.209 () {50 vars in 1209 bytes} [Mon Dec 21 12:55:47 2015] GET /iredadmin/profile/domain/general/*********** => generated 21 bytes in 10 msecs (HTTP/1.1 500) 2 headers in 165 bytes (2 switches on core 0)
'module' object has no attribute 'iredapd_db_host'
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-Pro-SQL-2.2.0/libs/sqllib/decorators.py", line 26, in proxyfunc
    return func(*args, **kw)
  File "/usr/share/apache2/iRedAdmin-Pro-SQL-2.2.0/controllers/sql/user.py", line 272, in GET
    qr = lib_greylist.get_greylist_setting_and_whitelists(account=self.mail)
  File "/usr/share/apache2/iRedAdmin-Pro-SQL-2.2.0/libs/iredapd/greylist.py", line 9, in get_greylist_setting_and_whitelists
    gl = Greylisting()
  File "/usr/share/apache2/iRedAdmin-Pro-SQL-2.2.0/libs/iredapd/__init__.py", line 44, in __init__
    self.db.supports_multiple_insert = True
AttributeError: 'Greylisting' object has no attribute 'db'

**************** [pid: 2528|app: 0|req: 25/29] 95.236.105.209 () {50 vars in 1219 bytes} [Mon Dec 21 12:56:05 2015] GET /iredadmin/profile/user/general/info@********* => generated 21 bytes in 13 msecs (HTTP/1.1 500) 2 headers in 165 bytes (2 switches on core 0)

8

Re: iRedadmin pro 2.2.0 internal server errors after upgrade

Please updated `policyd_enabled =` to False in iRedAdmin-Pro config file like below:

policyd_enabled = False

Then restart uwsgi service and try again.

9

Re: iRedadmin pro 2.2.0 internal server errors after upgrade

ah i might have skipped that cause i did not know where the iRedAdmin-Pro config file is

10

Re: iRedadmin pro 2.2.0 internal server errors after upgrade

ok i think i found it in /usr/share/apache2/iredadmin/settings.py

but even after changing to policyd_enabled=False i still have the 500 errors:

'module' object has no attribute 'iredapd_db_host'
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-Pro-SQL-2.2.0/libs/sqllib/decorators.py", line 26, in proxyfunc
    return func(*args, **kw)
  File "/usr/share/apache2/iRedAdmin-Pro-SQL-2.2.0/controllers/sql/domain.py", line 168, in GET
    qr = lib_greylist.get_greylist_setting_and_whitelists(account='@' + self.domain)
  File "/usr/share/apache2/iRedAdmin-Pro-SQL-2.2.0/libs/iredapd/greylist.py", line 9, in get_greylist_setting_and_whitelists
    gl = Greylisting()
  File "/usr/share/apache2/iRedAdmin-Pro-SQL-2.2.0/libs/iredapd/__init__.py", line 44, in __init__
    self.db.supports_multiple_insert = True
AttributeError: 'Greylisting' object has no attribute 'db'

************* [pid: 2535|app: 0|req: 6/7] 95.236.105.209 () {50 vars in 1209 bytes} [Mon Dec 21 15:14:25 2015] GET /iredadmin/profile/domain/general/************ => generated 21 bytes in 10 msecs (HTTP/1.1 500) 2 headers in 165 bytes (2 switches on core 0)

11

Re: iRedadmin pro 2.2.0 internal server errors after upgrade

On Debian/Ubuntu, it's /usr/share/apache2/iredadmin/settings.py (old iRedMail release) or /opt/www/iredadmin/settings.py (recent iRedMail releases).

FYI: Locations of configuration and log files of mojor components.
http://www.iredmail.org/docs/file.locations.html

12

Re: iRedadmin pro 2.2.0 internal server errors after upgrade

Wait a second but - i can not upgrade from the old iRedmail release to new iRedmail release?
The upgrade process from 0.9.0 to 0.9.3 is just to follow all the steps mentioned in the upgrade processes from each version to the next, there is nothing to download and upgrade, right?

13

Re: iRedadmin pro 2.2.0 internal server errors after upgrade

rossi256 wrote:

The upgrade process from 0.9.0 to 0.9.3 is just to follow all the steps mentioned in the upgrade processes from each version to the next, there is nothing to download and upgrade, right?

Yes.

rossi256 wrote:

  File "/usr/share/apache2/iRedAdmin-Pro-SQL-2.2.0/libs/iredapd/__init__.py", line 44, in __init__
    self.db.supports_multiple_insert = True
AttributeError: 'Greylisting' object has no attribute 'db'

This issue can be fixed by setting `policyd_enabled = False` in iRedAdmin-Pro config file, then restart Apache service.

Seems you didn't upgrade iRedMail and iRedAPD first, and iRedAdmin-Pro upgrade script didn't find required settings in iRedAPD config file.

14

Re: iRedadmin pro 2.2.0 internal server errors after upgrade

i have done the change ti iRedAdmin-Pro config file as suggested - the error persists even after restarting the server.

but now trying to restart apache service gives

(98)Address already in use: AH00072: make_sock: could not bind to address [::]:8                                                                      0
(98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.                                                                      0:80
no listening sockets available, shutting down
AH00015: Unable to open logs
Action 'start' failed.
The Apache error log may have more information.
                                                                         [fail]

15

Re: iRedadmin pro 2.2.0 internal server errors after upgrade

Looks like you're running Nginx as web server? if so, restart uwsgi service instead.

16

Re: iRedadmin pro 2.2.0 internal server errors after upgrade

I have restarted the uwsgi service but i guess that would be restarted when rebooting the whole server anyway - and it doesn't help...
should i retry to upgrade iredadminpro?
it might be true that i tried to upgrade iredadminpro without upgrading iredmail and iredapd before... however i think i tried to run the upgrade again afterwards... it says success everywhere but somehow all doesn't help...

17

Re: iRedadmin pro 2.2.0 internal server errors after upgrade

Still got same error? Please show me output of command below:

cd /usr/share/apache2/iredadmin/
grep 'policyd_' settings.py
grep 'iredapd_' settings.py

WARNING: Please replace the passwords in output before pasting here.

18

Re: iRedadmin pro 2.2.0 internal server errors after upgrade

grep 'policyd_' settings.py gives:

policyd_enabled = False
policyd_db_host = "127.0.0.1"
policyd_db_port = "3306"
policyd_db_name = "cluebringer"
policyd_db_user = "cluebringer"
policyd_db_password = "**********************************"


grep 'iredapd_' settings.py gives:

iredapd_enabled = True

19

Re: iRedadmin pro 2.2.0 internal server errors after upgrade

rossi256 wrote:

grep 'iredapd_' settings.py gives:
iredapd_enabled = True

policyd_* are ok, but you don't have iredapd related settings. Please try this:

cd /usr/share/apache2/iredadmin/
grep 'iredapd_db_' /opt/iredapd/settings.py >> settings.py
perl -pi -e 's#iredapd_db_server#iredapd_db_host#g' settings.py

Then restart Apache service.

20

Re: iRedadmin pro 2.2.0 internal server errors after upgrade

that did the trick! you are a true master of this!

Why don't you do all the upgrading also of iredmail and iredapd in this sort of script style? it would save a lot of time and effort...

thanks for your help!

21

Re: iRedadmin pro 2.2.0 internal server errors after upgrade

iRedAPD and iRedAdmin-Pro already have upgrade scripts (tools/upgrade_ired*.sh), but it's not easy for iRedMail.