1

Topic: Problem migrating from Cluebringer to iRedAPD

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

I've updated migrate_cluebringer_greylisting.py and migrate_cluebringer_throttle.py with the correct values from the DB but when I run them they both hang and have to be killed.  I verified the database values my manually connecting.

migrate_cluebringer_greylisting.py hangs on this:

qr = conn_cb.select('greylisting',
                    what='id',
                    where="name='Greylisting Inbound Emails' AND usegreylisting=1",
                    limit=1)

I don't see any other reports of this.  Any ideas what I might be doing wrong?

----

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

2

Re: Problem migrating from Cluebringer to iRedAPD

out of the grey - selinux status ? enforcing or disabled ?

3

Re: Problem migrating from Cluebringer to iRedAPD

Frankstar wrote:

out of the grey - selinux status ? enforcing or disabled ?

SELinux status:                 disabled

4

Re: Problem migrating from Cluebringer to iRedAPD

dittman wrote:

migrate_cluebringer_greylisting.py hangs on this:
qr = conn_cb.select('greylisting',
                    what='id',
                    where="name='Greylisting Inbound Emails' AND usegreylisting=1",
                    limit=1)

*) Do you have many records in SQL table "cluebringer.greylisting"?
*) Do you have correct SQL username and password for this database in migrate_cluebringer_greylisting.py? port number?

5

Re: Problem migrating from Cluebringer to iRedAPD

ZhangHuangbin wrote:
dittman wrote:

migrate_cluebringer_greylisting.py hangs on this:
qr = conn_cb.select('greylisting',
                    what='id',
                    where="name='Greylisting Inbound Emails' AND usegreylisting=1",
                    limit=1)

*) Do you have many records in SQL table "cluebringer.greylisting"?
*) Do you have correct SQL username and password for this database in migrate_cluebringer_greylisting.py? port number?

There are just two records in that table, "Greylisting Inbound Emails" and no_greylisting.

I have the correct username, password, and port and verified by manually connecting.

6

Re: Problem migrating from Cluebringer to iRedAPD

dittman wrote:

migrate_cluebringer_greylisting.py hangs on this:
qr = conn_cb.select('greylisting',
                    what='id',
                    where="name='Greylisting Inbound Emails' AND usegreylisting=1",
                    limit=1)

I'm a little confused here, what do you mean "hangs on this"? This script didn't finish?
Could you please find line "web.config.debug = False" in migrate_cluebringer_greylisting.py, change False to True, and re-run the script? Show us the terminal output.

7 (edited by dittman 2016-04-26 04:37:42)

Re: Problem migrating from Cluebringer to iRedAPD

ZhangHuangbin wrote:
dittman wrote:

migrate_cluebringer_greylisting.py hangs on this:
qr = conn_cb.select('greylisting',
                    what='id',
                    where="name='Greylisting Inbound Emails' AND usegreylisting=1",
                    limit=1)

I'm a little confused here, what do you mean "hangs on this"? This script didn't finish?
Could you please find line "web.config.debug = False" in migrate_cluebringer_greylisting.py, change False to True, and re-run the script? Show us the terminal output.

By "hangs on this" I mean that I added code to print something before and after that command and the one after never printed anything.

I've tried to run it with debug turned on but it looks like something I did after this messed things up as it fails to connect now instead of hanging:

[root@clarke tools]# python migrate_cluebringer_greylisting.py
* Backend: mysql
* Migrate global greylisting setting.
    - Query enabled global greylisting setting.
