Data truncation error for column new_value

gmbroth
Kilo Contributor

Hi,

I'm seeing the following error message on Knowledge-related forms (Knowledge Article, Feedback):

General Data Exception detected by database (Data truncation: Data too long for column 'new_value' at row 1)

I haven't seen the error on any v3 Knowledge Base article but we carried over a bunch of v2 articles when upgrading to Fuji and am seeing it there. It doesn't happen consistently, I can't find a pattern as to when it will occur and when the error message is displayed, the form continues to work correctly, i.e., there's no loss of functionality.

I do see that column new_value (String, 40) exists on several audit tables (sys_history_line, sys_history_line0000, etc.) and so can guess this is an audit-related issue but don't know how to make it stop. Help, please?

Thanks, Garry

1 REPLY 1

gmbroth
Kilo Contributor

I'm answering my own question here. When hosting your own MySQL database, be certain to not specify mode STRICT_TRANS_TABLES. Under certain conditions, ServiceNow's auditing logic will attempt to write a too-large value to an audit table column and if STRICT_TRANS_TABLES is enabled, will generate an error and create no audit entry. If disabled, MySQL will issue a warning, truncate the value to fit the column and create the audit entry.