redis icon indicating copy to clipboard operation
redis copied to clipboard

Redis container not starting

Open gshlomi opened this issue 10 years ago • 11 comments

Getting "Creating Server TCP listening socket *:6379: unable to bind socket" OS UnRAID 6.1.9 , Docker ver1.7.1

gshlomi avatar May 14 '16 20:05 gshlomi

Hi, I have the same problem with redis:3.2, 3.0 works perfect.

$ uname -a 
Os: Linux 3.10.0-327.10.1.el7.x86_64 
$ docker -v
Docker version 1.8.2-el7, build a01dc02/1.8.2
$ docker run redis
1:M 18 May 11:56:32.845 # Creating Server TCP listening socket *:6379: unable to bind socket

cbarzu avatar May 18 '16 11:05 cbarzu

Same here, docker 1.11, both redis 3.2 and 3.2.0 are affected

ipv6 is disabled. btw

jdevelop avatar May 25 '16 13:05 jdevelop

@jdevelop are you saying that ipv6 is disabled on your host or inside the image?

It runs fine here:

$ docker pull redis:3.2
3.2: Pulling from library/redis
Digest: sha256:7334aa9d01abe31125301eda2212ecba6c3d89b8833e1031cf70cce4438fdae3
Status: Image is up to date for redis:3.2
$ docker info
Containers: 2
Images: 4390
Server Version: 1.9.1
Storage Driver: overlay
 Backing Filesystem: extfs
Execution Driver: native-0.2
Logging Driver: json-file
Kernel Version: 4.5.3-gentoo
Operating System: Gentoo/Linux
CPUs: 8
Total Memory: 30.88 GiB
Name: isengard
ID: UOCM:3F65:5FZC:6H5L:W3HY:34G4:A5XZ:SUOV:S2D4:XQTO:4KGA:6XSE
$ docker version
Client:
 Version:      1.9.1
 API version:  1.21
 Go version:   go1.5.3
 Git commit:   a34a1d5
 Built:        
 OS/Arch:      linux/amd64

Server:
 Version:      1.9.1
 API version:  1.21
 Go version:   go1.5.3
 Git commit:   a34a1d5
 Built:        
 OS/Arch:      linux/amd64

yosifkit avatar May 25 '16 23:05 yosifkit

docker info
Containers: 0
 Running: 0
 Paused: 0
 Stopped: 0
Images: 5
Server Version: 1.11.1
Storage Driver: devicemapper
 Pool Name: docker-8:2-2755406-pool
 Pool Blocksize: 65.54 kB
 Base Device Size: 10.74 GB
 Backing Filesystem: ext4
 Data file: /dev/loop0
 Metadata file: /dev/loop1
 Data Space Used: 1.529 GB
 Data Space Total: 107.4 GB
 Data Space Available: 23.41 GB
 Metadata Space Used: 3.195 MB
 Metadata Space Total: 2.147 GB
 Metadata Space Available: 2.144 GB
 Udev Sync Supported: true
 Deferred Removal Enabled: false
 Deferred Deletion Enabled: false
 Deferred Deleted Device Count: 0
 Data loop file: /var/lib/docker/devicemapper/devicemapper/data
 WARNING: Usage of loopback devices is strongly discouraged for production use. Either use `--storage-opt dm.thinpooldev` or use `--storage-opt dm.no_warn_on_loop_devices=true` to suppress this warning.
 Metadata loop file: /var/lib/docker/devicemapper/devicemapper/metadata
 Library Version: 1.02.122 (2016-04-09)
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins: 
 Volume: local
 Network: bridge null host
Kernel Version: 4.5.4-1-ARCH
Operating System: Arch Linux
OSType: linux
Architecture: x86_64
CPUs: 8
Total Memory: 15.36 GiB
Name: devbox
ID: 4HW4:HVCY:42BW:OWTR:SAFQ:GK52:3K3Y:56UJ:JVGH:II2A:AYK4:XYXK
Docker Root Dir: /var/lib/docker
Debug mode (client): false
Debug mode (server): false
Username: jdevelop
Registry: https://index.docker.io/v1/

And then

docker run --name redis redis:3.2
1:M 26 May 05:53:32.604 # Creating Server TCP listening socket *:6379: unable to bind socket

jdevelop avatar May 26 '16 05:05 jdevelop

ipv6 is disabled on the host

jdevelop avatar May 26 '16 05:05 jdevelop

An issue on antirez/redis repo seems to give a solution: https://github.com/antirez/redis/issues/3241

samber avatar May 26 '16 08:05 samber

Does something like docker run -it --rm redis --bind 0.0.0.0 work? I cannot tell since I don't have any machines with ipv6 disabled.

yosifkit avatar May 26 '16 16:05 yosifkit

@yosifkit yes, that works fine - I can start redis with this bind parameter set to 0.0.0.0

Any chance to pass this via the command line to the docker while starting the service?

jdevelop avatar May 26 '16 16:05 jdevelop

docker run --name redis redis:3.2 --bind 0.0.0.0 that works fine, thanks for the hint! :smile:

jdevelop avatar May 26 '16 16:05 jdevelop

Hello, the bind works here as well, in my case, I disabled ipv6 because of this bug https://github.com/docker/docker/issues/2174

zkanda avatar Jun 29 '16 03:06 zkanda

Closing since this is an upstream issue (we don't set an explicit bind address and it defaults to using the IPv6 ::, which is the cause of this issue -- workarounds are listed above).

tianon avatar May 07 '18 21:05 tianon