compose: The input device is not a TTY
Following #5692 discussion, there is also some regression/bug concerning -T
flag:
docker-compose exec service sh -c 'command`
works on:
$ docker-compose version
docker-compose version 1.18.0, build 8dd22a9
docker-py version: 2.7.0
CPython version: 2.7.14
OpenSSL version: LibreSSL 2.6.3
and older version (tested on 1.17.0, 1.17.1 and 1.18.0), but doesn’t work on:
$ docker-compose version
docker-compose version 1.19.0, build 9e633ef
docker-py version: 2.7.0
CPython version: 2.7.14
OpenSSL version: LibreSSL 2.6.3
and gives following error:
$ docker-compose exec service sh -c 'command`
the input device is not a TTY
adding -T
flag resolves the error.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 125
- Comments: 30 (1 by maintainers)
Links to this issue
Commits related to this issue
- Fix running RSpec (with docker) from Sublime. https://github.com/docker/compose/issues/5696 — committed to anolson/dotfiles by anolson 6 years ago
- fix #34: breaking change in Docker (docker/compose#5696) — committed to yeswework/fabrica-dev-kit by deleted user 6 years ago
- Fix TTY error Refer: https://github.com/docker/compose/issues/5696 — committed to tfirdaus/wp-shell-localhost by tfirdaus 6 years ago
- Use docker-compose exec -T As per https://github.com/docker/compose/issues/5696 Signed-off-by: Michal Čihař <michal@cihar.com> — committed to WeblateOrg/docker-compose by nijel 5 years ago
- fix(workflow) set COMPOSE_INTERACTIVE_NO_CLI = 1 Should fix the error `the input device is not a TTY` as documented here https://github.com/docker/compose/issues/5696#issuecomment-388816979 — committed to Kong/docs.konghq.com by nijikokun 4 years ago
- Use Github Actions instead of Travis CI (#1735) * feat: create build and test github action workflow * fix(workflow) set COMPOSE_INTERACTIVE_NO_CLI = 1 Should fix the error `the input device is... — committed to Kong/docs.konghq.com by nijikokun 4 years ago
- fixes CI prepare step - fixes docker-compose exec command in CI:prepare step missing a TTY see: https://github.com/docker/compose/issues/5696 — committed to ricwein/DirectoryIndexer by ricwein 4 years ago
- Disable pseudo-tty allocation Prevents “the input device is not a TTY” errors. See https://github.com/docker/compose/issues/5696 See https://docs.docker.com/compose/reference/exec/ — committed to GoogleForCreators/web-stories-wp by swissspidy 4 years ago
- Disable pseudo-tty allocation, take 2 Prevents “the input device is not a TTY” errors. Only needed for `exec` sub-command. See https://github.com/docker/compose/issues/5696 See https://docs.docker.... — committed to GoogleForCreators/web-stories-wp by swissspidy 4 years ago
- Fix docker-compose error "the input device is not a TTY" on test setup https://github.com/docker/compose/issues/5696 — committed to chidiwilliams/mongo-elastic-sync by chidiwilliams 4 years ago
- RG-5: Fix docker build https://github.com/docker/compose/issues/5696 — committed to juangw/rescue-groups by juangw 4 years ago
- Work around docker-compose tty allocation issue Issue reported here: https://github.com/docker/compose/issues/5696 Work-around: set the COMPOSE_INTERACTIVE_NO_CLI=1 env variable. — committed to tdm-project/tdm-polystore by ilveroluca 3 years ago
- reflected by https://github.com/docker/compose/issues/5696 — committed to Code-for-Funabashi/linebot by deleted user 3 years ago
@mhverbakel solution with
-T
flag (docker-compose exec -T
) is a part of the first comment itself but I also in hurry hadn’t read it carefully and messed withCOMPOSE_INTERACTIVE_NO_CLI
at first 😄 I use it in shell script executed from ant.I tried setting
COMPOSE_INTERACTIVE_NO_CLI=1
, and then I am getting this error instead:This is when doing
docker-compose exec ...
on Jenkins pipeline.docker-compose
version on the Jenkins slave is1.21.0
.I was running a shell script from cron and I got the same error as @tnguyen14 (https://github.com/docker/compose/issues/5696#issuecomment-403605760).
I resolved my issue by running
docker-compose exec -T ...
.Is this ever going to be fixed?
Same issue, solved the same way. Seems like this has been introduced in more recent docker-compose versions.
What is the background here - is this actually a workaround or “by design”? Thanks
I think this should be kept open, as I haven’t seen any resolution.
@armpogart The workaround involves setting the variable to 1, not 0.
for
cron
try to add environment from command linecrontab -e
likehttps://stackoverflow.com/a/10657111/7670492
@shin- oops, sorry) Yeah,
COMPOSE_INTERACTIVE_NO_CLI
workaround is working.worked for me by using
-T
flag in the run command@shin- It doesn’t work with simple commands either (tried with
ls
). AlsoCOMPOSE_INTERACTIVE_NO_CLI
doesn’t help (see excerpt from my build):But on second thought I don’t even fully understand whether the previous behavior was right or not, because of this excerpt from docker-compose documentation (https://docs.docker.com/compose/reference/exec/):
On the other hand, this is from
man sh
for-c
flag:So as far as I understand with
-c
flag I’m forcing to it not to use standard input and there is no need to allocate pseudo-tty (it must spawn non-login, non-interactive session ofsh
). Anyways this is regression, it used to work, though I’m not sure again which behavior is the correct one.P.S. As a reminder everything mentioned runs on CI, so there is no input device there.