1 (edited by aljmedia 2023-10-26 06:35:10)

Topic: Big problem with iredapd after server upgrade...

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release):
1.6.6
- Deployed with iRedMail Easy or the downloadable installer?
downloadable installer
- Linux/BSD distribution name and version:
Debian 12
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):
MySQL
- Web server (Apache or Nginx):
Nginx
- Manage mail accounts with iRedAdmin-Pro?
No
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

After I Upgraded Debian from 11 to 12, I had som issuses with Python3 and needed to reinstall Python3. For some reason I got problem with iRedmail, when I use /opt/iredapd/tools# python3 wblist_admin.py --list --blacklist i got following error:

* Establishing SQL connection.
* List all inbound blacklist for account: @.
'Engine' object has no attribute 'execute'

And in /var/log/iredapd/iredapt.log:

2023-10-25T20:13:35.893844+02:00 darke iredapd <!> Error while applying plugin 'sql_alias_access_policy': ['Traceback (most recent call last):\n', '  File "/usr/local/lib/python3.11/dist-packages/sqlalchemy/engine/base.py", line 1412, in execute\n    meth = statement._execute_on_connection\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n', "AttributeError: 'str' object has no attribute '_execute_on_connection'\n", '\nThe above exception was the direct cause of the following exception:\n\n', 'Traceback (most recent call last):\n', '  File "/opt/iRedAPD-5.3.3/libs/utils.py", line 90, in apply_plugin\n', '  File "/opt/iredapd/plugins/sql_alias_access_policy.py", line 99, in restriction\n', '  File "/opt/iRedAPD-5.3.3/libs/sql/__init__.py", line 118, in get_access_policy\n', '  File "/usr/local/lib/python3.11/dist-packages/sqlalchemy/engine/base.py", line 1414, in execute\n    raise exc.ObjectNotExecutableError(statement) from err\n', 'sqlalchemy.exc.ObjectNotExecutableError: Not an executable object: "SELECT accesspolicy\\n               FROM alias\\n              WHERE address=\'postmaster@a.io\'\\n              LIMIT 1"\n']

Can someone help me, is something missing?

----

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

2

Re: Big problem with iredapd after server upgrade...

Here is more logs:

