Skip to content

minio minio Allow binding to available addresses. If no binding is possible then fail otherwise proceed silently

Allan Roger Reid edited this page Jan 25, 2023 · 1 revision

Status: Open

Pull Request

https://github.com/minio/minio/pull/16388

Issues

https://github.com/minio/minio/issues/16305

Steps: Reproduce using Ubuntu(A), MacOS(B)

Linux version A

ubuntu@minio:~$ uname -a
Linux minio 5.4.0-136-generic #153-Ubuntu SMP Thu Nov 24 15:59:04 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux

go version

ubuntu@minio:~/minio$ go version
go version go1.19.4 linux/arm64

MacOS B

➜  ~ uname -a
Darwin Allans-MBP 22.2.0 Darwin Kernel Version 22.2.0: Fri Nov 11 02:03:51 PST 2022; root:xnu-8792.61.2~4/RELEASE_ARM64_T6000 arm64

go version

➜  ~ go version
go version go1.19.4 darwin/arm64

Description

Allow binding to available addresses. If no binding is possible then report failure otherwise proceed silently Fixes: https://github.com/minio/minio/issues/16305

Motivation and Context

Even though user may not have ipv6 interfaces defined, on lo0 for example ifconfig lo0, dns may be listening ipv6 sudo lsof -i :53 -S. In this case, minio attempts to bind to that unbindable ipv6 address [::1] and is unable to start. It fails with error:

Error: listen tcp [::1]:9000: bind: can't assign requested address (*net.OpError)

How to test this PR?

  1. Clone, checkout and build minio:master
git clone https://github.com/minio/minio.git
cd minio
git checkout master
make build
go install -v 
  1. Temporarily disable ipv6: A
ip addr show
sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1
sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1
sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=1
ip addr show

B

sudo ifconfig lo0 inet6 ::1 delete
  1. Run minio server with:
minio server --address "localhost:9000" --console-address "localhost:9090" <some empty folder>
  1. Observe failure
Error: listen tcp [::1]:9000: bind: can't assign requested address (*net.OpError)

A

image

B

image
  1. Pull, checkout and build fix
git clone https://github.com/allanrogerr/minio.git
cd minio
git pull --all
git checkout handle-unsupported-ipv6
make build
go install -v 
  1. Run minio server with:
minio server --address "localhost:9000" --console-address "localhost:9090" <some empty folder>
  1. Observe no failure
  2. Revert ipv6 interface from Lo0: A
sudo sysctl -w net.ipv6.conf.all.disable_ipv6=0
sudo sysctl -w net.ipv6.conf.default.disable_ipv6=0
sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=0

B

sudo ifconfig lo0 inet6 ::1 add
  1. Run minio server with:
minio server --address "localhost:9000" --console-address "localhost:9090" <some empty folder>
image
  1. Observe no failure
Clone this wiki locally