1

Topic: Error: IntegrityError(1364, "Field 'disclaimer' doesn't have a default

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

When trying to make an new email address or a new domain, i get the following error :

Error: IntegrityError(1364, "Field 'disclaimer' doesn't have a default value")
This appears to be a MySQL error, however i don't know how to solve it (yet)

Can you help me solve it?
output mysql:

mysql> DESC domain \G
*************************** 1. row ***************************
  Field: domain
   Type: varchar(255)
   Null: NO
    Key: PRI
Default: 
  Extra: 
*************************** 2. row ***************************
  Field: description
   Type: text
   Null: NO
    Key: 
Default: NULL
  Extra: 
*************************** 3. row ***************************
  Field: disclaimer
   Type: text
   Null: NO
    Key: 
Default: NULL
  Extra: 
*************************** 4. row ***************************
  Field: aliases
   Type: int(10)
   Null: NO
    Key: 
Default: 0
  Extra: 
*************************** 5. row ***************************
  Field: mailboxes
   Type: int(10)
   Null: NO
    Key: 
Default: 0
  Extra: 
*************************** 6. row ***************************
  Field: maxquota
   Type: bigint(20)
   Null: NO
    Key: 
Default: 0
  Extra: 
*************************** 7. row ***************************
  Field: quota
   Type: bigint(20)
   Null: NO
    Key: 
Default: 0
  Extra: 
*************************** 8. row ***************************
  Field: transport
   Type: varchar(255)
   Null: NO
    Key: 
Default: dovecot
  Extra: 
*************************** 9. row ***************************
  Field: backupmx
   Type: tinyint(1)
   Null: NO
    Key: MUL
Default: 0
  Extra: 
*************************** 10. row ***************************
  Field: defaultpasswordscheme
   Type: varchar(10)
   Null: NO
    Key: 
Default: 
  Extra: 
*************************** 11. row ***************************
  Field: created
   Type: datetime
   Null: NO
    Key: 
Default: 1970-01-01 01:01:01
  Extra: 
*************************** 12. row ***************************
  Field: modified
   Type: datetime
   Null: NO
    Key: 
Default: 1970-01-01 01:01:01
  Extra: 
*************************** 13. row ***************************
  Field: expired
   Type: datetime
   Null: NO
    Key: MUL
Default: 9999-12-31 00:00:00
  Extra: 
*************************** 14. row ***************************
  Field: active
   Type: tinyint(1)
   Null: NO
    Key: MUL
Default: 1
  Extra: 
*************************** 15. row ***************************
  Field: settings
   Type: text
   Null: YES
    Key: 
Default: NULL
  Extra: 
*************************** 16. row ***************************
  Field: maillists
   Type: int(10)
   Null: NO
    Key: 
Default: 0
  Extra: 
16 rows in set (0.00 sec)
mysql> DESC mailbox \G
*************************** 1. row ***************************
  Field: username
   Type: varchar(255)
   Null: NO
    Key: PRI
Default: NULL
  Extra: 
*************************** 2. row ***************************
  Field: password
   Type: varchar(255)
   Null: NO
    Key: 
Default: 
  Extra: 
*************************** 3. row ***************************
  Field: name
   Type: varchar(255)
   Null: NO
    Key: 
Default: 
  Extra: 
*************************** 4. row ***************************
  Field: language
   Type: varchar(5)
   Null: NO
    Key: 
Default: en_US
  Extra: 
*************************** 5. row ***************************
  Field: storagebasedirectory
   Type: varchar(255)
   Null: NO
    Key: 
Default: /var/vmail
  Extra: 
*************************** 6. row ***************************
  Field: storagenode
   Type: varchar(255)
   Null: NO
    Key: 
Default: vmail1
  Extra: 
*************************** 7. row ***************************
  Field: maildir
   Type: varchar(255)
   Null: NO
    Key: 
Default: 
  Extra: 
*************************** 8. row ***************************
  Field: quota
   Type: bigint(20)
   Null: NO
    Key: 
Default: 0
  Extra: 
*************************** 9. row ***************************
  Field: domain
   Type: varchar(255)
   Null: NO
    Key: MUL
Default: 
  Extra: 
*************************** 10. row ***************************
  Field: transport
   Type: varchar(255)
   Null: NO
    Key: 
Default: 
  Extra: 
*************************** 11. row ***************************
  Field: department
   Type: varchar(255)
   Null: NO
    Key: MUL
Default: 
  Extra: 
*************************** 12. row ***************************
  Field: rank
   Type: varchar(255)
   Null: NO
    Key: 
Default: normal
  Extra: 
*************************** 13. row ***************************
  Field: employeeid
   Type: varchar(255)
   Null: YES
    Key: MUL
Default: 
  Extra: 
*************************** 14. row ***************************
  Field: enablesmtp
   Type: tinyint(1)
   Null: NO
    Key: MUL
Default: 1
  Extra: 
*************************** 15. row ***************************
  Field: enablesmtpsecured
   Type: tinyint(1)
   Null: NO
    Key: MUL
Default: 1
  Extra: 
*************************** 16. row ***************************
  Field: enablepop3
   Type: tinyint(1)
   Null: NO
    Key: MUL
Default: 1
  Extra: 
*************************** 17. row ***************************
  Field: enablepop3secured
   Type: tinyint(1)
   Null: NO
    Key: MUL
Default: 1
  Extra: 
*************************** 18. row ***************************
  Field: enableimap
   Type: tinyint(1)
   Null: NO
    Key: MUL
Default: 1
  Extra: 
*************************** 19. row ***************************
  Field: enableimapsecured
   Type: tinyint(1)
   Null: NO
    Key: MUL
Default: 1
  Extra: 
*************************** 20. row ***************************
  Field: enabledeliver
   Type: tinyint(1)
   Null: NO
    Key: MUL
Default: 1
  Extra: 
*************************** 21. row ***************************
  Field: enablelda
   Type: tinyint(1)
   Null: NO
    Key: MUL
Default: 1
  Extra: 
*************************** 22. row ***************************
  Field: enablemanagesieve
   Type: tinyint(1)
   Null: NO
    Key: MUL
Default: 1
  Extra: 
*************************** 23. row ***************************
  Field: enablemanagesievesecured
   Type: tinyint(1)
   Null: NO
    Key: MUL
Default: 1
  Extra: 
*************************** 24. row ***************************
  Field: enablesieve
   Type: tinyint(1)
   Null: NO
    Key: MUL
Default: 1
  Extra: 
*************************** 25. row ***************************
  Field: enablesievesecured
   Type: tinyint(1)
   Null: NO
    Key: MUL
Default: 1
  Extra: 
*************************** 26. row ***************************
  Field: enableinternal
   Type: tinyint(1)
   Null: NO
    Key: MUL
Default: 1
  Extra: 
*************************** 27. row ***************************
  Field: enabledoveadm
   Type: tinyint(1)
   Null: NO
    Key: MUL
Default: 1
  Extra: 
*************************** 28. row ***************************
  Field: enablelib-storage
   Type: tinyint(1)
   Null: NO
    Key: MUL
Default: 1
  Extra: 
*************************** 29. row ***************************
  Field: lastlogindate
   Type: datetime
   Null: NO
    Key: 
Default: 1970-01-01 01:01:01
  Extra: 
*************************** 30. row ***************************
  Field: lastloginipv4
   Type: int(4) unsigned
   Null: NO
    Key: 
Default: 0
  Extra: 
*************************** 31. row ***************************
  Field: lastloginprotocol
   Type: char(255)
   Null: NO
    Key: 
Default: 
  Extra: 
*************************** 32. row ***************************
  Field: disclaimer
   Type: text
   Null: NO
    Key: 
Default: NULL
  Extra: 
*************************** 33. row ***************************
  Field: passwordlastchange
   Type: datetime
   Null: NO
    Key: MUL
Default: 1970-01-01 01:01:01
  Extra: 
*************************** 34. row ***************************
  Field: created
   Type: datetime
   Null: NO
    Key: 
Default: 1970-01-01 01:01:01
  Extra: 
*************************** 35. row ***************************
  Field: modified
   Type: datetime
   Null: NO
    Key: 
Default: 1970-01-01 01:01:01
  Extra: 
*************************** 36. row ***************************
  Field: expired
   Type: datetime
   Null: NO
    Key: MUL
Default: 9999-12-31 00:00:00
  Extra: 
*************************** 37. row ***************************
  Field: active
   Type: tinyint(1)
   Null: NO
    Key: MUL
Default: 1
  Extra: 
*************************** 38. row ***************************
  Field: bytes
   Type: bigint(20)
   Null: NO
    Key: 
Default: 0
  Extra: 
*************************** 39. row ***************************
  Field: messages
   Type: bigint(20)
   Null: NO
    Key: 
Default: 0
  Extra: 
*************************** 40. row ***************************
  Field: isadmin
   Type: tinyint(1)
   Null: NO
    Key: MUL
Default: 0
  Extra: 
*************************** 41. row ***************************
  Field: isglobaladmin
   Type: tinyint(1)
   Null: NO
    Key: MUL
Default: 0
  Extra: 
*************************** 42. row ***************************
  Field: allowedsenders
   Type: text
   Null: NO
    Key: 
Default: NULL
  Extra: 
*************************** 43. row ***************************
  Field: rejectedsenders
   Type: text
   Null: NO
    Key: 
Default: NULL
  Extra: 
*************************** 44. row ***************************
  Field: allowedrecipients
   Type: text
   Null: NO
    Key: 
Default: NULL
  Extra: 
*************************** 45. row ***************************
  Field: rejectedrecipients
   Type: text
   Null: NO
    Key: 
Default: NULL
  Extra: 
*************************** 46. row ***************************
  Field: enablelmtp
   Type: tinyint(1)
   Null: NO
    Key: MUL
Default: 1
  Extra: 
*************************** 47. row ***************************
  Field: settings
   Type: text
   Null: YES
    Key: 
Default: NULL
  Extra: 
*************************** 48. row ***************************
  Field: allow_nets
   Type: text
   Null: YES
    Key: 
Default: NULL
  Extra: 
*************************** 49. row ***************************
  Field: enableimaptls
   Type: tinyint(1)
   Null: NO
    Key: MUL
Default: 1
  Extra: 
*************************** 50. row ***************************
  Field: enablepop3tls
   Type: tinyint(1)
   Null: NO
    Key: MUL
Default: 1
  Extra: 
*************************** 51. row ***************************
  Field: enablesievetls
   Type: tinyint(1)
   Null: NO
    Key: MUL
Default: 1
  Extra: 
51 rows in set (0.01 sec)

mysql> 

----

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

2

Re: Error: IntegrityError(1364, "Field 'disclaimer' doesn't have a default

Run SQL commands below as mysql root user:

ALTER TABLE domain MODIFY COLUMN disclaimer TEXT;
ALTER TABLE mailbox MODIFY COLUMN disclaimer TEXT;

If some other columns have same error, run same SQL command (with different table name) to fix it.

3

Re: Error: IntegrityError(1364, "Field 'disclaimer' doesn't have a default

ZhangHuangbin wrote:

ALTER TABLE domain MODIFY COLUMN disclaimer TEXT;
ALTER TABLE mailbox MODIFY COLUMN disclaimer TEXT;

This did the trick. Thank you, as always!!