Compose: Compose unable to attach to an interactive service.

Created on 18 Feb 2016  Â·  21Comments  Â·  Source: docker/compose

Running docker-compose up hangs with the following docker-compose.yaml:

version: '2'
services:
    sandy:
        image: ubuntu:15.10
        stdin_open: true
        tty: true

The output produced is...

Creating dockersandbox_sandy_1
Attaching to dockersandbox_sandy_1
ERROR: Couldn't connect to Docker daemon - you might need to run `docker-machine start default`.

The docker VM is already started and running the suggested command doesn't fix the problem. I have also tried following the instructions detailed in the update for issue #2180 but it doesn't appear to resolve the issue.

However, the container seems to have been created and started since it does appear in the output of docker ps. Attaching to the newly created container with docker attach {id} also appears to be working fine.

Here is the output of docker info in case the information is useful:

Containers: 0
 Running: 0
 Paused: 0
 Stopped: 0
Images: 1
Server Version: 1.10.1
Storage Driver: aufs
 Root Dir: /mnt/sda1/var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 4
 Dirperm1 Supported: true
Execution Driver: native-0.2
Logging Driver: json-file
Plugins: 
 Volume: local
 Network: bridge null host
Kernel Version: 4.1.17-boot2docker
Operating System: Boot2Docker 1.10.1 (TCL 6.4.1); master : b03e158 - Thu Feb 11 22:34:01 UTC 2016
OSType: linux
Architecture: x86_64
CPUs: 1
Total Memory: 1.956 GiB
Name: default
ID: YXX3:TYOD:BAJH:ARCD:DI6A:YI4I:JLMO:DO2L:DHIY:E7BQ:YGVZ:AAOY
Debug mode (server): true
 File Descriptors: 10
 Goroutines: 22
 System Time: 2016-02-18T05:26:52.911868214Z
 EventsListeners: 0
 Init SHA1: 
 Init Path: /usr/local/bin/docker
 Docker Root Dir: /mnt/sda1/var/lib/docker
Labels:
 provider=virtualbox

docker -v yields Docker version 1.10.1, build 9e83765.

areup kinbug stale statu0-triage

Most helpful comment

Confirmed that this is still an issue on macOS with Docker Desktop.

All 21 comments

How did you install docker-compose? Did you curl the binary or pip install?

running docker-compose --verbose up should give more information about the problem.

I installed docker-compose via the Docker Toolbox on Mac OS X. I am using version 1.10.1 (not 1.10.1a).

Here is the output of running docker-compose --verbose up:

compose.config.config.find: Using configuration files: ./docker-compose.yml
docker.auth.auth.load_config: File doesn't exist
compose.cli.command.get_client: docker-compose version 1.6.0, build d99cad6
docker-py version: 1.7.0
CPython version: 2.7.9
OpenSSL version: OpenSSL 1.0.1j 15 Oct 2014
compose.cli.command.get_client: Docker base_url: https://192.168.99.100:2376
compose.cli.command.get_client: Docker version: KernelVersion=4.1.17-boot2docker, Os=linux, BuildTime=2016-02-11T20:39:58.688092588+00:00, ApiVersion=1.22, Version=1.10.1, GitCommit=9e83765, Arch=amd64, GoVersion=go1.5.3
compose.cli.verbose_proxy.proxy_callable: docker inspect_network <- (u'sandbox_default')
compose.network.ensure: Creating network "sandbox_default" with the default driver
compose.cli.verbose_proxy.proxy_callable: docker create_network <- (ipam=None, driver=None, options=None, name=u'sandbox_default')
compose.cli.verbose_proxy.proxy_callable: docker create_network -> {u'Id': u'3c2a25fdbb4d5cb4eaeea49ff6546032ccb29cb4addd57cb133f9424ab81b524',
 u'Warning': u''}
