[Bug 31124] New: koha-remove fails to remove long_tasks queue daemon, so koha-create for same <instance> user fails
From the command line as a koha shell user:
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31124 Bug ID: 31124 Summary: koha-remove fails to remove long_tasks queue daemon, so koha-create for same <instance> user fails Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Keywords: rel_22_05_candidate Severity: major Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: matted-34813@mypacks.net QA Contact: testopia@bugs.koha-community.org 1) koha-remove <instance> fails to remove the backgroundjobs / long_tasks(queue) daemon. (ps -aef | grep long_tasks) So when it tries to "deluser" the <instance>-koha user from /etc/passwd that errors because a process is still running for that user's PID. 2) koha-create <instance> fails for that same instance name from that point onward. 3) koha-worker --help doesn't show any --queue option Cursory investigation shows: --queue support was added in version 22.05 to koha-worker. koha-worker --stop --queue long-tasks <instancename> works to shut down that specified queue. --status and --start are also supported. Suggested Fix: 1) koha-remove needs to have an entry added: koha-worker --stop --queue long_tasks <instancename> added accordingly to get that process to stop so the latter deluser will succeed. 2) koha-worker needs: the --queue option should be added to the --help / POD Also, koha-worker --help should at least show: Usage: koha-worker [--start|--stop|--restart] [--quiet|-q] [--queue <queuename>] instancename1 [instancename2...] and also: --queue <queuename> Specify a queue name One should be able to be able(test plan): test 1) koha-remove kohadev koha-create --create-db kohadev koha-remove kohadev without problems in the ktd or other test environment to be fixed. test 2) Also, koha-worker --help should at least show: Usage: koha-worker [--start|--stop|--restart] [--quiet|-q] [--queue <queuename>] instancename1 [instancename2...] and also: --queue <queuename> Specify a queue name -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31124 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@ptfs-europe | |.com, tomascohen@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31124 wajasu <matted-34813@mypacks.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31124 wajasu <matted-34813@mypacks.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |matted-34813@mypacks.net |ity.org | -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31124 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31124 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|rel_22_05_candidate | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31124 Magnus Enger <magnus@libriotech.no> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |magnus@libriotech.no --- Comment #1 from Magnus Enger <magnus@libriotech.no> --- (In reply to wajasu from comment #0)
2) koha-worker needs: the --queue option should be added to the --help / POD
Also, koha-worker --help should at least show: Usage: koha-worker [--start|--stop|--restart] [--quiet|-q] [--queue <queuename>] instancename1 [instancename2...] and also: --queue <queuename> Specify a queue name
I think this was added to the script itself here: https://git.koha-community.org/Koha-community/Koha/commit/486d78f544f1fe074d... And to the "man" page here: https://git.koha-community.org/Koha-community/Koha/commit/f1fef6527c778977bd... The problem with the long_tasks still running after koha-remove remains, at least for 22.05.11. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31124 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |35092 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35092 [Bug 35092] [OMNIBUS] Remaining background job/worker issues -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31124 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |24383 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24383 [Bug 24383] koha-create doesn't restart / empty memcached causing installer fail -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31124 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mtj@kohaaloha.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31124 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff Assignee|matted-34813@mypacks.net |tomascohen@gmail.com --- Comment #2 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- This has been sitting for a while. Stealing it as I found it in the wild. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31124 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Trivial patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31124 --- Comment #3 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 182702 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=182702&action=edit Bug 31124: Make koha-remove stop all workers This patch makes two things: * Adds a `get_worker_queues` function to koha-functions.sh * Makes `koha-remove` loop through all the defined queues to stop all the running workers before trying to remove the unix user for the instance. To test: 1. Run: $ ktd --shell k$ sudo -s k$ koha-create test1 k$ service koha-common restart k$ koha-remove test1 => FAIL: There's an error about not being able to drop the instance user 2. Run: k$ ps -ef | grep test1 => FAIL: There's a running process for the 'long_tasks' queue worker. 3. Apply this patch 4. Run: k$ cp debian/scripts/koha-functions.sh \ /usr/share/koha/bin/koha-functions.sh 5. Repeat 1 naming the instance `test2` => SUCCESS: The instance is removed correctly. No error about running processes => SUCCESS: No process is running for `test2` 6. Sign off :-D -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31124 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #182702|0 |1 is obsolete| | --- Comment #4 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 182703 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=182703&action=edit Bug 31124: Make koha-remove stop all workers This patch makes two things: * Adds a `get_worker_queues` function to koha-functions.sh * Makes `koha-remove` loop through all the defined queues to stop all the running workers before trying to remove the unix user for the instance. To test: 1. Run: $ ktd --shell k$ sudo -s k$ koha-create --create-db test1 k$ service koha-common restart k$ koha-remove test1 => FAIL: There's an error about not being able to drop the instance user 2. Run: k$ ps -ef | grep test1 => FAIL: There's a running process for the 'long_tasks' queue worker. 3. Apply this patch 4. Run: k$ cp debian/scripts/koha-functions.sh \ /usr/share/koha/bin/koha-functions.sh 5. Repeat 1 naming the instance `test2` => SUCCESS: The instance is removed correctly. No error about running processes => SUCCESS: No process is running for `test2` 6. Sign off :-D -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31124 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the|koha-remove fixed to fully |This development makes release notes|remove instancename |`koha-remove` stop all |(including instance-user) |worker processes before |so subsequent koha-create |attempting to remove the |can succeed with same |instance's UNIX user. |instancename. | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31124 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |39961 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39961 [Bug 39961] koha-create doesn't start all queues -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31124 --- Comment #5 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- I need to amend the test plan: when repeating the tests in step 5, please run ``` debian/scripts/koha-remove test2 ``` so the new version of the script is used. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31124 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |32736 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32736 [Bug 32736] koha-worker should be able to restart all queues with a single call -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31124 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |robin@catalyst.net.nz Component|Architecture, internals, |Command-line Utilities |and plumbing | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31124 Magnus Enger <magnus@libriotech.no> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31124 Magnus Enger <magnus@libriotech.no> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #182703|0 |1 is obsolete| | --- Comment #6 from Magnus Enger <magnus@libriotech.no> --- Created attachment 182714 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=182714&action=edit Bug 31124: Make koha-remove stop all workers This patch makes two things: * Adds a `get_worker_queues` function to koha-functions.sh * Makes `koha-remove` loop through all the defined queues to stop all the running workers before trying to remove the unix user for the instance. To test: 1. Run: $ ktd --shell k$ sudo -s k$ koha-create --create-db test1 k$ service koha-common restart k$ koha-remove test1 => FAIL: There's an error about not being able to drop the instance user 2. Run: k$ ps -ef | grep test1 => FAIL: There's a running process for the 'long_tasks' queue worker. 3. Apply this patch 4. Run: k$ cp debian/scripts/koha-functions.sh \ /usr/share/koha/bin/koha-functions.sh 5. Repeat 1 naming the instance `test2` => SUCCESS: The instance is removed correctly. No error about running processes => SUCCESS: No process is running for `test2` 6. Sign off :-D Signed-off-by: Magnus Enger <magnus@libriotech.no> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31124 --- Comment #7 from Magnus Enger <magnus@libriotech.no> --- Thanks for fixing this, it has been a bother for quite some time! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31124 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31124 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #182714|0 |1 is obsolete| | --- Comment #8 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 183054 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=183054&action=edit Bug 31124: Make koha-remove stop all workers This patch makes two things: * Adds a `get_worker_queues` function to koha-functions.sh * Makes `koha-remove` loop through all the defined queues to stop all the running workers before trying to remove the unix user for the instance. To test: 1. Run: $ ktd --shell k$ sudo -s k$ koha-create --create-db test1 k$ service koha-common restart k$ koha-remove test1 => FAIL: There's an error about not being able to drop the instance user 2. Run: k$ ps -ef | grep test1 => FAIL: There's a running process for the 'long_tasks' queue worker. 3. Apply this patch 4. Run: k$ cp debian/scripts/koha-functions.sh \ /usr/share/koha/bin/koha-functions.sh 5. Repeat 1 naming the instance `test2` => SUCCESS: The instance is removed correctly. No error about running processes => SUCCESS: No process is running for `test2` 6. Sign off :-D Signed-off-by: Magnus Enger <magnus@libriotech.no> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31124 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl QA Contact|testopia@bugs.koha-communit |m.de.rooy@rijksmuseum.nl |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31124 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to main Version(s)| |25.11.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31124 --- Comment #9 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Nice work everyone! Pushed to main for 25.11 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31124 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|25.11.00 |25.11.00,25.05.01 released in| | Status|Pushed to main |Pushed to stable -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31124 --- Comment #10 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Nice work everyone! Pushed to 25.05.x for 25.05.03 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31124 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m Version(s)|25.11.00,25.05.01 |25.11.00,25.05.01,24.11.08 released in| | Status|Pushed to stable |Pushed to oldstable --- Comment #11 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to 24.11.x for 24.11.08 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31124 Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |wainuiwitikapark@catalyst.n | |et.nz Status|Pushed to oldstable |Needs documenting --- Comment #12 from Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> --- Not backporting to 22.11.x as it wasn't backported to 24.05.x -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org