Koha-clms/C4/SIP
Tomás Cohen Arazi 220fdce180
Bug 40915: Add enhanced debug logging for empty critical fields in SIP message parsing
This patch adds debug logging to C4::SIP::Sip::MsgType::_initialize() to help
identify when critical fields (patron_id, item_id) are parsed as empty values.

Empty critical fields in SIP messages can later cause DBIx::Class constraint
errors when passed to Koha::Objects->find() operations, generating confusing
'Odd number of elements in anonymous hash' errors in SIP server logs.

The enhanced logging helps administrators identify the root cause by logging
when empty patron_id or item_id fields are detected during message parsing.

To test:
1. Apply regression tests patch first
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/SIP/MsgType.t
=> FAIL: Debug logging tests fail (no enhanced logging present)
3. Apply this patch
4. Run:
   $ ktd --shell
  k$ prove t/db_dependent/SIP/MsgType.t
=> SUCCESS: All tests pass, debug logging works correctly
5. Sign off :-D

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-09 14:58:31 -06:00
..
ILS Bug 34596: Add rebuild queue where needed for existing calls to AddReturn 2025-10-06 09:15:17 -06:00
Sip Bug 40915: Add enhanced debug logging for empty critical fields in SIP message parsing 2025-10-09 14:58:31 -06:00
ILS.pm Bug 39325: Automatic fix 2025-04-28 18:51:22 +02:00
Logger.pm Bug 26673: Remove shebangs from Perl modules 2020-10-26 00:14:42 +01:00
Makefile
…
README Bug 15253: Rename syslog() to siplog() 2020-05-12 11:46:46 +01:00
SIPServer.pm Bug 40270: Fix uninitialized value warnings in SIP logging 2025-08-01 13:22:36 -06:00
Sip.pm Bug 40675: Fix SIP message corruption from embedded line endings 2025-09-19 08:42:47 -06:00
Trapper.pm Bug 39911: Remove redundant warn 2025-06-13 13:09:41 -06:00

README

README for Open NSIP 3M-SIP Server

DEPENDENCIES

SIPServer is written entirely in Perl, but it require these CPAN
perl modules to run:

     Net::Server - The SIP server is a Net::Server::Prefork server
     XML::LibXML
     XML::Parser
     XML::Simple - for parsing the config file
     UNIVERSAL::require - for loading the correct ILS interface module
     Clone - for running the test cases

LOGGING

SIPServer uses Koha::Logger for status and debugging messages.