Kiro icon indicating copy to clipboard operation
Kiro copied to clipboard

kiro-cli interactive mode fails with "Bad file descriptor (os error 9)" on Linux

Open chuymtz opened this issue 3 weeks ago • 1 comments

Before opening, please confirm:

Operating System

Linux with glibc 2.28 on an x86_64 architecture

Kiro Version

1.22.0

Bug Description

After a clean install of kiro-cli (tested with both the musl ZIP package and AppImage extraction), the CLI’s interactive mode consistently fails with: error: Bad file descriptor (os error 9) Authentication (kiro-cli login) works fine, but running kiro-cli with no arguments causes this error. Subcommands such as login, setup, and settings work normally.

Environment:

OS: Linux (glibc 2.28) Architecture: x86_64 Install method: musl ZIP (kirocli-x86_64-linux-musl.zip) via install.sh kiro-cli --version: 1.22.0 (also happens on 1.21.0) $HOME: /home/martinj15 with symlinks for .aws, .config, .cache, .local pointing to /RTM/martinj15 Terminal: Windows Terminal → SSH with RequestTTY yes TERM: xterm-256color

Steps to Reproduce

  1. Remove previous install
rm -f ~/.local/bin/kiro-cli
rm -rf ~/.config/kiro ~/.cache/kiro ~/.aws/sso/cache
  1. Download musl ZIP and install
curl -O https://desktop-release.q.us-east-1.amazonaws.com/latest/kirocli-x86_64-linux-musl.zip
unzip kirocli.zip
./kirocli/install.sh
source ~/.bashrc
  1. Authenticate
kiro-cli login
  1. run interactive kiro-cli
  2. observe error error: Bad file descriptor (os error 9)

Expected Behavior

Interactive kiro-cli TUI should open.

Actual Behavior: Fails immediately with "Bad file descriptor (os error 9)".

Additional Notes:

Running within a script pseudo-TTY does not resolve the issue. The error occurs regardless of whether $HOME is overridden to /RTM/martinj15 or kept as /home/martinj15. May be related to STDIN/STDOUT handling in the TUI when using SSH RemoteCommand sessions.

Conversation ID

No response

Additional Context

Im working on a corp manged EC2.

#!/bin/bash
# Minimal reproduction for kiro-cli Bad file descriptor error in interactive mode
# Tested on Linux glibc 2.28 (RHEL 8.x) x86_64, SSH session with TTY

set -e

# Environment check
echo "Environment:"
ldd --version | head -n 1
uname -a
echo "TERM=$TERM"
echo "HOME=$HOME"
echo

# Clean old install and caches
rm -f ~/.local/bin/kiro-cli
rm -rf ~/.config/kiro ~/.cache/kiro ~/.aws/sso/cache

# Download musl ZIP (for glibc < 2.34)
curl --proto '=https' --tlsv1.2 -sSf \
  https://desktop-release.q.us-east-1.amazonaws.com/latest/kirocli-x86_64-linux-musl.zip \
  -o kirocli.zip

# Unzip and install
unzip -o kirocli.zip
./kirocli/install.sh <<EOF
Yes
EOF
source ~/.bashrc

# Verify install
kiro-cli --version

# Authenticate
kiro-cli logout || true
kiro-cli login
echo ">>> Complete the browser device code prompt <<<"
read -p "Press enter after completing login in browser..."

# Run interactive mode (expected failure)
echo
echo "Running interactive mode..."
kiro-cli

chuymtz avatar Dec 18 '25 14:12 chuymtz