1

Topic: Error: int() argument must be a string or a number, not 'NoneType'

==== Required information ====
- iRedMail version:
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):
- Linux/BSD distribution name and version:
- Related log if you're reporting an issue:
======== Required information ====
- iRedMail version: 0.8.6
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Linux/BSD distribution name and version: CentOS6.4
- Related log if you're reporting an issue:
====

I saw this was posted by another user, however, the solution you gave to that individual did not work for me.

Creating a user for this particular domain does not work. It is a newly created domain with no users or aliases.
I've tried recreating it with no success, however, if I create another domain, it works just fine.

I don't see anything in the httpd/apache logs that are reffering to that issue.

Any idea what it may be?

This steps I did from the other thread was:

Do below steps work for you?
*) deleting all records in SQL table `iredadmin.sessions`
*) Restarting Apache web server
*) Re-login

Post's attachments

iredmail error.png
iredmail error.png 55.13 kb, file has never been downloaded. 

You don't have the permssions to download the attachments of this post.

----

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

2

Re: Error: int() argument must be a string or a number, not 'NoneType'

Sorry about this trouble.

Please try this patch for iRedAdmin-Pro-MySQL-1.7.0:

diff --git a/libs/mysql/domain.py b/libs/mysql/domain.py
--- a/libs/mysql/domain.py
+++ b/libs/mysql/domain.py
@@ -135,8 +135,8 @@
             )
 
             if len(result) == 1:
-                result = list(result)
-                return (True, int(result[0].total))
+                total = result[0].total or 0
+                return (True, total)
             else:
                 return (False, 'INVALID_DOMAIN_QUOTA')
         except Exception, e:

3

Re: Error: int() argument must be a string or a number, not 'NoneType'

Please save above content as file 'domain.patch' first. and steps to apply this patch file:

1) Upload it to your server which has iRedAdmin-Pro-MySQL-1.7.0 running. Assume uploaded file is /root/domain.patch.

2) Change working directory to the root directory of iRedAdmin-Pro-MySQL-1.7.0. For example:

# cd /var/www/iRedAdmin-Pro-MySQL-1.7.0/

3) Verify the patch with command 'patch --dry-run -p1':

# patch --dry-run -p1 < /root/domain.patch
patching file libs/mysql/domain.py

4) If you got the SAME output message, it's safe to apply it without '--dry-run' immediately:

# patch -p1 < /root/domain.patch

5) Restart Apache web server to reload patched file.

That's all. Let me know whether it works for you or not.

4

Re: Error: int() argument must be a string or a number, not 'NoneType'

Excellent! That worked. Thank you very much, sir!