Bug 25992 - SIP2 server doesn't start - Undefined subroutine set_logger
Summary: SIP2 server doesn't start - Undefined subroutine set_logger
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: SIP2 (show other bugs)
Version: Main
Hardware: All All
: P5 - low critical (vote)
Assignee: Joonas Kylmälä
QA Contact: Tomás Cohen Arazi
URL:
Keywords:
Depends on: 15253
Blocks:
  Show dependency treegraph
 
Reported: 2020-07-15 11:08 UTC by Joonas Kylmälä
Modified: 2021-12-13 21:09 UTC (History)
7 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.11.00, 20.05.03


Attachments
Bug 25992: Make SIP2 logger subroutines exportable to prevent crash (1.23 KB, patch)
2020-07-15 11:39 UTC, Joonas Kylmälä
Details | Diff | Splinter Review
Bug 25992: Make SIP2 logger subroutines exportable to prevent crash (1.29 KB, patch)
2020-07-15 11:57 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 25992: Make SIP2 logger subroutines exportable to prevent crash (1.34 KB, patch)
2020-07-15 12:46 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Joonas Kylmälä 2020-07-15 11:08:07 UTC
After the SIP2 server refactoring in Bug 15253 the sip2 server doesn't start anymore because of this error:

> Undefined subroutine &C4::SIP::SIPServer::set_logger called at /kohadevbox/koha/C4/SIP/SIPServer.pm
Comment 1 Joonas Kylmälä 2020-07-15 11:39:36 UTC
Created attachment 106928 [details] [review]
Bug 25992: Make SIP2 logger subroutines exportable to prevent crash

If the subroutines are not exportable we get the following crash:

> Undefined subroutine &C4::SIP::SIPServer::set_logger

To test:
 In kohadevbox run for example:
 $ ps -aux # check that no existing sip server is running, kill the process if exists
 $ perl /kohadevbox/koha/C4/SIP/SIPServer.pm /etc/koha/sites/kohadev/SIPconfig.xml
 $ koha/misc/sip_cli_emulator.pl -su koha -sp koha -l CPL -a 127.0.0.1 -p 6001 --item 3999900000001 -m item_information

 After applying this patch the Undefined subroutine error should be gone.
 Note: when using the sip_cli_emulator.pl the credentials can be anything.
Comment 2 Nick Clemens 2020-07-15 11:57:29 UTC
Created attachment 106929 [details] [review]
Bug 25992: Make SIP2 logger subroutines exportable to prevent crash

If the subroutines are not exportable we get the following crash:

> Undefined subroutine &C4::SIP::SIPServer::set_logger

To test:
 In kohadevbox run for example:
 $ ps -aux # check that no existing sip server is running, kill the process if exists
 $ perl /kohadevbox/koha/C4/SIP/SIPServer.pm /etc/koha/sites/kohadev/SIPconfig.xml
 $ koha/misc/sip_cli_emulator.pl -su koha -sp koha -l CPL -a 127.0.0.1 -p 6001 --item 3999900000001 -m item_information

 After applying this patch the Undefined subroutine error should be gone.
 Note: when using the sip_cli_emulator.pl the credentials can be anything.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 3 Tomás Cohen Arazi 2020-07-15 12:46:52 UTC
Created attachment 106933 [details] [review]
Bug 25992: Make SIP2 logger subroutines exportable to prevent crash

If the subroutines are not exportable we get the following crash:

> Undefined subroutine &C4::SIP::SIPServer::set_logger

To test:
 In kohadevbox run for example:
 $ ps -aux # check that no existing sip server is running, kill the process if exists
 $ perl /kohadevbox/koha/C4/SIP/SIPServer.pm /etc/koha/sites/kohadev/SIPconfig.xml
 $ koha/misc/sip_cli_emulator.pl -su koha -sp koha -l CPL -a 127.0.0.1 -p 6001 --item 3999900000001 -m item_information

 After applying this patch the Undefined subroutine error should be gone.
 Note: when using the sip_cli_emulator.pl the credentials can be anything.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 4 Jonathan Druart 2020-07-15 15:01:47 UTC
We are missing a test here, it's not normal to get this situation on stable branches. It won't block the push but it's worth investigating what could be done to make sure we won't face it anymore.
Comment 5 Tomás Cohen Arazi 2020-07-15 15:03:39 UTC
I've been looking at the lack of tests issue. The only way I found to test this is by using the emulator.
I think we need to revisit SIP altogether to allow proper testing, but marked this one PQA for being a trivial fix.
Comment 6 Martin Renvoize 2020-07-16 14:41:23 UTC
Pushed to master for 20.11, thanks everyone.
Comment 7 Lucas Gass 2020-07-24 20:37:32 UTC
backported to 20.05.x for 20.05.03
Comment 8 Aleisha Amohia 2020-08-03 20:23:28 UTC
missing dependencies, not backported to 19.11.x