Skip to content

[Bug] "execute_container_terminal" randomly fails to execute #1289

@bastienlc

Description

@bastienlc

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:

let full_command = format!(
"printf '\n{START_OF_OUTPUT}\n\n'; {command}; rc=$?; printf '\n{KOMODO_EXIT_CODE}%d\n{END_OF_OUTPUT}\n' \"$rc\"\n"
);

Edits

  • Updated behavior from "succeeds with bash but fails with sh" to "randomly fails"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions