1

Topic: iRedAPD error, FreeBSD/apache issue after upgrade

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

Two issues after upgrading to iRedMail 0.9.4 and iRedAdmin-Pro 2.3.0:

1. After upgrading to iRedAPD 1.8.0, a cron job returned this error:

* Query SQL server to get mail domain names.
Traceback (most recent call last):
  File "/opt/iredapd/tools/spf_to_greylist_whitelists.py", line 290, in <module>
    qr = conn.select('greylisting_whitelist_domains', what='domain')
  File "/usr/local/lib/python2.7/site-packages/web/db.py", line 682, in select
    return self.query(qout, processed=True)
  File "/usr/local/lib/python2.7/site-packages/web/db.py", line 643, in query
    db_cursor = self._db_cursor()
  File "/usr/local/lib/python2.7/site-packages/web/db.py", line 566, in _db_cursor
    return self.ctx.db.cursor()
  File "/usr/local/lib/python2.7/site-packages/web/db.py", line 507, in _getctx
    self._load_context(self._ctx)
  File "/usr/local/lib/python2.7/site-packages/web/db.py", line 518, in _load_context
    ctx.db = self._connect(self.keywords)
  File "/usr/local/lib/python2.7/site-packages/web/db.py", line 546, in _connect
    return self.db_module.connect(**keywords)
  File "/usr/local/lib/python2.7/site-packages/MySQLdb/__init__.py", line 81, in Connect
    return Connection(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/MySQLdb/connections.py", line 193, in __init__
    super(Connection, self).__init__(*args, **kwargs2)
_mysql_exceptions.OperationalError: (1045, "Access denied for user 'iredapd'@'localhost' (using password: YES)")

There is an iredapd database and iredapd user. Login from the command line works OK.

2. As part of the iRedAdmin-Pro upgrade, the upgrade script restarts Apache. FreeBSD's default Apache is now apache24, so the script fails because it attempts to restart apache22. Restarting apache24 manually works OK.

Thanks in advance for guidance on the access denied message with iredapd.

----

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

2

Re: iRedAPD error, FreeBSD/apache issue after upgrade

Answering my own post: Point 1 was a bad password in /opt/iredapd/settings.py. I don't know why, since 1.7.0 used the correct password.

3

Re: iRedAPD error, FreeBSD/apache issue after upgrade

cvcvelo wrote:

_mysql_exceptions.OperationalError: (1045, "Access denied for user 'iredapd'@'localhost' (using password: YES)")
There is an iredapd database and iredapd user. Login from the command line works OK.

If your old iRedAPD doesn't have 'iredapd_db_*' in /opt/iredapd/settings.py, the upgrade script will try to create a new SQL database and set a new random password for SQL user 'iredapd'.
So the question is, did you have 'iredapd_db_*' settings in old iRedAPD config file?

cvcvelo wrote:

2. As part of the iRedAdmin-Pro upgrade, the upgrade script restarts Apache. FreeBSD's default Apache is now apache24, so the script fails because it attempts to restart apache22. Restarting apache24 manually works OK.

This is not expected. the upgrade script checks whether or not /usr/local/etc/rc.d/apache24 exists, if it does exist, it will restart it (apache24). if not, it restarts apache22 instead.

4

Re: iRedAPD error, FreeBSD/apache issue after upgrade

ZhangHuangbin wrote:

So the question is, did you have 'iredapd_db_*' settings in old iRedAPD config file?

No, no such settings. This must be the issue. I don't see anything about those settings in the iRedAPD upgrade guide:

http://www.iredmail.org/docs/upgrade.iredapd.html

What changes are needed in settings.py?

5

Re: iRedAPD error, FreeBSD/apache issue after upgrade

Upgrading iRedAPD from 1.6.0 to 1.7.0 or later releases will create a new sql database, and the upgrade script will add required "iredapd_*" settings in iRedAPD config file.