2023-10-26T14:02:09.253677+02:00 darke iredapd <!> Error while applying plugin 'wblist_rdns': ['Traceback (most recent call last):\n', '  File "/usr/local/lib/python3.11/dist-packages/sqlalchemy/engine/base.py", line 1412, in execute\n    meth = statement._execute_on_connection\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n', "AttributeError: 'str' object has no attribute '_execute_on_connection'\n", '\nThe above exception was the direct cause of the following exception:\n\n', 'Traceback (most recent call last):\n', '  File "/opt/iRedAPD-5.3.3/libs/utils.py", line 90, in apply_plugin\n', '  File "/opt/iredapd/plugins/wblist_rdns.py", line 85, in restriction\n', '  File "/usr/local/lib/python3.11/dist-packages/sqlalchemy/engine/base.py", line 1414, in execute\n    raise exc.ObjectNotExecutableError(statement) from err\n', 'sqlalchemy.exc.ObjectNotExecutableError: Not an executable object: "SELECT rdns\\n               FROM wblist_rdns\\n              WHERE rdns IN (\'mail-wm1-x32a.google.com\', \'.mail-wm1-x32a.google.com\', \'.google.com\', \'.com\') AND wb=\'W\'\\n              LIMIT 1"\n']
2023-10-26T14:02:09.315013+02:00 darke iredapd <!> Error while querying domain: ObjectNotExecutableError('Not an executable object: "SELECT domain\\n                   FROM domain\\n                  WHERE domain=\'gmail.com\' AND active=1 AND backupmx=0\\n                  LIMIT 1"')
2023-10-26T14:02:09.315094+02:00 darke iredapd <!> Error while querying alias domain: ObjectNotExecutableError('Not an executable object: "SELECT alias_domain.alias_domain\\n                       FROM alias_domain, domain\\n                      WHERE domain.active=1\\n                            AND domain.domain=alias_domain.target_domain\\n                            AND alias_domain.alias_domain=\'gmail.com\'\\n                      LIMIT 1"')
2023-10-26T14:02:09.315147+02:00 darke iredapd <!> Error while applying plugin 'greylisting': ['Traceback (most recent call last):\n', '  File "/usr/local/lib/python3.11/dist-packages/sqlalchemy/engine/base.py", line 1412, in execute\n    meth = statement._execute_on_connection\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n', "AttributeError: 'str' object has no attribute '_execute_on_connection'\n", '\nThe above exception was the direct cause of the following exception:\n\n', 'Traceback (most recent call last):\n', '  File "/opt/iRedAPD-5.3.3/libs/utils.py", line 90, in apply_plugin\n', '  File "/opt/iredapd/plugins/greylisting.py", line 350, in restriction\n', '  File "/opt/iRedAPD-5.3.3/libs/sql/__init__.py", line 87, in get_alias_target_domain\n', '  File "/usr/local/lib/python3.11/dist-packages/sqlalchemy/engine/base.py", line 1414, in execute\n    raise exc.ObjectNotExecutableError(statement) from err\n', 'sqlalchemy.exc.ObjectNotExecutableError: Not an executable object: "SELECT alias_domain.target_domain\\n               FROM alias_domain, domain\\n              WHERE domain.active=1\\n                    AND domain.domain=alias_domain.target_domain\\n                    AND alias_domain.alias_domain=\'a.io\'\\n              LIMIT 1"\n']
2023-10-26T14:02:09.315230+02:00 darke iredapd <!> Error while applying plugin 'sql_ml_access_policy': ['Traceback (most recent call last):\n', '  File "/usr/local/lib/python3.11/dist-packages/sqlalchemy/engine/base.py", line 1412, in execute\n    meth = statement._execute_on_connection\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n', "AttributeError: 'str' object has no attribute '_execute_on_connection'\n", '\nThe above exception was the direct cause of the following exception:\n\n', 'Traceback (most recent call last):\n', '  File "/opt/iRedAPD-5.3.3/libs/utils.py", line 90, in apply_plugin\n', '  File "/opt/iredapd/plugins/sql_ml_access_policy.py", line 36, in restriction\n', '  File "/opt/iRedAPD-5.3.3/libs/sql/__init__.py", line 118, in get_access_policy\n', '  File "/usr/local/lib/python3.11/dist-packages/sqlalchemy/engine/base.py", line 1414, in execute\n    raise exc.ObjectNotExecutableError(statement) from err\n', 'sqlalchemy.exc.ObjectNotExecutableError: Not an executable object: "SELECT accesspolicy\\n               FROM maillists\\n              WHERE address=\'postmaster@a.io\'\\n              LIMIT 1"\n']
2023-10-26T14:02:09.315291+02:00 darke iredapd <!> Error while applying plugin 'sql_alias_access_policy': ['Traceback (most recent call last):\n', '  File "/usr/local/lib/python3.11/dist-packages/sqlalchemy/engine/base.py", line 1412, in execute\n    meth = statement._execute_on_connection\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n', "AttributeError: 'str' object has no attribute '_execute_on_connection'\n", '\nThe above exception was the direct cause of the following exception:\n\n', 'Traceback (most recent call last):\n', '  File "/opt/iRedAPD-5.3.3/libs/utils.py", line 90, in apply_plugin\n', '  File "/opt/iredapd/plugins/sql_alias_access_policy.py", line 99, in restriction\n', '  File "/opt/iRedAPD-5.3.3/libs/sql/__init__.py", line 118, in get_access_policy\n', '  File "/usr/local/lib/python3.11/dist-packages/sqlalchemy/engine/base.py", line 1414, in execute\n    raise exc.ObjectNotExecutableError(statement) from err\n', 'sqlalchemy.exc.ObjectNotExecutableError: Not an executable object: "SELECT accesspolicy\\n               FROM alias\\n              WHERE address=\'postmaster@a.io\'\\n              LIMIT 1"\n']
2023-10-26T14:02:09.315355+02:00 darke iredapd <!> Error while applying plugin 'amavisd_wblist': ['Traceback (most recent call last):\n', '  File "/usr/local/lib/python3.11/dist-packages/sqlalchemy/engine/base.py", line 1412, in execute\n    meth = statement._execute_on_connection\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n', "AttributeError: 'str' object has no attribute '_execute_on_connection'\n", '\nThe above exception was the direct cause of the following exception:\n\n', 'Traceback (most recent call last):\n', '  File "/opt/iRedAPD-5.3.3/libs/utils.py", line 90, in apply_plugin\n', '  File "/opt/iredapd/plugins/amavisd_wblist.py", line 310, in restriction\n', '  File "/opt/iRedAPD-5.3.3/libs/sql/__init__.py", line 87, in get_alias_target_domain\n', '  File "/usr/local/lib/python3.11/dist-packages/sqlalchemy/engine/base.py", line 1414, in execute\n    raise exc.ObjectNotExecutableError(statement) from err\n', 'sqlalchemy.exc.ObjectNotExecutableError: Not an executable object: "SELECT alias_domain.target_domain\\n               FROM alias_domain, domain\\n              WHERE domain.active=1\\n                    AND domain.domain=alias_domain.target_domain\\n                    AND alias_domain.alias_domain=\'gmail.com\'\\n              LIMIT 1"\n']
2023-10-26T14:02:09.315414+02:00 darke iredapd [2a00:1450:4864:20::32a] RCPT, postmaster@gmail.com -> postmaster@a.io, DUNNO [sasl_username=, sender=postmaster@gmail.com, client_name=mail-wm1-x32a.google.com, reverse_client_name=mail-wm1-x32a.google.com, helo=some.domain.tld, encryption_protocol=, encryption_cipher=, server_port=, process_time=0.0246s]

3 (edited by aljmedia 2023-10-26 22:57:36)

Re: Big problem with iredapd after server upgrade...

I solved it my self:

I downgraded python3-sqlalchemy to 1.4.46 then I needed to make some symlinks between

/usr/lib/python3/dist-packages/sqlalchemy and /usr/local/lib/python3.11/dist-packages/sqlalchemy

Now it works!!!