Hanging transits can cause checkins to fail

Bug #1819542 reported by Michele Morgan on 2019-03-11
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Evergreen
Undecided
Unassigned

Bug Description

If a Checked out item with a hanging transit is checked in, and needs to go in transit, the checkin will fail with no visual indication to the user. Logs show an error creating the transit:

2019-03-11 13:14:23 brick1 open-ils.circ: [ERR :93454:CStoreEditor.pm:139:15523243949351311] editor[1|61] request error open-ils.cstore.direct.action.hold_transit_copy.create : <new object> : Exception: OpenSRF::DomainObject::oilsMethodException 2019-03-11T17:14:23 OpenILS::Utils::CStoreEditor /usr/local/share/perl/5.20.2/OpenILS/Utils/CStoreEditor.pm:465 <500> INSERT error -- please see the error log for more details

Bug 1787274 resolved many issues where duplicate transits were being created at checkin. Part of this fix was adding a unique-per-copy constraint to action.transit_copy. Unfortunately, other circumstances can lead to hanging transits where an item has an associated open transit, but does not have In transit status. The following query can be used to identify such items.

select copy.id, copy.status, transit.id from action.transit_copy transit
join asset.copy copy on transit.target_copy = copy.id
where copy.deleted is false
and copy.status != 6
and transit.dest_recv_time is null
and transit.cancel_time is null

Since a given item can have only one active transit at a time, perhaps a check for an existing transit could be performed, and if found could be cancelled prior to attempting to create a new transit.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers