Queue daemon crashes on every task — silent failure loop #174
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Queue daemon crashes on every task due to two bugs that cause a silent failure loop. Tasks are immediately marked
errorand the daemon cycles endlessly.Bugs
Bug 1 — kugetsu-log.sh:54 json.loads with newlines
File:
kugetsu-log.sh,kugetsu_add_notification()function.Root cause: Notifications JSON is embedded in a single-quoted Python string literal, but it contains newlines which break the Python parser:
When
$notificationscontains JSON with newlines (which it always does after the first notification), Python sees:Additional Bugs Found
Bug 2 — logs directory not created
File:
kugetsu-queue-daemon.shline 114/125.$log_file=~/.kugetsu/logs/delegate-<timestamp>.logbut thelogs/directory is never created duringkugetsu init. Result:Every task immediately fails because the log file cannot be written.
Fix: Add
mkdir -p ~/.kugetsu/logs/duringkugetsu initor in the daemon startup.Bug 3 — issue_ref parsed incorrectly from URL format
File:
kugetsuscript,parse_issue_ref_from_message()function.When delegating with a full URL like:
The parsed
issue_refbecomes:Instead of the correct format:
Root cause:
parse_issue_ref_from_message()only handles the#numberformat at the end of messages. The/issues/NUMBERURL pattern gets the instance stripped and/issues/kept in the path.Fix: Add explicit handling for
instance/user/repo/issues/NUMBERURL pattern.