compose.cli.verbose_proxy.proxy_callable: docker containers <- (all=True, filters={u'label': [u'com.docker.compose.project=sandbox', u'com.docker.compose.service=sandy', u'com.docker.compose.oneoff=False']})
compose.cli.verbose_proxy.proxy_callable: docker containers -> (list with 0 items)
compose.cli.verbose_proxy.proxy_callable: docker containers <- (all=True, filters={u'label': [u'com.docker.compose.project=sandbox', u'com.docker.compose.service=sandy', u'com.docker.compose.oneoff=False']})
compose.cli.verbose_proxy.proxy_callable: docker containers -> (list with 0 items)
compose.cli.verbose_proxy.proxy_callable: docker inspect_image <- ('ubuntu:15.10')
compose.cli.verbose_proxy.proxy_callable: docker inspect_image -> {u'Architecture': u'amd64',
 u'Author': u'',
 u'Comment': u'',
 u'Config': {u'AttachStderr': False,
             u'AttachStdin': False,
             u'AttachStdout': False,
             u'Cmd': [u'/bin/bash'],
             u'Domainname': u'',
             u'Entrypoint': None,
             u'Env': None,
...
compose.cli.verbose_proxy.proxy_callable: docker containers <- (all=True, filters={u'label': [u'com.docker.compose.project=sandbox', u'com.docker.compose.service=sandy', u'com.docker.compose.oneoff=False']})
compose.cli.verbose_proxy.proxy_callable: docker containers -> (list with 0 items)
compose.cli.verbose_proxy.proxy_callable: docker inspect_image <- ('ubuntu:15.10')
compose.cli.verbose_proxy.proxy_callable: docker inspect_image -> {u'Architecture': u'amd64',
 u'Author': u'',
 u'Comment': u'',
 u'Config': {u'AttachStderr': False,
             u'AttachStdin': False,
             u'AttachStdout': False,
             u'Cmd': [u'/bin/bash'],
             u'Domainname': u'',
             u'Entrypoint': None,
             u'Env': None,
...
compose.service.build_container_labels: Added config hash: 05cacd8703ff138dc9af8ca27d6b6660b93f925b46c591814c40d123a2502414
compose.cli.verbose_proxy.proxy_callable: docker create_host_config <- (memswap_limit=None, links=[], devices=None, pid_mode=None, log_config={'Type': u'', 'Config': {}}, cpu_quota=None, read_only=None, dns=None, volumes_from=[], port_bindings={}, security_opt=None, extra_hosts=None, cgroup_parent=None, network_mode=u'sandbox_default', cap_add=None, restart_policy=None, dns_search=None, privileged=False, binds=[], ipc_mode=None, mem_limit=None, cap_drop=None, ulimits=None)
compose.cli.verbose_proxy.proxy_callable: docker create_host_config -> {'Binds': [],
 'Links': [],
 'LogConfig': {'Config': {}, 'Type': u''},
 'NetworkMode': u'sandbox_default',
 'PortBindings': {},
 'VolumesFrom': []}
compose.service.create_container: Creating sandbox_sandy_1
compose.cli.verbose_proxy.proxy_callable: docker create_container <- (tty=True, labels={u'com.docker.compose.service': u'sandy', u'com.docker.compose.project': u'sandbox', u'com.docker.compose.config-hash': '05cacd8703ff138dc9af8ca27d6b6660b93f925b46c591814c40d123a2502414', u'com.docker.compose.version': u'1.6.0', u'com.docker.compose.oneoff': u'False', u'com.docker.compose.container-number': '1'}, name=u'sandbox_sandy_1', image='ubuntu:15.10', stdin_open=True, host_config={'NetworkMode': u'sandbox_default', 'Links': [], 'PortBindings': {}, 'Binds': [], 'LogConfig': {'Type': u'', 'Config': {}}, 'VolumesFrom': []}, environment={}, volumes={}, detach=True)
compose.cli.verbose_proxy.proxy_callable: docker create_container -> {u'Id': u'092079a0e5fc956daa04e89aa631a75b4037dd00bff6dc0af8e7334f69ec5c34',
 u'Warnings': None}
compose.cli.verbose_proxy.proxy_callable: docker inspect_container <- (u'092079a0e5fc956daa04e89aa631a75b4037dd00bff6dc0af8e7334f69ec5c34')
compose.cli.verbose_proxy.proxy_callable: docker inspect_container -> {u'AppArmorProfile': u'',
 u'Args': [],
 u'Config': {u'AttachStderr': False,
             u'AttachStdin': False,
             u'AttachStdout': False,
             u'Cmd': [u'/bin/bash'],
             u'Domainname': u'',
             u'Entrypoint': None,
             u'Env': None,
             u'Hostname': u'092079a0e5fc',
...
compose.cli.verbose_proxy.proxy_callable: docker inspect_container <- (u'092079a0e5fc956daa04e89aa631a75b4037dd00bff6dc0af8e7334f69ec5c34')
compose.cli.verbose_proxy.proxy_callable: docker inspect_container -> {u'AppArmorProfile': u'',
 u'Args': [],
 u'Config': {u'AttachStderr': False,
             u'AttachStdin': False,
             u'AttachStdout': False,
             u'Cmd': [u'/bin/bash'],
             u'Domainname': u'',
             u'Entrypoint': None,
             u'Env': None,
             u'Hostname': u'092079a0e5fc',
...
compose.cli.verbose_proxy.proxy_callable: docker attach <- (u'092079a0e5fc956daa04e89aa631a75b4037dd00bff6dc0af8e7334f69ec5c34', stderr=True, stream=True, stdout=True)
compose.cli.verbose_proxy.proxy_callable: docker attach -> <generator object _stream_raw_result at 0x1046de640>
compose.cli.verbose_proxy.proxy_callable: docker disconnect_container_from_network <- (u'092079a0e5fc956daa04e89aa631a75b4037dd00bff6dc0af8e7334f69ec5c34', u'sandbox_default')
compose.cli.verbose_proxy.proxy_callable: docker disconnect_container_from_network -> None
compose.cli.verbose_proxy.proxy_callable: docker connect_container_to_network <- (u'092079a0e5fc956daa04e89aa631a75b4037dd00bff6dc0af8e7334f69ec5c34', u'sandbox_default', links=[], aliases=['sandy', u'092079a0e5'])
compose.cli.verbose_proxy.proxy_callable: docker connect_container_to_network -> None
compose.cli.verbose_proxy.proxy_callable: docker start <- (u'092079a0e5fc956daa04e89aa631a75b4037dd00bff6dc0af8e7334f69ec5c34')
compose.cli.verbose_proxy.proxy_callable: docker start -> None
Attaching to sandbox_sandy_1
ERROR: compose.cli.main.main: Couldn't connect to Docker daemon - you might need to run `docker-machine start default`.

Looking at the output, it seems like AttachStdin value is always set to False in spite of what was stated in the docker-compose.yml. Perhaps that can hint at the issue?

Got the same issue on Ubuntu here.

docker-compose version 1.5.2, build 7240ff3
docker version 1.9.1

Hey everybody i got the same error with the same output in $docker-compose --verbose up

Same problem
Docker version 1.13.0, build 49bf474
docker-compose version 1.10.0, build 4bd6f1a

Same problem.

$ docker-compose version
docker-compose version 1.18.0, build 8dd22a9
docker-py version: 2.7.0
CPython version: 3.5.5
OpenSSL version: OpenSSL 1.0.2o  27 Mar 2018
$ docker version 
Client:
 Version:   17.12.1-ce
 API version:   1.35
 Go version:    go1.10.1
 Git commit:    7390fc6
 Built: Fri Apr 13 11:24:06 2018
 OS/Arch:   linux/amd64

Server:
 Engine:
  Version:  17.12.1-ce
  API version:  1.35 (minimum version 1.12)
  Go version:   go1.10.1
  Git commit:   7390fc6
  Built:    Fri Apr 13 11:23:39 2018
  OS/Arch:  linux/amd64
  Experimental: false
$ docker info           
Containers: 83
 Running: 3
 Paused: 0
 Stopped: 80
Images: 366
Server Version: 17.12.1-ce
Storage Driver: zfs
 Zpool: gauss
 Zpool Health: ONLINE
 Parent Dataset: gauss/var/lib/docker
 Space Used By Parent: 7668826112
 Space Available: 225834684416
 Parent Quota: no
 Compression: lz4
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: bridge host macvlan null overlay
 Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 9b55aab (expected: 9b55aab90508bd389d7654c4baf173a981477d55)
runc version: 9f9c962 (expected: 9f9c96235cc97674e935002fc3d78361b696a69e)
init version: v0.16.1 (expected: 949e6facb77383876aeff8a6944dde66b3089574)
Security Options:
 seccomp
  Profile: default
Kernel Version: 4.16.2
Operating System: Gentoo/Linux
OSType: linux
Architecture: x86_64
CPUs: 8
Total Memory: 31.29GiB
Name: gauss
ID: SYAD:KN3R:BERN:CR6D:J3YZ:UNWU:2PYS:6JXN:BZXS:TEK5:3KSG:SGT4
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false
$ cat docker-compose.yml 
version: '3.5'
services:
    sandy:
        image: ubuntu
        stdin_open: true
        tty: true
$ docker-compose --verbose up
compose.config.config.find: Using configuration files: ./docker-compose.yml
docker.auth.find_config_file: Trying paths: ['/home/corin/.docker/config.json', '/home/corin/.dockercfg']
docker.auth.find_config_file: Found file at path: /home/corin/.docker/config.json
docker.auth.load_config: Found 'auths' section
docker.auth.parse_auth: Found an IdentityToken entry for registry 437bvqirgyn23yne.azurecr.io
docker.auth.parse_auth: Found entry (registry='63c3e61228b47324846b20d5.azurecr.io', username='63c3e61228b47324846b20d5')
docker.auth.load_config: Found 'HttpHeaders' section
urllib3.connectionpool._new_conn: Starting new HTTPS connection (1): gauss
urllib3.connectionpool._make_request: https://gauss:2376 "GET /v1.30/version HTTP/1.1" 200 521
compose.cli.command.get_client: docker-compose version 1.18.0, build 8dd22a9
docker-py version: 2.7.0
CPython version: 3.5.5
OpenSSL version: OpenSSL 1.0.2o  27 Mar 2018
compose.cli.command.get_client: Docker base_url: https://gauss:2376
compose.cli.command.get_client: Docker version: BuildTime=2018-04-13T11:23:39.000000000+00:00, Version=17.12.1-ce, Arch=amd64, ApiVersion=1.35, GoVersion=go1.10.1, KernelVersion=4.16.2, GitCommit=7390fc6, Os=linux, Platform={'Name': ''}, Components=[{'Name': 'Engine', 'Version': '17.12.1-ce', 'Details': {'BuildTime': '2018-04-13T11:23:39.000000000+00:00', 'ApiVersion': '1.35', 'GoVersion': 'go1.10.1', 'KernelVersion': '4.16.2', 'GitCommit': '7390fc6', 'Os': 'linux', 'Arch': 'amd64', 'MinAPIVersion': '1.12', 'Experimental': 'false'}}], MinAPIVersion=1.12
compose.cli.verbose_proxy.proxy_callable: docker info <- ()
urllib3.connectionpool._make_request: https://gauss:2376 "GET /v1.30/info HTTP/1.1" 200 None
compose.cli.verbose_proxy.proxy_callable: docker info -> {'Architecture': 'x86_64',
 'BridgeNfIp6tables': True,
 'BridgeNfIptables': True,
 'CPUSet': True,
 'CPUShares': True,
 'CgroupDriver': 'cgroupfs',
 'ClusterAdvertise': '',
 'ClusterStore': '',
 'ContainerdCommit': {'Expected': '9b55aab90508bd389d7654c4baf173a981477d55',
                      'ID': '9b55aab'},
...
compose.cli.verbose_proxy.proxy_callable: docker inspect_network <- ('compose2951_default')
urllib3.connectionpool._make_request: https://gauss:2376 "GET /v1.30/networks/compose2951_default HTTP/1.1" 404 52
compose.network.ensure: Creating network "compose2951_default" with the default driver
compose.cli.verbose_proxy.proxy_callable: docker create_network <- (internal=False, enable_ipv6=False, ipam=None, attachable=True, driver=None, options=None, check_duplicate=True, labels={'com.docker.compose.network': 'default', 'com.docker.compose.project': 'compose2951'}, name='compose2951_default')
urllib3.connectionpool._make_request: https://gauss:2376 "POST /v1.30/networks/create HTTP/1.1" 201 87
compose.cli.verbose_proxy.proxy_callable: docker create_network -> {'Id': '486fa11bdcccf65b75fed9fd5668eee1b6f12af396606fec5137fc2abae78555',
 'Warning': ''}
compose.cli.verbose_proxy.proxy_callable: docker containers <- (filters={'label': ['com.docker.compose.project=compose2951', 'com.docker.compose.oneoff=False']}, all=False)
urllib3.connectionpool._make_request: https://gauss:2376 "GET /v1.30/containers/json?size=0&limit=-1&filters=%7B%22label%22%3A+%5B%22com.docker.compose.project%3Dcompose2951%22%2C+%22com.docker.compose.oneoff%3DFalse%22%5D%7D&all=0&trunc_cmd=0 HTTP/1.1" 200 3
compose.cli.verbose_proxy.proxy_callable: docker containers -> (list with 0 items)
compose.cli.verbose_proxy.proxy_callable: docker containers <- (filters={'label': ['com.docker.compose.project=compose2951', 'com.docker.compose.service=sandy', 'com.docker.compose.oneoff=False']}, all=True)
urllib3.connectionpool._make_request: https://gauss:2376 "GET /v1.30/containers/json?size=0&limit=-1&filters=%7B%22label%22%3A+%5B%22com.docker.compose.project%3Dcompose2951%22%2C+%22com.docker.compose.service%3Dsandy%22%2C+%22com.docker.compose.oneoff%3DFalse%22%5D%7D&all=1&trunc_cmd=0 HTTP/1.1" 200 3
compose.cli.verbose_proxy.proxy_callable: docker containers -> (list with 0 items)
compose.cli.verbose_proxy.proxy_callable: docker inspect_image <- ('ubuntu')
urllib3.connectionpool._make_request: https://gauss:2376 "GET /v1.30/images/ubuntu/json HTTP/1.1" 200 None
compose.cli.verbose_proxy.proxy_callable: docker inspect_image -> {'Architecture': 'amd64',
 'Author': '',
 'Comment': '',
 'Config': {'ArgsEscaped': True,
            'AttachStderr': False,
            'AttachStdin': False,
            'AttachStdout': False,
            'Cmd': ['/bin/bash'],
            'Domainname': '',
            'Entrypoint': None,
...
compose.cli.verbose_proxy.proxy_callable: docker containers <- (filters={'label': ['com.docker.compose.project=compose2951', 'com.docker.compose.service=sandy', 'com.docker.compose.oneoff=False']}, all=True)
urllib3.connectionpool._make_request: https://gauss:2376 "GET /v1.30/containers/json?size=0&limit=-1&filters=%7B%22label%22%3A+%5B%22com.docker.compose.project%3Dcompose2951%22%2C+%22com.docker.compose.service%3Dsandy%22%2C+%22com.docker.compose.oneoff%3DFalse%22%5D%7D&all=1&trunc_cmd=0 HTTP/1.1" 200 3
compose.cli.verbose_proxy.proxy_callable: docker containers -> (list with 0 items)
compose.parallel.feed_queue: Pending: {<Service: sandy>}
compose.parallel.feed_queue: Starting producer thread for <Service: sandy>
compose.cli.verbose_proxy.proxy_callable: docker containers <- (filters={'label': ['com.docker.compose.project=compose2951', 'com.docker.compose.service=sandy', 'com.docker.compose.oneoff=False']}, all=True)
urllib3.connectionpool._make_request: https://gauss:2376 "GET /v1.30/containers/json?size=0&limit=-1&filters=%7B%22label%22%3A+%5B%22com.docker.compose.project%3Dcompose2951%22%2C+%22com.docker.compose.service%3Dsandy%22%2C+%22com.docker.compose.oneoff%3DFalse%22%5D%7D&all=1&trunc_cmd=0 HTTP/1.1" 200 3
compose.cli.verbose_proxy.proxy_callable: docker containers -> (list with 0 items)
Creating compose2951_sandy_1 ... 
compose.parallel.feed_queue: Pending: {ServiceName(project='compose2951', service='sandy', number=1)}
compose.parallel.feed_queue: Starting producer thread for ServiceName(project='compose2951', service='sandy', number=1)
compose.cli.verbose_proxy.proxy_callable: docker inspect_image <- ('ubuntu')
urllib3.connectionpool._make_request: https://gauss:2376 "GET /v1.30/images/ubuntu/json HTTP/1.1" 200 None
compose.cli.verbose_proxy.proxy_callable: docker inspect_image -> {'Architecture': 'amd64',
 'Author': '',
 'Comment': '',
 'Config': {'ArgsEscaped': True,
            'AttachStderr': False,
            'AttachStdin': False,
            'AttachStdout': False,
            'Cmd': ['/bin/bash'],
            'Domainname': '',
            'Entrypoint': None,
...
compose.cli.verbose_proxy.proxy_callable: docker inspect_image <- ('ubuntu')
urllib3.connectionpool._make_request: https://gauss:2376 "GET /v1.30/images/ubuntu/json HTTP/1.1" 200 None
compose.cli.verbose_proxy.proxy_callable: docker inspect_image -> {'Architecture': 'amd64',
 'Author': '',
 'Comment': '',
 'Config': {'ArgsEscaped': True,
            'AttachStderr': False,
            'AttachStdin': False,
            'AttachStdout': False,
            'Cmd': ['/bin/bash'],
            'Domainname': '',
            'Entrypoint': None,
...
compose.service.build_container_labels: Added config hash: e589258df07b222df39bb7aa10d5fe2a793165f79ee22bd3acf9383df62c0dd5
compose.cli.verbose_proxy.proxy_callable: docker create_host_config <- (device_write_iops=None, volume_driver=None, userns_mode=None, restart_policy=None, log_config={'Type': '', 'Config': {}}, mem_limit=None, mem_reservation=None, shm_size=None, device_write_bps=None, network_mode='compose2951_default', devices=None, dns_search=None, device_read_iops=None, ulimits=None, device_read_bps=None, init_path=None, memswap_limit=None, read_only=None, cpuset_cpus=None, storage_opt=None, cpu_shares=None, dns_opt=None, ipc_mode=None, oom_kill_disable=None, cap_add=None, port_bindings={}, init=None, blkio_weight_device=None, cpu_quota=None, extra_hosts=None, mem_swappiness=None, oom_score_adj=None, cpu_percent=None, cap_drop=None, security_opt=None, cgroup_parent=None, blkio_weight=None, sysctls=None, tmpfs=None, privileged=False, isolation=None, pid_mode=None, volumes_from=[], links=[], nano_cpus=None, pids_limit=None, dns=None, mounts=None, group_add=None, binds=[], cpu_count=None)
compose.cli.verbose_proxy.proxy_callable: docker create_host_config -> {'Binds': [],
 'Links': [],
 'LogConfig': {'Config': {}, 'Type': ''},
 'NetworkMode': 'compose2951_default',
 'PortBindings': {},
 'VolumesFrom': []}
compose.cli.verbose_proxy.proxy_callable: docker create_container <- (host_config={'VolumesFrom': [], 'NetworkMode': 'compose2951_default', 'PortBindings': {}, 'Links': [], 'LogConfig': {'Type': '', 'Config': {}}, 'Binds': []}, stdin_open=True, image='ubuntu', tty=True, detach=True, labels={'com.docker.compose.service': 'sandy', 'com.docker.compose.version': '1.18.0', 'com.docker.compose.oneoff': 'False', 'com.docker.compose.project': 'compose2951', 'com.docker.compose.config-hash': 'e589258df07b222df39bb7aa10d5fe2a793165f79ee22bd3acf9383df62c0dd5', 'com.docker.compose.container-number': '1'}, environment=[], networking_config={'EndpointsConfig': {'compose2951_default': {'Aliases': ['sandy'], 'IPAMConfig': {}}}}, volumes={}, name='compose2951_sandy_1')
compose.parallel.feed_queue: Pending: set()
compose.parallel.feed_queue: Pending: set()
compose.parallel.feed_queue: Pending: set()
compose.parallel.feed_queue: Pending: set()
compose.parallel.feed_queue: Pending: set()
compose.parallel.feed_queue: Pending: set()
urllib3.connectionpool._make_request: https://gauss:2376 "POST /v1.30/containers/create?name=compose2951_sandy_1 HTTP/1.1" 201 90
compose.cli.verbose_proxy.proxy_callable: docker create_container -> {'Id': '6da3a74e77c49f8d5ab2f27c3dbd2d30adcfc26f6dcae10e7577da78c54272ed',
 'Warnings': None}
compose.cli.verbose_proxy.proxy_callable: docker inspect_container <- ('6da3a74e77c49f8d5ab2f27c3dbd2d30adcfc26f6dcae10e7577da78c54272ed')
urllib3.connectionpool._make_request: https://gauss:2376 "GET /v1.30/containers/6da3a74e77c49f8d5ab2f27c3dbd2d30adcfc26f6dcae10e7577da78c54272ed/json HTTP/1.1" 200 None
compose.cli.verbose_proxy.proxy_callable: docker inspect_container -> {'AppArmorProfile': '',
 'Args': [],
 'Config': {'ArgsEscaped': True,
            'AttachStderr': False,
            'AttachStdin': False,
            'AttachStdout': False,
            'Cmd': ['/bin/bash'],
            'Domainname': '',
            'Entrypoint': None,
            'Env': ['PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'],
...
compose.cli.verbose_proxy.proxy_callable: docker attach <- ('6da3a74e77c49f8d5ab2f27c3dbd2d30adcfc26f6dcae10e7577da78c54272ed', stream=True, stderr=True, stdout=True)
urllib3.connectionpool._make_request: https://gauss:2376 "POST /v1.30/containers/6da3a74e77c49f8d5ab2f27c3dbd2d30adcfc26f6dcae10e7577da78c54272ed/attach?stream=1&stderr=1&logs=0&stdout=1 HTTP/1.1" 101 0
urllib3.connectionpool._new_conn: Starting new HTTPS connection (2): gauss
urllib3.connectionpool._make_request: https://gauss:2376 "GET /v1.30/containers/6da3a74e77c49f8d5ab2f27c3dbd2d30adcfc26f6dcae10e7577da78c54272ed/json HTTP/1.1" 200 None
compose.cli.verbose_proxy.proxy_callable: docker attach -> <generator object socket_raw_iter at 0x7ff28f5946d0>
compose.cli.verbose_proxy.proxy_callable: docker disconnect_container_from_network <- ('6da3a74e77c49f8d5ab2f27c3dbd2d30adcfc26f6dcae10e7577da78c54272ed', 'compose2951_default')
urllib3.connectionpool._make_request: https://gauss:2376 "POST /v1.30/networks/compose2951_default/disconnect HTTP/1.1" 200 0
compose.cli.verbose_proxy.proxy_callable: docker disconnect_container_from_network -> None
compose.cli.verbose_proxy.proxy_callable: docker connect_container_to_network <- ('6da3a74e77c49f8d5ab2f27c3dbd2d30adcfc26f6dcae10e7577da78c54272ed', 'compose2951_default', links=[], link_local_ips=None, ipv4_address=None, ipv6_address=None, aliases=['sandy', '6da3a74e77c4'])
urllib3.connectionpool._make_request: https://gauss:2376 "POST /v1.30/networks/compose2951_default/connect HTTP/1.1" 200 0
compose.cli.verbose_proxy.proxy_callable: docker connect_container_to_network -> None
compose.cli.verbose_proxy.proxy_callable: docker start <- ('6da3a74e77c49f8d5ab2f27c3dbd2d30adcfc26f6dcae10e7577da78c54272ed')
compose.parallel.feed_queue: Pending: set()
compose.parallel.feed_queue: Pending: set()
compose.parallel.feed_queue: Pending: set()
compose.parallel.feed_queue: Pending: set()
urllib3.connectionpool._make_request: https://gauss:2376 "POST /v1.30/containers/6da3a74e77c49f8d5ab2f27c3dbd2d30adcfc26f6dcae10e7577da78c54272ed/start HTTP/1.1" 204 0
compose.cli.verbose_proxy.proxy_callable: docker start -> None
compose.parallel.parallel_execute_iter: Finished processing: ServiceName(project='compCreating compose2951_sandy_1 ... done
compose.parallel.feed_queue: Pending: set()
compose.parallel.parallel_execute_iter: Finished processing: <Service: sandy>
compose.parallel.feed_queue: Pending: set()
Attaching to compose2951_sandy_1
compose.cli.verbose_proxy.proxy_callable: docker events <- (filters={'label': ['com.docker.compose.project=compose2951', 'com.docker.compose.oneoff=False']}, decode=True)
urllib3.connectionpool._make_request: https://gauss:2376 "GET /v1.30/events?filters=%7B%22label%22%3A+%5B%22com.docker.compose.project%3Dcompose2951%22%2C+%22com.docker.compose.oneoff%3DFalse%22%5D%7D HTTP/1.1" 200 None
compose.cli.verbose_proxy.proxy_callable: docker events -> <generator object APIClient._stream_helper at 0x7ff28f5940f8>

Process appears to hang.

Running docker-compose run sandy produces the expected outcome.

So, I notice that docker-compose run uses docker attach_socket as opposed to docker attach.

Issue grooming: I tried this and it didn't hang, so I assume/expect that this was fixed somewhere along the line and will close.

$ cat > 2951.yaml
version: '2'
services:
    sandy:
        image: ubuntu:15.10
        stdin_open: true
        tty: true
$ docker-compose -f 2951.yaml up

Creating network "compose_default" with the default driver
Pulling sandy (ubuntu:15.10)...
15.10: Pulling from library/ubuntu
7dcf5a444392: Pull complete
759aa75f3cee: Pull complete
3fa871dc8a2b: Pull complete
224c42ae46e7: Pull complete
Digest: sha256:02521a2d079595241c6793b2044f02eecf294034f31d6e235ac4b2b54ffc41f3
Status: Downloaded newer image for ubuntu:15.10
Creating compose_sandy_1 ... done
Attaching to compose_sandy_1
sandy_1  | root@c03b7ec0637a:/# 

Not fixed yet.

Hi @iooi,

Can you please provide more information. What version of Compose are you using? What Compose file are you using?

Hi @chris-crone ,

I am using latest Docker, the same sandy service.

~/test/dock $ cat docker-compose.yml
version: '2'
services:
    sandy:
        image: ubuntu:15.10
        stdin_open: true
        tty: true

It hangs at

```~/test/dock $ docker-compose up
Pulling sandy (ubuntu:15.10)...
15.10: Pulling from library/ubuntu
7dcf5a444392: Pull complete
759aa75f3cee: Pull complete
3fa871dc8a2b: Pull complete
224c42ae46e7: Pull complete
Creating dock_sandy_1 ... done
Attaching to dock_sandy_1


and then I have to attach it using another terminal, and use Ctrl+C to enter bash.

~ $ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
c17615cd687e ubuntu:15.10 "/bin/bash" 26 seconds ago Up 24 seconds dock_sandy_1
~ $ docker attach dock_sandy_1
^C
root@c17615cd687e:/#
```

@iooi can you please show me the output of docker-compose version? You should see something like:

docker-compose version 1.24.0, build 0aa59064
docker-py version: 3.7.2
CPython version: 3.6.8
OpenSSL version: OpenSSL 1.1.0j  20 Nov 2018

And the output of docker version which should be something like:

Client:
 Version:           19.03.0-dev
 API version:       1.40
 Go version:        go1.11.5
 Git commit:        fdb0ef7b
 Built:             Mon Mar 11 12:19:00 2019
 OS/Arch:           darwin/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          19.03.0-beta1
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.12.1
  Git commit:       62240a9
  Built:            Thu Apr  4 19:22:35 2019
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          v1.2.5
  GitCommit:        bb71b10fd8f58240ca47fbb579b9d1028eea7c84
 runc:
  Version:          1.0.0-rc6+dev
  GitCommit:        2b18fe1d885ee5083ef9f0838fee39b62d653e30
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683

here it is,

~ $ docker version
Client: Docker Engine - Community
 Version:           18.09.2
 API version:       1.39
 Go version:        go1.10.8
 Git commit:        6247962
 Built:             Sun Feb 10 04:12:39 2019
 OS/Arch:           darwin/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          18.09.2
  API version:      1.39 (minimum version 1.12)
  Go version:       go1.10.6
  Git commit:       6247962
  Built:            Sun Feb 10 04:13:06 2019
  OS/Arch:          linux/amd64
  Experimental:     true
~ $ docker-compose version
docker-compose version 1.23.2, build 1110ad01
docker-py version: 3.6.0
CPython version: 3.6.6
OpenSSL version: OpenSSL 1.1.0h  27 Mar 2018
~ $

Confirmed that this is still an issue on macOS with Docker Desktop.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Can also reproduce on Linux, setting COMPOSE_INTERACTIVE_NO_CLI doesn't change this behaviour.

This issue has been automatically marked as not stale anymore due to the recent activity.

I'm also still experiencing this issue. As previously mentioned, the problem occurs when using docker-compose up, but everything works fine using docker-compose run name-of-service. Both stdin_open: true and tty: true are defined in the specification of the service in my docker-compose.yml file. The YAML file is version: '3', if that makes any difference.

â–¶ docker version
Client: Docker Engine - Community
 Version:           19.03.5
 API version:       1.40
 Go version:        go1.12.12
 Git commit:        633a0ea838
 Built:             Wed Nov 13 07:29:52 2019
 OS/Arch:           linux/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          19.03.5
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.12.12
  Git commit:       633a0ea838
  Built:            Wed Nov 13 07:28:22 2019
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.2.10
  GitCommit:        b34a5c8af56e510852c35414db4c1f4fa6172339
 nvidia:
  Version:          1.0.0-rc8+dev
  GitCommit:        3e425f80a8c931f88e6d94a8c831b9d5aa481657
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683
â–¶ docker-compose version
docker-compose version 1.25.0, build 0a186604
docker-py version: 4.1.0
CPython version: 3.7.4
OpenSSL version: OpenSSL 1.1.0l  10 Sep 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

This issue has been automatically closed because it had not recent activity during the stale period.

Was this page helpful?
0 / 5 - 0 ratings