Bug 22396 - koha-sip script does not start the server correctly
Summary: koha-sip script does not start the server correctly
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Command-line Utilities (show other bugs)
Version: Main
Hardware: All All
: P5 - low major
Assignee: Tomás Cohen Arazi (tcohen)
QA Contact: Jonathan Druart
URL:
Keywords:
Depends on: 18562
Blocks:
  Show dependency treegraph
 
Reported: 2019-02-22 14:13 UTC by Jonathan Druart
Modified: 2020-06-04 20:32 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 22396: Make koha-sip set KOHA_HOME and KOHA_CONF correctly (1.34 KB, patch)
2019-02-22 15:05 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 22396: Make koha-sip set KOHA_HOME and KOHA_CONF correctly (1.42 KB, patch)
2019-02-22 15:14 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2019-02-22 14:13:50 UTC
[vagrant@kohadevbox:~/kohaclone (master) ✭]% sudo koha-sip --verbose --start kohadev

[kohadev-koha@kohadevbox:/home/vagrant/kohaclone (master) ✹ ✭]% misc/sip_cli_emulator.pl -a localhost -p 6001 -su term1 -sp term1 -l CPL --patron 23529000035676 -m patron_information
Attempting socket connection to localhost:6001...connected!
SEND: 9300CNterm1|COterm1|CPCPL|
Use of uninitialized value $data in concatenation (.) or string at misc/sip_cli_emulator.pl line 314.
READ: 
Use of uninitialized value $data in pattern match (m//) at misc/sip_cli_emulator.pl line 265.
Login Failed!

The logs say:
==> /var/log/koha/kohadev/sip-output.log <==
unable to locate Koha configuration file koha-conf.xml at /home/vagrant/kohaclone/C4/Context.pm line 244, <STDIN> line 1.
Can't call method "config" on unblessed reference at /home/vagrant/kohaclone/Koha/Database.pm line 56, <STDIN> line 1.
Comment 1 Jonathan Druart 2019-02-22 14:15:35 UTC
kohadev+ 28268  0.0  0.0  18612   192 ?        S    11:10   0:00 daemon --name=kohadev-koha-sip --errlog=/var/log/koha/kohadev/sip-error.log --stdout=/var/log/koha/kohadev/sip.log --output=/var/log/koha/kohadev/sip-output.log --verbose=1 --respawn --delay=30 --pidfiles=/var/run/koha/kohadev --user=kohadev-koha.kohadev-koha -- perl /home/vagrant/kohaclone/C4/SIP/SIPServer.pm /etc/koha/sites/kohadev/SIPconfig.xml
Comment 2 Tomás Cohen Arazi (tcohen) 2019-02-22 14:59:43 UTC
This is because of a typo and the fact that KOHA_CONF is not set in ENV.
Comment 3 Tomás Cohen Arazi (tcohen) 2019-02-22 15:05:56 UTC
Created attachment 85562 [details] [review]
Bug 22396: Make koha-sip set KOHA_HOME and KOHA_CONF correctly

This patch corrects a typo, and exports KOHA_CONF as other scripts do.

To test:
- Apply this patch
- Run:
  $ # in kohadevbox
  $ perl misc4dev/cp_debian_files.pl
- Try the new script
  $ sudo koha-sip --start kohadev
=> SUCCESS: tail -f /var/log/koha/kohadev/sip* doesn't show fatal errors
anymore
- Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 4 Jonathan Druart 2019-02-22 15:14:22 UTC
Created attachment 85563 [details] [review]
Bug 22396: Make koha-sip set KOHA_HOME and KOHA_CONF correctly

This patch corrects a typo, and exports KOHA_CONF as other scripts do.

To test:
- Apply this patch
- Run:
  $ # in kohadevbox
  $ perl misc4dev/cp_debian_files.pl
- Try the new script
  $ sudo koha-sip --start kohadev
=> SUCCESS: tail -f /var/log/koha/kohadev/sip* doesn't show fatal errors
anymore
- Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 5 Jonathan Druart 2019-02-22 15:16:23 UTC
Trivial, skipping QA.
Comment 6 Nick Clemens (kidclamp) 2019-02-26 14:41:23 UTC
Awesome work all!

Pushed to master for 19.05
Comment 7 Martin Renvoize (ashimema) 2019-03-01 10:59:00 UTC
Pushed to 18.11.x for 18.11.04
Comment 8 Lucas Gass (lukeg) 2019-03-08 17:43:15 UTC
missing 18562 dependency for 18.05.x, wont backport