Traceback (most recent call last):
  File "migrate_cluebringer_greylisting.py", line 70, in <module>
    limit=1)
  File "/usr/lib/python2.7/site-packages/web/db.py", line 682, in select
    return self.query(qout, processed=True)
  File "/usr/lib/python2.7/site-packages/web/db.py", line 643, in query
    db_cursor = self._db_cursor()
  File "/usr/lib/python2.7/site-packages/web/db.py", line 566, in _db_cursor
    return self.ctx.db.cursor()
  File "/usr/lib/python2.7/site-packages/web/db.py", line 507, in _getctx
    self._load_context(self._ctx)
  File "/usr/lib/python2.7/site-packages/web/db.py", line 518, in _load_context
    ctx.db = self._connect(self.keywords)
  File "/usr/lib/python2.7/site-packages/web/db.py", line 546, in _connect
    return self.db_module.connect(**keywords)
  File "/usr/lib64/python2.7/site-packages/MySQLdb/__init__.py", line 81, in Connect
    return Connection(*args, **kwargs)
  File "/usr/lib64/python2.7/site-packages/MySQLdb/connections.py", line 187, in __init__
    super(Connection, self).__init__(*args, **kwargs2)
_mysql_exceptions.OperationalError: (2003, "Can't connect to MySQL server on '127.0.0.1' (111)")


But manually connecting still works:

[root@clarke tools]# mysql -u cluebringer -p --port=10031
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 3682
Server version: 5.5.44-MariaDB MariaDB Server

Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> quit
Bye


I had gone ahead after this with the rest of the steps as I needed to get my email server runnng again and figured that I should still be able to pull the values out of the database since I didn't remove it.

8

Re: Problem migrating from Cluebringer to iRedAPD

dittman wrote:

_mysql_exceptions.OperationalError: (2003, "Can't connect to MySQL server on '127.0.0.1' (111)")

Why does it report that it cannot connect to mysql server? do you have correct sql port number in migrate_cluebringer_greylisting.py?

dittman wrote:

[root@clarke tools]# mysql -u cluebringer -p --port=10031

Port 10031 for mysql db?

9

Re: Problem migrating from Cluebringer to iRedAPD

ZhangHuangbin wrote:
dittman wrote:

_mysql_exceptions.OperationalError: (2003, "Can't connect to MySQL server on '127.0.0.1' (111)")

Why does it report that it cannot connect to mysql server? do you have correct sql port number in migrate_cluebringer_greylisting.py?

dittman wrote:

[root@clarke tools]# mysql -u cluebringer -p --port=10031

Port 10031 for mysql db?

10031 is the port listed in the cluebringer config file and I have it in migrate_cluebringer_greylisting.py.  I'm definitely connecting to the cluebringer database:

[root@clarke tools]# mysql -u cluebringer -p --port=10031
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 4668
Server version: 5.5.44-MariaDB MariaDB Server

Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> use cluebringer
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
MariaDB [cluebringer]> show tables;
+---------------------------+
| Tables_in_cluebringer     |
+---------------------------+
| access_control            |
| amavis_rules              |
| checkhelo                 |
| checkhelo_blacklist       |
| checkhelo_tracking        |
| checkhelo_whitelist       |
| checkspf                  |
| greylisting               |
| greylisting_autoblacklist |
| greylisting_autowhitelist |
| greylisting_tracking      |
| greylisting_whitelist     |
| policies                  |
| policy_group_members      |
| policy_groups             |
| policy_members            |
| quotas                    |
| quotas_limits             |
| quotas_tracking           |
| session_tracking          |
+---------------------------+
20 rows in set (0.00 sec)

MariaDB [cluebringer]>

10

Re: Problem migrating from Cluebringer to iRedAPD

*) MySQL server listens on port 3306.
*) Cluebringer service is listening on port 10031.

Don't mix them.

11

Re: Problem migrating from Cluebringer to iRedAPD

ZhangHuangbin wrote:

*) MySQL server listens on port 3306.
*) Cluebringer service is listening on port 10031.

Don't mix them.

Thanks!  That was the problem.  This was what confused me in the "Migrate from Cluebringer to iRedAPD" page:

Please open above two files, update below parameters with correct SQL server address, port, database name, username and password for your existing Cluebringer database.

I thought that meant to use the port listed in cluebringer.conf.