The input device is not a TTY while running make run-server

Hi I was setting up the environment for the server and trying to run the command “make run-server” but I am getting following error

mudit@mudit-HP-Notebook:~/Documents/mattermost-server$ make run-server
MMCTL already exists in bin/mmctl not downloading a new version.
Starting docker containers
go run ./build/docker-compose-generator/main.go mysql postgres inbucket  minio | docker-compose -f docker-compose.makefile.yml -f /dev/stdin  run --rm start_dependencies
[+] Running 4/0
 ⠿ Container mattermost-postgres  Running               0.0s
 ⠿ Container mattermost-minio     Running                 0.0s
 ⠿ Container mattermost-inbucket  Running              0.0s
 ⠿ Container mattermost-mysql     Running                0.0s
the input device is not a TTY
Makefile:192: recipe for target 'start-docker' failed
make: *** [start-docker] Error 1

docker, docker-compose, go versions are as follow

OS: Ubuntu 18.0.4
Docker Compose version v2.4.1
Docker version 20.10.14, build a224086
go version go1.18 linux/amd64

I have the same problem…

Setting up Your Development Environment
There is a solution in the last section([Windows WSL] → [trouble shooting]), but I’m not sure how

Which OS are you using?

I use Windows.
Specifically, I followed the windows WSL guide.

I just had this same problem on archlinux. I think there’s two main ways this error can happen (as far as I can tell from these stackoverflow explanations):

  1. Your terminal really doesn’t work as a TTY (rare on linux, more likely on Windows)
  2. For whatever reason, your terminal isn’t being treated as the input

I believe 2 is the culprit here, at least in my case. go run ./build/docker-compose-generator/main.go mysql postgres inbucket minio is piped into the docker command, so the pipe is the actual input, not the terminal. That go command just outputs some configuration to stdout, which is then piped to stdin for the docker-compose command (the -f /dev/stdin part), so if you instead output that to a temp file and use the temp file instead of stdin for docker-compose, it all works (for me).

All that said, here’s my somewhat janky workaround. In Makefile, replace:

	$(GO) run ./build/docker-compose-generator/main.go $(ENABLED_DOCKER_SERVI
CES) | docker-compose -f docker-compose.makefile.yml -f /dev/stdin $(DOCKER_COMPOSE_OVERRIDE) run --rm start_dependencies

With:

	$(GO) run ./build/docker-compose-generator/main.go $(ENABLED_DOCKER_SERVICES) > temp.docker-compose.config.yml
	docker-compose -f docker-compose.makefile.yml -f temp.docker-compose.config.yml $(DOCKER_COMPOSE_OVERRIDE) run --rm start_dependencies
	rm temp.docker-compose.config.yml

I’m sure there’s a better way to do that, but it’s functional. As for why this problem is affecting us now, even though the code has been like this for a while without anyone reporting an issue, I have no idea. I checkout out some commits from a year ago and I had the same problem. That seems to suggest there’s been a change to something outside the mattermost-server repo, but I’ve never tried to build it from source before so idk. Hopefully someone more in the know can tell us.

My versions, in case they help explain it:

  • Arch Linux (Linux version 5.17.3-arch1-1)
  • Docker version 20.10.14, build a224086349
  • Docker Compose version 2.4.1
  • go version go1.18.1 linux/amd64
2 Likes