Bug 1342977 - Repository sync can causes ORA-01878 on insertion of timestamp that doesn't exist in timezone
Summary: Repository sync can causes ORA-01878 on insertion of timestamp that doesn't e...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Spacewalk
Classification: Community
Component: Server
Version: 2.4
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Eric Herget
QA Contact: Red Hat Satellite QA List
URL:
Whiteboard:
Depends On:
Blocks: space27
TreeView+ depends on / blocked
 
Reported: 2016-06-06 09:21 UTC by Laurence Rochfort
Modified: 2017-09-27 19:09 UTC (History)
2 users (show)

Fixed In Version: spacewalk-backend-2.7.85-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-09-27 19:09:07 UTC
Embargoed:


Attachments (Terms of Use)

Description Laurence Rochfort 2016-06-06 09:21:27 UTC
Description of problem: 
Triggering a repository sync from the web UI can cause an ORA-01878 if an rhnPacakgeFile contains a file mtime timestamp that doesn't exist in the system timezone due to it being during the skipped hour at DST transition.

The rhnPackageFile mtime epoch timestamp is being converted to UTC and supplied to the DB, but the DB expects all timestamps to be in local time. The DB interprets the timestamp as localtime, and for some mtime values this corresponds to times that "do not exist" in the system timezone because they are skipped during DST transition.


Version-Release number of selected component (if applicable): 
2.4


How reproducible: 
Quite rare. Requires that a file in an RPM be modified during a time that that when translated to UTC is during the non-existent DST transition hour for system timezone.


Steps to Reproduce:
1. Set system timezone to one that undergoes DST transition.
2. Create RPM with file mtime that when translated to UTC is during the non-existent DST transition hour for system timezone.
3. Add to repo for sync.
4. Sync repo.

Actual results:
ORA-01878: specified field not found in datetime or interval


Expected results:
Successful sync


Additional info:
This only happens from the web UI because Taskomatic sets the DB session timezone to localtime. When spacewalk-repo-sync is run from the cmdline, it doesn't happen because the DB session timezone is set to the UTC offset, not an Olsen timezone.

Comment 1 Laurence Rochfort 2016-06-06 09:36:31 UTC
System timezone needs to be set to an Olson timezone for this to trigger, simply setting to a UTC offset isn't sufficient because offsets don't have any DST transition information.

Comment 2 Laurence Rochfort 2017-03-28 11:13:32 UTC
https://github.com/spacewalkproject/spacewalk/pull/520

Comment 3 Eric Herget 2017-04-28 15:06:50 UTC
spacewalk.github:
b3e707a4f43deee374c7ccea165e75a66038ce60

Comment 4 Eric Herget 2017-04-28 16:55:07 UTC
fixed python 2.4 build issue for rhel5

spacewalk.github:
3b3d14474640374c6a8aa9e2d2dce40c67878983

spacewalk-backend-2.7.87-1

Comment 5 Eric Herget 2017-09-27 19:09:07 UTC
Spacewalk 2.7 has been released.

https://github.com/spacewalkproject/spacewalk/wiki/ReleaseNotes27


Note You need to log in before you can comment on or make changes to this bug.