Bug 41707 - The DIE handler in C4::SIP::Trapper is logging non-SIP errors, causing log flooding.
Summary: The DIE handler in C4::SIP::Trapper is logging non-SIP errors, causing log fl...
Status: Needs Signoff
Alias: None
Product: Koha
Classification: Unclassified
Component: SIP2 (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Johanna Räisä
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-01-26 09:05 UTC by Johanna Räisä
Modified: 2026-01-27 11:50 UTC (History)
2 users (show)

See Also:
GIT URL:
Initiative type: ---
Sponsorship status: ---
Comma delimited list of Sponsors:
Crowdfunding goal: 0
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 41707: Modify C4::SIP::Trapper DIE handling for better logging (4.93 KB, patch)
2026-01-27 11:50 UTC, Johanna Räisä
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Johanna Räisä 2026-01-26 09:05:52 UTC
The DIE handler should be more restrictive and only log errors where the call stack clearly originates from SIP modules (e.g., C4::SIP::*). The current implementation is not strict enough or may have edge cases. Found this kind of errors from our logs:

[2026/01/23 13:42:47] [493898] [ERROR] [undef]@[undef]: commandline was not set during initialization at /usr/share/perl5/Net/Server.pm line 100.
 C4::SIP::Trapper::__ANON__ /home/koha/Koha/C4/SIP/Trapper.pm (70)
Comment 1 Johanna Räisä 2026-01-27 11:50:13 UTC
Created attachment 192093 [details] [review]
Bug 41707: Modify C4::SIP::Trapper DIE handling for better logging

This patch improves the error handling in the SIP Trapper module by
logging only SIP-related errors as errors and non-SIP errors as warnings. This
change aims to reduce noise in the logs and make it easier to identify
genuine SIP-related issues.

Test plan:
1. Apply the patch
2. prove -lv t/db_dependent/SIP/Trapper.t
3. Ensure all tests pass without errors
4. Start the server: perl C4/SIP/SIPServer.pm /etc/koha/SIPconfig.xml
5. misc/sip_cli_emulator.pl -a 127.0.0.1 -p 6001 -su koha -sp koha -l MPL --patron koha -m patron_information
6. Verify that only SIP-related errors are logged as errors and non-SIP errors are warned.

Sponsored-by: Koha-Suomi Oy