Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

When saves "don't work" this is a general indicator that a field you have entered (should I say crammed!) has exceeded the schema expectations. Its a little annoying to trace, but do this:

  1. Uninstall / reinstall JEMH (this will flush the 'cache' of ActiveObject database records held in memory)
  2. Edit a boolean form field somewhere, save.

The change should persist. Now, make (and save) one configuration change at a time. If you are storing 'large' quantities of text, for example in catchmail, it may need increasing. JEMH once thought 255characters was enough, but has since made these fields (and many more) unlimited text now. Schema changes aren't possible, so just need be be triaged through support as/when it arises. In this situation you can safely extend the schema, as described here:

The following Configuration fields are now unlimited text, contrast this fields you are changing:

  • CreateUsersEmailWhitelist
  • CreateUsersEmailBlacklist
  • CatchEmailAddress
  • JemhAddresseeRegexps
  • SubjectCleanupRegexps
  • BlacklistedAttachmentTypes
  • WhitelistSenders
  • GreylistSubjectRegexps
  • GreylistEmailBodyRegexp
  • GreylistSenders
  • BlacklistSenders
  • BlacklistRecipients

Updating your schema through a lossless conversion from char (255) to text will enable unlimited text to be entered.

Example:

...

Cause

The use of these fields exceeded expectation, most of the text entry fields had at one point a 255 character limit set, e.g. blacklist senders regular expression. If a save was attempted that exceeded this limit, the save failed. Unfortunately, whilst the update failed, the configuration entity object that contained this value got 'left' with the larger value, meaning that any future changes would not work until that previous field value was fixed.

Current builds now have marked the specific fields commonly causing this problem as unlimited length, but unfortunately, such changes are not yet reflected automatically into a pre-existing installation.

Workaround

Locate the text field previously edited, look for a value that is greater than 255 characters, fix it so its less than that. The save, and future changes should now work.

Resolution

The schema needs to be updated. As the AO layer used to access the database doesn't actually reflect UNLIMITED length if the schema already exists, a simple tweak is to change datatype on a per-column basis, given the change is from a 255 character field to unlimited, no data will be lost.

With no data changes going on, this change should be transparent to JIRA, previously failing saves should now work.

Depending on your revision there are two tables that have caused problems:

  • AO_78C957_AUDITEVENTS, containing audit history, large addressee lists, this is listed above (Data truncation: Data too long for column)
  • AO_78C957_CONFIG, contains core configuration fields

AO_78C957_CONFIG fields

  • BLACKLIST_SENDERS
  • BLACKLIST_RECIPIENTS
  • BLACKLISTED_ATTACHMENT_TYPES
  • BODY_DELIMITER_REGEXPS
  • CREATE_USERS_EMAIL_BLACKLIST
  • CREATE_USERS_EMAIL_WHITELIST
  • CATCH_EMAIL_ADDRESS
  • GREYLIST_SUBJECT_REGEXPS
  • GREYLIST_SENDERS
  • GREYLIST_EMAIL_BODY_REGEXP
  • JEMH_ADDRESSEE_REGEXPS
  • SUBJECT_CLEANUP_REGEXPS
  • WHITELIST_SENDERS

Mysql Script

(info) for a Schema called jira514 (set it to the default in tools like emma), update this to reflect your deployment:

alter table AO_78C957_AUDITEVENTS change TO_ADDRESS TO_ADDRESS text;
alter table AO_78C957_AUDITEVENTS change CC_ADDRESS CC_ADDRESS text;
alter table AO_78C957_AUDITEVENTS change EMAIL_SUBJECT EMAIL_SUBJECT text;

