[GH-ISSUE #1289] [Bug] "execute_container_terminal" randomly fails to execute #2727

Open
opened 2026-04-11 10:34:50 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @bastienlc on GitHub (Mar 28, 2026).
Original GitHub issue: https://github.com/moghtech/komodo/issues/1289

Setting

komodo-core and komodo-periphery running 2.0.0 docker image

Assume a debian:bookworm container is running on "my-server":

docker run --name debug -it debian:bookworm /bin/sh

I'm trying to execute a command on this container using an Action, specifically the execute_container_terminal method of the typescript client. Thus from the UI I create an action with this content:

let shell = "sh"; // sh or bash
let server = "my-server";
let container = "debug";
let command = "date";

await komodo.execute_container_terminal(
  {
    server,
    container,
    command,
    init: { command: shell, recreate: "Always" },
  },
  {
    onLine: (line) => {
      console.log(line);
    },
    onFinish: (code) => {
      console.log(`Command finished with exit code ${code}`);
    },
  },
);

Expected behavior

Using bash or sh, executing the action succeeds and the following output is produced:


Sat Mar 28 20:31:22 UTC 2026

Command finished with exit code 0
🦎 Action completed successfully 🦎

Actual behavior

Sometimes the command is executed incorrectly, resulting in the following output:


'; date; rc=$?; printf '
Command finished with exit code %d
🦎 Action completed successfully 🦎

I have not been able to pinpoint exactly what causes this behavior to occur, currently it seems random.

Initial analysis

While I'm not familiar with the komodo source code, the issue seems to stem from this snippet:
0f96794559/bin/periphery/src/api/terminal.rs (L466-L468)

Edits

  • Updated behavior from "succeeds with bash but fails with sh" to "randomly fails"
Originally created by @bastienlc on GitHub (Mar 28, 2026). Original GitHub issue: https://github.com/moghtech/komodo/issues/1289 ## Setting *komodo-core and komodo-periphery running 2.0.0 docker image* Assume a debian:bookworm container is running on "my-server": ```bash docker run --name debug -it debian:bookworm /bin/sh ``` I'm trying to execute a command on this container using an Action, specifically the `execute_container_terminal` method of the typescript client. Thus from the UI I create an action with this content: ```ts let shell = "sh"; // sh or bash let server = "my-server"; let container = "debug"; let command = "date"; await komodo.execute_container_terminal( { server, container, command, init: { command: shell, recreate: "Always" }, }, { onLine: (line) => { console.log(line); }, onFinish: (code) => { console.log(`Command finished with exit code ${code}`); }, }, ); ``` ## Expected behavior Using `bash` or `sh`, executing the action succeeds and the following output is produced: ```bash Sat Mar 28 20:31:22 UTC 2026 Command finished with exit code 0 🦎 Action completed successfully 🦎 ``` ## Actual behavior Sometimes the command is executed incorrectly, resulting in the following output: ```bash '; date; rc=$?; printf ' Command finished with exit code %d 🦎 Action completed successfully 🦎 ``` I have not been able to pinpoint exactly what causes this behavior to occur, currently it seems random. ## Initial analysis While I'm not familiar with the komodo source code, the issue seems to stem from this snippet: https://github.com/moghtech/komodo/blob/0f9679455911ce9f078e1d3654437ce4cda84eda/bin/periphery/src/api/terminal.rs#L466-L468 ## Edits - Updated behavior from "succeeds with bash but fails with sh" to "randomly fails"
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/komodo#2727