queue-daemon crashes with set_debug_mode command not found #207

Closed
opened 2026-04-07 10:02:09 +02:00 by shoko · 0 comments
Owner

Problem

The queue daemon fails to process tasks and crashes immediately when starting, leaving a stale PID file.

Error Log

kugetsu queue-daemon start
Queue daemon started (PID: 5028)
kugetsu queue-daemon status
Queue daemon is not running (stale PID file).

Root Cause

The cmd_continue function in kugetsu-session.sh calls set_debug_mode (line 395), but set_debug_mode is only defined in the main kugetsu script (line 1038).

When the queue daemon runs kugetsu-queue-daemon.sh, it sources kugetsu-session.sh directly without sourcing the main kugetsu script first. This means set_debug_mode is undefined when cmd_continue tries to use it:

/home/shoko/.local/bin/kugetsu-session.sh: line 395: set_debug_mode: command not found

This error causes the daemon to crash immediately when trying to process its first task.

Discovery

  1. The delegate log showed the error: set_debug_mode: command not found
  2. Traced the error to kugetsu-session.sh:395 which calls set_debug_mode
  3. Found set_debug_mode is defined in kugetsu main script but not in kugetsu-session.sh
  4. The queue daemon sources kugetsu-session.sh directly at line 110, without the main kugetsu context

Fix

Add set_debug_mode function to kugetsu-session.sh before cmd_continue.

## Problem The queue daemon fails to process tasks and crashes immediately when starting, leaving a stale PID file. ## Error Log ``` kugetsu queue-daemon start Queue daemon started (PID: 5028) kugetsu queue-daemon status Queue daemon is not running (stale PID file). ``` ## Root Cause The `cmd_continue` function in `kugetsu-session.sh` calls `set_debug_mode` (line 395), but `set_debug_mode` is only defined in the main `kugetsu` script (line 1038). When the queue daemon runs `kugetsu-queue-daemon.sh`, it sources `kugetsu-session.sh` directly without sourcing the main `kugetsu` script first. This means `set_debug_mode` is undefined when `cmd_continue` tries to use it: ``` /home/shoko/.local/bin/kugetsu-session.sh: line 395: set_debug_mode: command not found ``` This error causes the daemon to crash immediately when trying to process its first task. ## Discovery 1. The delegate log showed the error: `set_debug_mode: command not found` 2. Traced the error to `kugetsu-session.sh:395` which calls `set_debug_mode` 3. Found `set_debug_mode` is defined in `kugetsu` main script but not in `kugetsu-session.sh` 4. The queue daemon sources `kugetsu-session.sh` directly at line 110, without the main `kugetsu` context ## Fix Add `set_debug_mode` function to `kugetsu-session.sh` before `cmd_continue`.
shoko closed this issue 2026-04-07 10:39:41 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: shoko/kugetsu#207