alter table AO_78C957_CONFIG change BLACKLISTED_ATTACHMENT_TYPES BLACKLISTED_ATTACHMENT_TYPES text;
alter table AO_78C957_CONFIG change BLACKLIST_SENDERS BLACKLIST_SENDERS text;
alter table AO_78C957_CONFIG change BLACKLIST_RECIPIENTS BLACKLIST_RECIPIENTS text;
alter table AO_78C957_CONFIG change BODY_DELIMITER_REGEXPS BODY_DELIMITER_REGEXPS text;
alter table AO_78C957_CONFIG change CREATE_USERS_EMAIL_BLACKLIST CREATE_USERS_EMAIL_BLACKLIST text;
alter table AO_78C957_CONFIG change CREATE_USERS_EMAIL_WHITELIST CREATE_USERS_EMAIL_WHITELIST text;
alter table AO_78C957_CONFIG change CATCH_EMAIL_ADDRESS CATCH_EMAIL_ADDRESS text;
alter table AO_78C957_CONFIG change GREYLIST_SUBJECT_REGEXPS GREYLIST_SUBJECT_REGEXPS text;
alter table AO_78C957_CONFIG change GREYLIST_SENDERS GREYLIST_SENDERS text;
alter table AO_78C957_CONFIG change GREYLIST_EMAIL_BODY_REGEXP GREYLIST_EMAIL_BODY_REGEXP text;
alter table AO_78C957_CONFIG change JEMH_ADDRESSEE_REGEXPS JEMH_ADDRESSEE_REGEXPS text;
alter table AO_78C957_CONFIG change SUBJECT_CLEANUP_REGEXPS SUBJECT_CLEANUP_REGEXPS text;
alter table AO_78C957_CONFIG change WHITELIST_SENDERS WHITELIST_SENDERS text;
commit;

Postgresql

(info) Postgres likes to lower case everything, you'll need to quote the table and columns that AO has created.

alter table "AO_78C957_CONFIG" alter column "TO_ADDRESS" type text;
alter table "AO_78C957_CONFIG" alter column "CC_ADDRESS" type text;
alter table "AO_78C957_CONFIG" alter column "EMAIL_SUBJECT" type text;

alter table "AO_78C957_CONFIG" alter column "BLACKLIST_SENDERS" type text;
alter table "AO_78C957_CONFIG" alter column "BLACKLIST_RECIPIENTS" type text;
alter table "AO_78C957_CONFIG" alter column "BLACKLISTED_ATTACHMENT_TYPES" type text;
alter table "AO_78C957_CONFIG" alter column "BODY_DELIMITER_REGEXPS" type text;
alter table "AO_78C957_CONFIG" alter column "CREATE_USERS_EMAIL_BLACKLIST" type text;
alter table "AO_78C957_CONFIG" alter column "CREATE_USERS_EMAIL_WHITELIST" type text;
alter table "AO_78C957_CONFIG" alter column "CATCH_EMAIL_ADDRESS" type text;
alter table "AO_78C957_CONFIG" alter column "GREYLIST_SUBJECT_REGEXPS" type text;
alter table "AO_78C957_CONFIG" alter column "GREYLIST_SENDERS" type text;
alter table "AO_78C957_CONFIG" alter column "GREYLIST_EMAIL_BODY_REGEXP" type text;
alter table "AO_78C957_CONFIG" alter column "JEMH_ADDRESSEE_REGEXPS" type text;
alter table "AO_78C957_CONFIG" alter column "SUBJECT_CLEANUP_REGEXPS" type text;
alter table "AO_78C957_CONFIG" alter column "WHITELIST_SENDERS" type text;
commit;

SqlServer

alter table AO_78C957_AUDITEVENTS alter column TO_ADDRESS text;
alter table AO_78C957_AUDITEVENTS alter column CC_ADDRESS text;
alter table AO_78C957_AUDITEVENTS alter column EMAIL_SUBJECT text;

alter table AO_78C957_CONFIG alter column BLACKLIST_SENDERS text;
alter table AO_78C957_CONFIG alter column BLACKLIST_RECIPIENTS text;
alter table AO_78C957_CONFIG alter column BLACKLISTED_ATTACHMENT_TYPES text;
alter table AO_78C957_CONFIG alter column BODY_DELIMITER_REGEXPS text;
alter table AO_78C957_CONFIG alter column CREATE_USERS_EMAIL_BLACKLIST text;
alter table AO_78C957_CONFIG alter column CREATE_USERS_EMAIL_WHITELIST text;
alter table AO_78C957_CONFIG alter column CATCH_EMAIL_ADDRESS text;
alter table AO_78C957_CONFIG alter column GREYLIST_SUBJECT_REGEXPS text;
alter table AO_78C957_CONFIG alter column GREYLIST_SENDERS text;
alter table AO_78C957_CONFIG alter column GREYLIST_EMAIL_BODY_REGEXP text;
alter table AO_78C957_CONFIG alter column JEMH_ADDRESSEE_REGEXPS" text;
alter table AO_78C957_CONFIG alter column SUBJECT_CLEANUP_REGEXPS text;
alter table AO_78C957_CONFIG alter column WHITELIST_SENDERS text;
commit;

...