Time zone transition (UTC+2) causing COM AUDIT_TRAIL issues

58 views
Skip to first unread message

Xavier Rodríguez

unread,
11:08 AM (4 hours ago) 11:08 AM
to CAS Community
Our CAS server is running in the CET time zone. Therefore:
   - UTC + 1 in winter time.
   - UTC + 2 in summer time.

Following the transition from winter to summer time (UTC+1 to UTC+2) this Saturday, March 29, the CAS Tomcat server recorded the following logs:

Exception in thread "" org.springframework.dao.DataIntegrityViolationException: PreparedStatementCallback;

SQL [INSERT INTO COM_AUDIT_TRAIL (AUD_USER,AUD_CLIENT_IP,AUD_SERVER_IP,AUD_RESOURCE,AUD_ACTION,APPLIC_CD,AUD_DATE,AUD_GEOLOCATION,AUD_TENANT,AUD_USERAGENT,AUD_LOCALE,AUD_HEADERS,AUD_EXTRA_INFO)
VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?)]; ORA-01878: specified field not found in datetime or interval

https://docs.oracle.com/error-help/db/ora-01878/

      -> ORA-01878 occurs during DST changes when a local timestamp does not exist. In Europe/Madrid, the clock jumps from 02:00 to 03:00, so times like 02:30 are invalid.
         Oracle Database raises this error because it cannot map a non-existent local time.

From this transition from winter to summer time, when the audit is saved to the COM_ADIT_TRAIL, in the field:

   AUD_DATE TIMESTAMP(6) WITH TIME ZONE

From this point on, no more entries are saved in the COM_AUDIT_TRAIL. This is because the CAS server try to save the aut_date in the audit in UTC+2, but it is incorrectly marked with an offset + 2.

This happens because when changing the time, the following action is taken:

29/03/26 02:00:01,555754000 EUROPE/MADRID -> (03/29/26 02:00:01,555754000 +02:00)

And the Oracle database does not accept saving it with an invalid date. And this produces this error.

When this action has actually been executed and should be saved as:

29/03/26 03:59:50,555754000 EUROPE/MADRID

This problem would not have arisen.

It is related and explained in:

    https://mail.google.com/mail/u/0/#inbox/FMfcgzQfBspgnnhGtsTqRvrnjFBmkCQb

And we didn't have anything inserted into COM_AUDIT_TRAIL until I restarted Tomcat this morning. This is a problem, as we lost all the events we were auditing in the database, from the server time change this Saturday, until the Tomcat restart.

For example, this can also be seen in the following query, in an action executed today, at 11:47:46.

SELECT aud_date, SYS_EXTRACT_UTC(aud_date) AS utc_time FROM com_audit_trail where id=1111111;

aud_date                                                                               utc_time
30/03/26 09:47:46,636498000 EUROPE/MADRID 30/03/26 07:47:46,636498000

Please, any help??

Regards!
Reply all
Reply to author
Forward
0 new messages