Skip to content

[Bug] jaw slack setup: 비대화형 실행에서 --channel-ids 생략 시 ERR_USE_AFTER_CLOSE 크래시 (토큰 검증 통과 후 설정 유실) #475

Description

@lidge-jun

증상

jaw slack setup 을 비대화형(파이프/스크립트)으로 돌리면 두 번의 라이브 토큰 검증을 모두 통과한 뒤 마지막 단계에서 크래시한다. 설정은 저장되지 않는다.

  Step 2 — bot token ...
    OK auth.test ok (team T0BM...)
  Step 3 — app-level token ...
    OK apps.connections.open ok (Socket Mode reachable)
node:internal/readline/interface:441
      throw new ERR_USE_AFTER_CLOSE('readline');
Error [ERR_USE_AFTER_CLOSE]: readline was closed
    at ask (dist/bin/commands/slack.js:144:16)
    at runSetup (dist/bin/commands/slack.js:246:62)

원인

dist/bin/commands/slack.js:246

const channelIdsRaw = values['channel-ids'] ?? await ask('Channel IDs to allow (comma-separated, Enter = all)', ...);

--bot-token / --app-token 은 플래그로 주면 프롬프트를 건너뛴다. 그런데 --channel-ids 를 생략하면 무조건 ask() 로 떨어지고, 앞 단계에서 이미 소비/종료된 stdin 때문에 readline 이 터진다.

재현

printf '\n' | jaw slack setup --bot-token xoxb-... --app-token xapp-...

우회

--channel-ids 를 명시하면 통과한다.

printf '\n' | jaw slack setup --bot-token xoxb-... --app-token xapp-... --channel-ids C0BM...

제안

  • process.stdin.isTTY 가 아니면 ask() 가 기본값을 반환
  • 또는 --non-interactive / --yes 플래그로 모든 프롬프트를 기본값 처리
  • 최소한 크래시 대신 "채널을 지정하려면 --channel-ids 를 쓰세요" 로 정상 종료

systemd 가 없는 원격 컨테이너에 SSH 로 붙어 설정하는 경우 대화형 실행 자체가 어렵다. 비대화형 경로가 막히면 설정할 방법이 없다. 라이브 API 검증 2회를 통과하고 나서 버려지는 것이라 재실행 비용도 크다.

환경

  • cli-jaw 2.17.22
  • node v24.19.0
  • Debian 계열 linux x86_64 (컨테이너, PID1=tini)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions