Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

redis:alpine won't start since 6.2.0 #273

Closed
pingers opened this issue Mar 12, 2021 · 12 comments
Closed

redis:alpine won't start since 6.2.0 #273

pingers opened this issue Mar 12, 2021 · 12 comments

Comments

@pingers
Copy link

pingers commented Mar 12, 2021

I can't figure out why the redis:alpine image no longer starts. Other redis images are fine. Can anyone else replicate this?

$ docker run redis:alpine
1:C 12 Mar 2021 04:45:21.239 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
1:C 12 Mar 2021 04:45:21.239 # Redis version=6.2.1, bits=64, commit=00000000, modified=0, pid=1, just started
1:C 12 Mar 2021 04:45:21.239 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
1:M 12 Mar 2021 04:45:21.240 * monotonic clock: POSIX clock_gettime
1:M 12 Mar 2021 04:45:21.245 # Could not create server TCP listening socket ::*:6379: unable to bind socket, errno: 97

$ docker run redis:6.0-alpine
1:C 12 Mar 2021 04:52:09.415 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
1:C 12 Mar 2021 04:52:09.415 # Redis version=6.0.12, bits=64, commit=00000000, modified=0, pid=1, just started
1:C 12 Mar 2021 04:52:09.415 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
1:M 12 Mar 2021 04:52:09.417 # Not listening to IPv6: unsupported
1:M 12 Mar 2021 04:52:09.417 * Running mode=standalone, port=6379.
1:M 12 Mar 2021 04:52:09.417 # Server initialized
1:M 12 Mar 2021 04:52:09.417 * Ready to accept connections

$ docker run redis
1:C 12 Mar 2021 04:45:28.345 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
1:C 12 Mar 2021 04:45:28.345 # Redis version=6.2.1, bits=64, commit=00000000, modified=0, pid=1, just started
1:C 12 Mar 2021 04:45:28.345 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
1:M 12 Mar 2021 04:45:28.345 * monotonic clock: POSIX clock_gettime
1:M 12 Mar 2021 04:45:28.349 # Could not create server TCP listening socket ::*:6379: unable to bind socket, errno: 97
1:M 12 Mar 2021 04:45:28.349 * Running mode=standalone, port=6379.
1:M 12 Mar 2021 04:45:28.349 # Server initialized
1:M 12 Mar 2021 04:45:28.350 * Ready to accept connections

For now, I'm using as a workaround redis:6.0-alpine

@wglambert
Copy link

I'm not able to reproduce, maybe it's a corrupted pull? You could try docker image rm redis:alpine and re-pull it

$ docker run -d --rm --name redis --network=test redis:alpine
Unable to find image 'redis:alpine' locally
alpine: Pulling from library/redis
ba3557a56b15: Pull complete 
4f47664a3e94: Pull complete 
f5c47feea59c: Pull complete 
272e3afc50bf: Pull complete 
805d34969732: Pull complete 
37f0fe75cbce: Pull complete 
Digest: sha256:13d80faeb3c96148bacb39e56aff3fcc3965efbc49be571b1599dfb1908450a7
Status: Downloaded newer image for redis:alpine
0d03a1a011d2ebeaf883604c7f123fb1d7a175e63bcca06b785bb91386f0b71d

$ docker logs redis
1:C 12 Mar 2021 15:52:17.849 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
1:C 12 Mar 2021 15:52:17.849 # Redis version=6.2.1, bits=64, commit=00000000, modified=0, pid=1, just started
1:C 12 Mar 2021 15:52:17.849 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
1:M 12 Mar 2021 15:52:17.849 * monotonic clock: POSIX clock_gettime
1:M 12 Mar 2021 15:52:17.850 * Running mode=standalone, port=6379.
1:M 12 Mar 2021 15:52:17.850 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
1:M 12 Mar 2021 15:52:17.850 # Server initialized
1:M 12 Mar 2021 15:52:17.851 * Ready to accept connections

$ docker run -it --rm --network=test redis:alpine redis-cli -h redis
redis:6379> INFO server
# Server
redis_version:6.2.1
redis_git_sha1:00000000
redis_git_dirty:0
redis_build_id:15f14c5aba126a5a
redis_mode:standalone
os:Linux 4.4.0-96-generic x86_64
arch_bits:64
multiplexing_api:epoll
atomicvar_api:atomic-builtin
gcc_version:10.2.1
process_id:1
process_supervised:no
run_id:e1a32dc5769189afdba23dbdb49d79082b7a3aa3
tcp_port:6379
server_time_usec:1615564628094452
uptime_in_seconds:140
uptime_in_days:0
hz:10
configured_hz:10
lru_clock:4951892
executable:/data/redis-server
config_file:
io_threads_active:0
redis:6379>

@pingers
Copy link
Author

pingers commented Mar 12, 2021

Doesn't seem like a corrupted image issue.

$ docker network create test
feb5e9c9f7eb72e96989532fce81ac83eda8dc65b858e34f9de7859113bb6251
$ docker run -d --name redis --network=test redis:alpine
Unable to find image 'redis:alpine' locally
alpine: Pulling from library/redis
ba3557a56b15: Already exists 
4f47664a3e94: Already exists 
f5c47feea59c: Already exists 
272e3afc50bf: Pull complete 
805d34969732: Pull complete 
37f0fe75cbce: Pull complete 
Digest: sha256:13d80faeb3c96148bacb39e56aff3fcc3965efbc49be571b1599dfb1908450a7
Status: Downloaded newer image for redis:alpine
2e5fc27b9d89f50d7b9c4688ffa2310d2750fc16ad045ebc4c2309bef0f82265

