[MDEV-26194] bind_address = :: no longer listens on ipv4 Created: 2021-07-21  Updated: 2021-12-17  Resolved: 2021-12-17

Status: Closed
Project: MariaDB Server
Component/s: Configuration, Documentation, Server
Affects Version/s: 10.6.3
Fix Version/s: N/A

Type: Bug Priority: Trivial
Reporter: sjon Assignee: Ian Gilfillan
Resolution: Fixed Votes: 0
Labels: None
Environment:

linux


Issue Links:
Problem/Incident
is caused by MDEV-6536 make --bind=hostname to listen on bot... Closed

 Description   

I'm not sure if this is a bug, or maybe this should be documented a lot better because I spent some time on this.

Probably caused by MDEV-6536, specifying

bind_address = ::

no longer listens on both ipv4 and ipv6 like it did before. It now only listens on ipv6, causing unexpected "Connection Refused" errors when connecting through ipv4.

Previously mariadb listened on

*:3306

, in 10.6 this became

[::]:3306



 Comments   
Comment by Daniel Black [ 2021-07-21 ]

the sysctl net.ipv6.bindv6only is meant to control the behaviour of ::

Given the test cases in MDEV-6536 changed from :: -> * in bind address you are probably right about it being cased there.

In fact the removal of this rather gastly hack changed the behavior (that I kind of think shouldn't have been there to start with).
https://github.com/MariaDB/server/commit/b3abcf80a1be71502c1e25e0feb40ccea4648f4e#diff-2dce75ff069f612088d16147d9f58171c0614688cf5f7329789a692892c4c752L2276-L2289

I'm not sure I'd like to see the behavior restored, but I agree with documenting it better. Along with '*' as an bind-address option. Sorry you got caught out by this.

Comment by sjon [ 2021-07-21 ]

thanks for your explanation Daniel. I did indeed find '*' as a proper replacement.
Imo this should be listed as being (somewhat) "backward breaking" in either the changelog or the release notes for the GA release

Comment by Vladislav Vaintroub [ 2021-07-21 ]

Yeah, the documentation raises a brow https://mariadb.com/kb/en/server-system-variables/#bind_address

"By default, the MariaDB server listens for TCP/IP connections on a network socket bound to a single address, 0.0.0.0" - Wrong , by default it listens on all addresses

"In Debian and Ubuntu, the default bind_address is 127.0.0.1" - wrong, the server does not detect if it runs on Debian an Ubuntu., and it does not change own defaults. Perhaps there is a hack in deb packaing that changes my.cnf, but it is not the same as "default bind_address"

sjon, you do not have to set it at all

Comment by sjon [ 2021-07-21 ]

wlad you might be right - but there was a time when mariadb didn't listen to ipv6 by default and this was the best method to fix that

Comment by Joachim Tingvold [ 2021-12-16 ]

We have the opposite problem. We have IPv6-only servers, and have set bind-address=::. Upgrading from 10.4 to 10.6, we see that it now only listens to 127.0.0.01:3306 (and none of the IPv6 addresses). Trying to unset it does not yield any different result.

It seems that this "cleanup" referenced above, might have broken more aspects?

Comment by Joachim Tingvold [ 2021-12-16 ]

Setting the value to bind-address=mysql3.foo.bar, where mysql3.foo.bar only resolves to an IPv6-address (both via /etc/hosts} and via DNS), it still only listens to {{127.0.0.1::3306. Same behaviour is observed if we explicitly set a specific IPv6 address.

edit: I thought maybe some other aspects of the setup changed, but galera and everything else works fine. Changing to port=3307 under the same config section works just fine (i.e. it now listens to 127.0.0.01:3307), meaning that the right configuration file is being used.

Comment by Joachim Tingvold [ 2021-12-16 ]

False alarm (-:

... for some reason, /etc/mysql/mariadb.conf.d/50-server.cnf had been added as part of the upgrade, that overrode whatever was set in /etc/mysql/my.cnf.

Comment by Daniel Black [ 2021-12-17 ]

The system variables page for bind-address has been updated.

Generated at Thu Feb 08 09:43:27 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.