When sending a fee paid message to SIP2 with an unknown patron id it will respond with an empty response followed by dropping the connection to a client. to test on ktd (23.11): a) perl /usr/share/koha/bin/sip_cli_emulator.pl -a 127.0.0.1 -p 6001 -su term1 -sp term1 -l CPL --patron 2352900100046 -m fee_paid --fee-type FT --fee-amount 0.01 The reason for this is in C4/SIP/ILS.pm pay_fee as it calls return $trans; if no patron is found.
Created attachment 165436 [details] [review] BUG 36676 When sending a fee paid message to SIP2 with an unknown patron id it will respond with an empty response followed by dropping the connection to a client. to test on ktd (23.11): a) perl /usr/share/koha/bin/sip_cli_emulator.pl -a 127.0.0.1 -p 6001 -su term1 -sp term1 -l CPL --patron 2352900100046 -m fee_paid --fee-type FT --fee-amount 0.01 Output: Trying 'fee_paid' SEND: 3720240423 124447FT00USDBV0.01|AO|AA2352900100046|ACterm1| Use of uninitialized value $data in concatenation (.) or string at /usr/share/koha/bin/sip_cli_emulator.pl line 355, <GEN0> chunk 1. READ: b) apply patch c) perl /usr/share/koha/bin/sip_cli_emulator.pl -a 127.0.0.1 -p 6001 -su term1 -sp term1 -l CPL --patron 2352900100046 -m fee_paid --fee-type FT --fee-amount 0.01 Output: Trying 'fee_paid' SEND: 3720240423 125602FT00USDBV0.01|AO|AA2352900100046|ACterm1| READ: 38N20240423 125602AO|AA2352900100046|AFInvalid patron barcode.|
I've tested under 23.11 and the patch works as per the test plan. However, on main, I can't seem to run the emulator - not quite sure why as it has worked fine in the past when testing other bugs: perl /usr/share/koha/bin/sip_cli_emulator.pl -a 127.0.0.1 -p 6001 -su term1 -sp term1 -l CPL --patron 2352900100046 -m fee_paid --fee-type FT --fee-amount 0.01 Attempting socket connection to 127.0.0.1:6001...failed! : Connection refused The bug title and description need to be changed as per the commit message guidelines https://wiki.koha-community.org/wiki/Commit_messages - Bug 36676: Short title Short description about what the bug fixes. Test plan: .... In addition, should this change be made to main (previously master) as well?
Created attachment 165652 [details] [review] BUG 36676: SIP2 drops connection on unknown patron id in fee paid message When sending a fee paid message to SIP2 with an unknown patron id it will respond with an empty response followed by dropping the connection to a client. to test on ktd (23.11): a) perl /usr/share/koha/bin/sip_cli_emulator.pl -a 127.0.0.1 -p 6001 -su term1 -sp term1 -l CPL --patron 2352900100046 -m fee_paid --fee-type FT --fee-amount 0.01 Output: Trying 'fee_paid' SEND: 3720240423 124447FT00USDBV0.01|AO|AA2352900100046|ACterm1| Use of uninitialized value $data in concatenation (.) or string at /usr/share/koha/bin/sip_cli_emulator.pl line 355, <GEN0> chunk 1. READ: b) apply patch c) perl /usr/share/koha/bin/sip_cli_emulator.pl -a 127.0.0.1 -p 6001 -su term1 -sp term1 -l CPL --patron 2352900100046 -m fee_paid --fee-type FT --fee-amount 0.01 Output: Trying 'fee_paid' SEND: 3720240423 125602FT00USDBV0.01|AO|AA2352900100046|ACterm1| READ: 38N20240423 125602AO|AA2352900100046|AFInvalid patron barcode.|
Created attachment 165653 [details] [review] BUG 36676: SIP2 drops connection on unknown patron id in fee paid message When sending a fee paid message to SIP2 with an unknown patron id it will respond with an empty response followed by dropping the connection to a client. to test on ktd (23.11): a) perl /usr/share/koha/bin/sip_cli_emulator.pl -a 127.0.0.1 -p 6001 -su term1 -sp term1 -l CPL --patron 2352900100046 -m fee_paid --fee-type FT --fee-amount 0.01 Output: Trying 'fee_paid' SEND: 3720240423 124447FT00USDBV0.01|AO|AA2352900100046|ACterm1| Use of uninitialized value $data in concatenation (.) or string at /usr/share/koha/bin/sip_cli_emulator.pl line 355, <GEN0> chunk 1. READ: b) apply patch c) perl /usr/share/koha/bin/sip_cli_emulator.pl -a 127.0.0.1 -p 6001 -su term1 -sp term1 -l CPL --patron 2352900100046 -m fee_paid --fee-type FT --fee-amount 0.01 Output: Trying 'fee_paid' SEND: 3720240423 125602FT00USDBV0.01|AO|AA2352900100046|ACterm1| READ: 38N20240423 125602AO|AA2352900100046|AFInvalid patron barcode.|
(In reply to David Nind from comment #2) > I've tested under 23.11 and the patch works as per the test plan. > > However, on main, I can't seem to run the emulator - not quite sure why as > it has worked fine in the past when testing other bugs: > > perl /usr/share/koha/bin/sip_cli_emulator.pl -a 127.0.0.1 -p 6001 -su term1 > -sp term1 -l CPL --patron 2352900100046 -m fee_paid --fee-type FT > --fee-amount 0.01 > Attempting socket connection to 127.0.0.1:6001...failed! : Connection refused > > The bug title and description need to be changed as per the commit message > guidelines https://wiki.koha-community.org/wiki/Commit_messages > > - Bug 36676: Short title > > Short description about what the bug fixes. > > Test plan: > .... > > In addition, should this change be made to main (previously master) as well? Hi David, I was testing in 23.11. but yes, I think it should be made to main as well. I also changed the patch title. There is still a lack of routine on writing patches from my side ;)
Thanks Jan!
I can't currently get the SIP emulator to work in KTD (when on main). I'll come back to this one (and other SIP bugs) once I get it working.
Hi David, I have the same problem on getting SIP-Server running on ktd (main). Commenting out the following service in /etc/koha/sites/kohadev/SIPconfig.xml solved the problem for me: <!-- <service port="8023/tcp" transport="telnet" protocol="SIP/2.00" timeout="60" /> -->
Created attachment 166182 [details] [review] Bug 36676: SIP2 drops connection on unknown patron id in fee paid message When sending a fee paid message to SIP2 with an unknown patron id it will respond with an empty response followed by dropping the connection to a client. Test plan: a) perl /usr/share/koha/bin/sip_cli_emulator.pl -a 127.0.0.1 -p 6001 -su term1 -sp term1 -l CPL --patron 2352900100046 -m fee_paid --fee-type FT --fee-amount 0.01 Output: Trying 'fee_paid' SEND: 3720240423 124447FT00USDBV0.01|AO|AA2352900100046|ACterm1| Use of uninitialized value $data in concatenation (.) or string at /usr/share/koha/bin/sip_cli_emulator.pl line 355, <GEN0> chunk 1. READ: b) apply patch c) perl /usr/share/koha/bin/sip_cli_emulator.pl -a 127.0.0.1 -p 6001 -su term1 -sp term1 -l CPL --patron 2352900100046 -m fee_paid --fee-type FT --fee-amount 0.01 Output: Trying 'fee_paid' SEND: 3720240423 125602FT00USDBV0.01|AO|AA2352900100046|ACterm1| READ: 38N20240423 125602AO|AA2352900100046|AFInvalid patron barcode.| Signed-off-by: David Nind <david@davidnind.com>
Comment on attachment 165653 [details] [review] BUG 36676: SIP2 drops connection on unknown patron id in fee paid message Thanks Jan! That worked for me as well. Thank you for figuring it out! I've signed off. (I also updated the commit message slightly.) David Note: backport required to at least 23.11 Response before applying the patch on main ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ misc/sip_cli_emulator.pl -a 127.0.0.1 -p 6001 -su term1 -sp term1 -l CPL --patron 2352900100046 -m fee_paid --fee-type FT --fee-amount 0.01 Attempting socket connection to 127.0.0.1:6001...connected! Use of uninitialized value $hold_mode in string eq at misc/sip_cli_emulator.pl line 123. SEND: 9300CNterm1|COterm1|CPCPL| READ: 941 Trying 'fee_paid' SEND: 3720240506 071820FT00USDBV0.01|AO|AA2352900100046|ACterm1| Use of uninitialized value $data in concatenation (.) or string at misc/sip_cli_emulator.pl line 355, <GEN0> chunk 1. READ: Response after applying the patch ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./misc/sip_cli_emulator.pl -a 127.0.0.1 -p 6001 -su term1 -sp term1 -l CPL --patron 2352900100046 -m fee_paid --fee-type FT --fee-amount 0.01 Attempting socket connection to 127.0.0.1:6001...connected! Use of uninitialized value $hold_mode in string eq at ./misc/sip_cli_emulator.pl line 123. SEND: 9300CNterm1|COterm1|CPCPL| READ: 941 Trying 'fee_paid' SEND: 3720240506 072000FT00USDBV0.01|AO|AA2352900100046|ACterm1| READ: 38N20240506 072000AO|AA2352900100046|AFInvalid patron barcode.|
Created attachment 166530 [details] [review] Bug 36676: SIP2 drops connection on unknown patron id in fee paid message When sending a fee paid message to SIP2 with an unknown patron id it will respond with an empty response followed by dropping the connection to a client. Test plan: a) perl /usr/share/koha/bin/sip_cli_emulator.pl -a 127.0.0.1 -p 6001 -su term1 -sp term1 -l CPL --patron 2352900100046 -m fee_paid --fee-type FT --fee-amount 0.01 Output: Trying 'fee_paid' SEND: 3720240423 124447FT00USDBV0.01|AO|AA2352900100046|ACterm1| Use of uninitialized value $data in concatenation (.) or string at /usr/share/koha/bin/sip_cli_emulator.pl line 355, <GEN0> chunk 1. READ: b) apply patch c) perl /usr/share/koha/bin/sip_cli_emulator.pl -a 127.0.0.1 -p 6001 -su term1 -sp term1 -l CPL --patron 2352900100046 -m fee_paid --fee-type FT --fee-amount 0.01 Output: Trying 'fee_paid' SEND: 3720240423 125602FT00USDBV0.01|AO|AA2352900100046|ACterm1| READ: 38N20240423 125602AO|AA2352900100046|AFInvalid patron barcode.| Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Pushed for 24.05! Well done everyone, thank you!
Looks like this is since Bug 23051 that changed return
Pushed to 23.11.x for 23.11.06
Backported to 23.05.x for upcoming 23.05.12