1 (edited by mscice 2017-01-21 18:16:00)

Topic: Unexpected error: 'NoneType' object has no attribute 'connect'

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

After php7.0 upgrade were seeing this error alot in iredapd.log

anyway to fix it? i think functionality is OK but still wondering what this is about....

Thank you for great service


2017-01-20 22:36:47 ERROR Unexpected error: 'NoneType' object has no attribute 'connect'. Fallback to default action: DUNNO
2017-01-20 22:36:47 INFO x.x.x.x END-OF-MESSAGE, noreply@hhhhh.com -> contact@host.com, DUNNO [0.0009s]

----

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

2

Re: Unexpected error: 'NoneType' object has no attribute 'connect'

Could you turn on debug mode in iRedAPD, restart it and check its log file immediately? any error?
FYI: http://www.iredmail.org/docs/debug.iredapd.html

3 (edited by mscice 2017-01-22 16:51:08)

Re: Unexpected error: 'NoneType' object has no attribute 'connect'

Thank you for your reply..


2017-01-22 03:48:13 ERROR Error while create SQL connection: ImportError('No module named pymysql',)
2017-01-22 03:48:13 ERROR Error while create SQL connection: ImportError('No module named pymysql',)
2017-01-22 03:48:13 ERROR Error while create SQL connection: ImportError('No module named pymysql',)
2017-01-22 03:48:13 INFO Starting iRedAPD (version: 2.0, backend: mysql), listening on 127.0.0.1:7777.
2017-01-22 03:48:13 INFO Log rotate type: time, interval: W6, backup copies: 12.
2017-01-22 03:48:13 INFO Loading plugin (priority: 100): reject_null_sender
2017-01-22 03:48:13 INFO Loading plugin (priority: 60): throttle

Ill install python-pymysql and see if it will fix it

4 (edited by harro.verton 2022-11-09 01:31:52)

Re: Unexpected error: 'NoneType' object has no attribute 'connect'

Having the same error after upgrading the mailserver from CentOS7 to CentOS8.

iredapd in debug mode only shows:

2022-11-08 17:17:59 DEBUG smtp session: server_address=172.18.8.80
2022-11-08 17:17:59 DEBUG Drop invalid smtp session input: server_address=172.18.8.80
2022-11-08 17:17:59 DEBUG smtp session: server_port=25
2022-11-08 17:17:59 DEBUG Drop invalid smtp session input: server_port=25
2022-11-08 17:17:59 DEBUG smtp session: policy_context=
2022-11-08 17:17:59 DEBUG Drop invalid smtp session input: policy_context=
2022-11-08 17:17:59 ERROR Unexpected error: 'NoneType' object has no attribute 'connect'. Fallback to default action: DUNNO
2022-11-08 17:17:59 DEBUG Session ended

No SQL errors to be seen.

Looking in the database I see most tables are empty though, which doesn't look right giving the email volume processed.

The tools (like cleanup_db and greylisting_admin) work fine and don't produce any errors.

5

Re: Unexpected error: 'NoneType' object has no attribute 'connect'

Found it. Added some additional debugging to the code, and now got:

2022-11-08 17:35:57 ERROR <!> Error creating a DB connection: No module named MySQLdb

which explains the problem, python2-mysqlclient is no longer available in the OS feeds. Building it with pip2 fixes the problem.