$ docker logs redis
1:C 12 Mar 2021 17:43:32.058 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
1:C 12 Mar 2021 17:43:32.058 # Redis version=6.2.1, bits=64, commit=00000000, modified=0, pid=1, just started
1:C 12 Mar 2021 17:43:32.058 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
1:M 12 Mar 2021 17:43:32.059 * monotonic clock: POSIX clock_gettime
1:M 12 Mar 2021 17:43:32.060 # Could not create server TCP listening socket ::*:6379: unable to bind socket, errno: 97

Must be something environmental. Happy to close it given you can't reproduce. I'll update if I find the cause.

@pingers pingers closed this as completed Mar 12, 2021
@yosifkit
Copy link
Contributor

Are you running an arm based image? Possibly a duplicate of #272 and #269 (comment)

@pingers
Copy link
Author

pingers commented Mar 13, 2021

20.04 Ubuntu x86 64

@olliemath
Copy link

olliemath commented Mar 15, 2021

Hello, why was this closed? Did you find a fix?

We're seeing this exact issue on some RHEL 7 x86 systems with IPv6 disabled (unfortunately I don't have access to the systems to dig any further, and getting IPv6 enabled is a big change request)

I haven't been able to reproduce locally, the only suspicious thing in the server logs is this line:

dockerd[1195]: time="2021-03-11T14:35:55-05:00"
  level=warning msg="file does not exist: /proc/sys/net/ipv6/conf/all/disable_ipv6 : 
  stat /proc/sys/net/ipv6/conf/all/disable_ipv6: no such file or directory
  Has IPv6 been disabled in this node's kernel?"

so I assume it's some funky combo of alpine+redis not realising IPv6 is disabled and trying to bind an IPv6 address

@pingers
Copy link
Author

pingers commented Mar 15, 2021

Oh you're totally right. I have another 20.04 box with ipv6 enabled.

ipv6 enabled.

$ docker run --name redis --network=test redis:alpine
1:C 15 Mar 2021 15:35:27.795 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
1:C 15 Mar 2021 15:35:27.795 # Redis version=6.2.1, bits=64, commit=00000000, modified=0, pid=1, just started
1:C 15 Mar 2021 15:35:27.795 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
1:M 15 Mar 2021 15:35:27.795 * monotonic clock: POSIX clock_gettime
1:M 15 Mar 2021 15:35:27.796 * Running mode=standalone, port=6379.
1:M 15 Mar 2021 15:35:27.796 # Server initialized
1:M 15 Mar 2021 15:35:27.796 * Ready to accept connections

@pingers pingers reopened this Mar 15, 2021
@pingers
Copy link
Author

pingers commented Mar 15, 2021

Confirmed on the ipv4 only box using default redis.conf from https://raw.githubusercontent.com/redis/redis/6.2.1/redis.conf and changing bind 127.0.0.1 -::1 to bind 127.0.0.1

$ docker run --name redis --network=test -v /home/michael/redis/:/usr/local/etc/redis redis:alpine redis-server /usr/local/etc/redis/redis.conf
1:C 15 Mar 2021 15:49:13.853 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
1:C 15 Mar 2021 15:49:13.853 # Redis version=6.2.1, bits=64, commit=00000000, modified=0, pid=1, just started
1:C 15 Mar 2021 15:49:13.853 # Configuration loaded
1:M 15 Mar 2021 15:49:13.853 * monotonic clock: POSIX clock_gettime
1:M 15 Mar 2021 15:49:13.854 * Running mode=standalone, port=6379.
1:M 15 Mar 2021 15:49:13.854 # Server initialized
1:M 15 Mar 2021 15:49:13.854 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
1:M 15 Mar 2021 15:49:13.854 * Ready to accept connections

@itamarhaber
Copy link
Member

This smells fishy, although I wasn't able to reproduce this in a VM with IPv6 disabled. That said, 6.2 included at least one change in that neighborhood so pinging @yossigo.

yossigo added a commit to redis/redis that referenced this issue Mar 16, 2021
listenToPort attempts to gracefully handle and ignore certain errors but does not store errno prior to logging, which in turn calls several libc functions that may overwrite errno.

This has been discovered due to libmusl strftime() always returning with errno set to EINVAL, which resulted with redis/docker-library-redis#273.
@sjoqvist
Copy link

sjoqvist commented Apr 7, 2021

I have this problem on Arch Linux with kernel 5.10.27-1-lts and Docker image redis:6.2.1-alpine3.13. Version 6.0 used to work fine.

My kernel command line parameters include ipv6.disable=1. I discovered that removing this parameter fixed the issue.

@itamarhaber
Copy link
Member

This should be fixed in the next patch-level release (6.2.2 ETA ~13/4/2021).

oranagra pushed a commit to redis/redis that referenced this issue May 3, 2021
listenToPort attempts to gracefully handle and ignore certain errors but does not store errno prior to logging, which in turn calls several libc functions that may overwrite errno.

This has been discovered due to libmusl strftime() always returning with errno set to EINVAL, which resulted with redis/docker-library-redis#273.

(cherry picked from commit df5f543)
@tianon
Copy link
Contributor

tianon commented Sep 1, 2021

This is probably long-since fixed now, right?

@pingers
Copy link
Author

pingers commented Sep 1, 2021

Yes - committed and resolved the issue for me 👍

JackieXie168 pushed a commit to JackieXie168/redis that referenced this issue Sep 8, 2021
listenToPort attempts to gracefully handle and ignore certain errors but does not store errno prior to logging, which in turn calls several libc functions that may overwrite errno.

This has been discovered due to libmusl strftime() always returning with errno set to EINVAL, which resulted with redis/docker-library-redis#273.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants